FOSUserBundle Entropy is lost in the TokenGenerator
Description
Because of the usage of base_convert which looses precision for large inputs, the entropy of tokens generated by FOSUserBundle for the email confirmation and password resetting is lost. This makes these tokens much less random than they are expected to be, and so not cryptographically safe.
Resolution
The token generation logic used in the 2.0.x branch based on base64 encoding has been backported. This changes the range of characters used in the token. Any route placeholder expected to match a token generated by FOSUserBundle must be updated to allow dashes, which are not allowed by \w in regexes. A \w+ requirement should so become [\w-]+.
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| Composer package | friendsofsymfony/user-bundle | >= 1.0.0, < 1.3.5 | 1.3.5 |
References
- https://github.com/FriendsOfSymfony/FOSUserBundle/commit/b3ebfea52065e9727508f5f8e6c9f7459a1b06d8
- https://github.com/FriendsOfPHP/security-advisories/blob/master/friendsofsymfony/user-bundle/2014-09-04-1.yaml
- https://github.com/FriendsOfSymfony/FOSUserBundle
- https://symfony.com/blog/fosuserbundle-entropy-of-generated-tokens-is-lost
- Weakness (CWE)
CWE-331- Platform
- Composer
- Package
friendsofsymfony/user-bundle- Disclosed
- 15.05.2024
- Updated
- 11.10.2026 10:22
Sources and licenses
OSV / GitHub Advisory Database - GHSA-pjx8-984p-7p3x - CC BY 4.0
Vulnerability history: friendsofsymfony/user-bundle
All published vulnerabilities of this package (Composer package), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 4
- First → latest
- 05.2022 05.2024
- Without a fix
- 0
- Exploited in attacks
- 0
Severity breakdown
- High 1
- Medium 3
Disclosures per year
- 2022: 1
- 2023: 0
- 2024: 3
- 2025: 0
- 2026: 0
-
FOSUserBundle Entropy is lost in the TokenGenerator this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.