# GHSA-pjx8-984p-7p3x: FOSUserBundle Entropy is lost in the TokenGenerator

- Severity: Medium (rating, scored by GitHub)
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2024-05-15T21:42:25.000Z
- Modified: 2024-11-29T05:41:12.279Z
- Weaknesses: CWE-331

## Description

### 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\-]+.

(As written by GitHub Advisory Database.)

## Affected

- friendsofsymfony/user-bundle (Packagist): from 1.0.0 before 1.3.5

## References

- <https://github.com/FriendsOfSymfony/FOSUserBundle/commit/b3ebfea52065e9727508f5f8e6c9f7459a1b06d8> (web)
- <https://github.com/FriendsOfPHP/security-advisories/blob/master/friendsofsymfony/user-bundle/2014-09-04-1.yaml> (web)
- <https://github.com/FriendsOfSymfony/FOSUserBundle> (package)
- <https://symfony.com/blog/fosuserbundle-entropy-of-generated-tokens-is-lost> (web)

## Sources

- GitHub Advisory Database: [GHSA-pjx8-984p-7p3x](https://github.com/advisories/GHSA-pjx8-984p-7p3x), CC-BY-4.0, modified 2024-11-29

---

Page: https://cve.day/GHSA-pjx8-984p-7p3x · Whole record: https://cve.day/GHSA-pjx8-984p-7p3x.json · Rebuilt by cve.day 2026-11-25T22:56:32.714Z
