GHSA-pjx8-984p-7p3x: Friendsofsymfony/user bundle FOSUserBundle Entropy Is Lost Vulnerability

MODERATE
CWE-331
Published
Advisory Summary

GHSA-pjx8-984p-7p3x is a MODERATE fosuserbundle entropy is lost vulnerability (CWE-331: Insufficient Entropy) affecting Friendsofsymfony/user bundle libraries in the Packagist ecosystem. The issue involves fosuserbundle entropy is lost in the tokengenerator. Remediation is available by upgrading affected packages to version 1.3.5.

GHSA-pjx8-984p-7p3x at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-pjx8-984p-7p3x
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-331: Insufficient Entropy
Affected Product Friendsofsymfony/user bundle
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix GHSA-pjx8-984p-7p3x

To remediate this vulnerability, upgrade all affected Friendsofsymfony/user bundle dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

friendsofsymfony/user-bundle fixed: 1.3.5
Upgrade friendsofsymfony/user-bundle to 1.3.5
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for friendsofsymfony/user-bundle

How to Check if You Are Affected

To determine whether your application is affected by GHSA-pjx8-984p-7p3x, inspect your project dependencies for Friendsofsymfony/user bundle:

inspect dependencies for friendsofsymfony/user-bundle

Analyze the terminal output to locate any version of Friendsofsymfony/user bundle in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.3.5), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-331: Insufficient Entropy, where the product uses an algorithm or scheme that produces insufficient entropy, leaving patterns or clusters of values that are more likely to occur than others. In Friendsofsymfony/user bundle, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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

GHSA-pjx8-984p-7p3x Affected Friendsofsymfony/user bundle Versions

1 component(s)
Fixed Versions:
1.3.5
Product / Package Ecosystem Affected Versions Fixed Version
friendsofsymfony/user-bundle
Packagist
≥ 1.0.0
< 1.3.5
1.3.5

References

Frequently Asked Questions

What is GHSA-pjx8-984p-7p3x?
GHSA-pjx8-984p-7p3x is a security vulnerability in Friendsofsymfony/user bundle involving FOSUserBundle Entropy is lost in the TokenGenerator under CWE-331: Insufficient Entropy.
Which Friendsofsymfony/user bundle versions are affected?
Affected versions include releases prior to 1.3.5 across affected packages: friendsofsymfony/user-bundle.
What version fixes GHSA-pjx8-984p-7p3x?
Upgrading to 1.3.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is friendsofsymfony/user-bundle affected?
Yes, friendsofsymfony/user-bundle is affected in releases prior to 1.3.5. Upgrade your dependency to 1.3.5 or later.
What CWE is associated with GHSA-pjx8-984p-7p3x?
GHSA-pjx8-984p-7p3x is classified under CWE-331: Insufficient Entropy (The product uses an algorithm or scheme that produces insufficient entropy, leaving patterns or clusters of values that are more likely to occur than others.).
How can I check Packagist dependencies for GHSA-pjx8-984p-7p3x?
Run the dependency tree command: 'inspect dependencies for friendsofsymfony/user-bundle'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-pjx8-984p-7p3x",
  "modified" : "2024-05-15T21:42:25Z",
  "published" : "2024-05-15T21:42:25Z",
  "aliases" : [ ],
  "summary" : "FOSUserBundle Entropy is lost in the TokenGenerator",
  "details" : "### Description\nBecause 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.\n\n### Resolution\nThe 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\\-]+.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "friendsofsymfony/user-bundle"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.0.0"
      }, {
        "fixed" : "1.3.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfSymfony/FOSUserBundle/commit/b3ebfea52065e9727508f5f8e6c9f7459a1b06d8"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/friendsofsymfony/user-bundle/2014-09-04-1.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/FriendsOfSymfony/FOSUserBundle"
  }, {
    "type" : "WEB",
    "url" : "https://symfony.com/blog/fosuserbundle-entropy-of-generated-tokens-is-lost"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-331" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-05-15T21:42:25Z",
    "nvd_published_at" : null
  }
}