🌐 AI搜索 & 代理 主页
Skip to content

Conversation

@nicolas-grekas
Copy link
Member

Q A
Branch? 8.0
Bug fix? no
New feature? yes
Deprecations? no
Issues
License MIT

…tighten AuthenticatorManager and OidcTokenHandler arguments
@nicolas-grekas nicolas-grekas merged commit 000ade9 into symfony:8.0 Jul 21, 2025
2 of 9 checks passed
@nicolas-grekas nicolas-grekas deleted the sec-http-drop branch July 21, 2025 16:12
@fabpot fabpot mentioned this pull request Oct 27, 2025
nicolas-grekas added a commit that referenced this pull request Nov 24, 2025
…r normalizer (yoeunes)

This PR was merged into the 7.3 branch.

Discussion
----------

[Security] Fix `UserBadge` validation bypass via identifier normalizer

| Q             | A
| ------------- | ---
| Branch?       | 7.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | -
| License       | MIT

The `UserBadge` constructor validates that the identifier is not empty and does not exceed `MAX_USERNAME_LENGTH`.

However, when using `$identifierNormalizer`, the normalized identifier is computed lazily in `getUserIdentifier()` without validation. This allows normalizers to return invalid values:

```php
// This correctly triggers a deprecation in the constructor
new UserBadge('');

// This currently bypasses validation and returns an empty string
$badge = new UserBadge('valid_input', null, null, fn() => '');
$badge->getUserIdentifier();
```

Related to #51744 and #61183

I targeted `7.3` as it introduced `identifierNormalizer`, please let me know if I should target `8.0` or `8.1` instead.

Commits
-------

e4a759d [Security] Fix UserBadge validation bypass via identifier normalizer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants