CVE-2024-51996: Symfony/security http Authentication Bypass Vulnerability

HIGH
Advisory Identifier: GHSA-cg23-qf8f-62rr
CVSS 7.5
CWE-287 CWE-289
Published
Advisory Summary

CVE-2024-51996 is a HIGH (CVSS 7.5) authentication bypass vulnerability (CWE-287: Improper Authentication) affecting Symfony/security http libraries in the Packagist ecosystem. The issue involves symfony has an authentication bypass via rememberme. Remediation is available by upgrading affected packages to version 5.4.47, 6.4.15, 7.1.8.

CVE-2024-51996 at a Glance

CVE Identifier CVE-2024-51996
GHSA Identifier GHSA-cg23-qf8f-62rr
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-287: Improper Authentication
Affected Product Symfony/security http
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2024-51996

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

symfony/security-http fixed: 5.4.47
Upgrade symfony/security-http to 5.4.47
symfony/security-http fixed: 6.4.15
Upgrade symfony/security-http to 6.4.15
symfony/security-http fixed: 7.1.8
Upgrade symfony/security-http to 7.1.8
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 symfony/security-http

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-51996, inspect your project dependencies for Symfony/security http:

inspect dependencies for symfony/security-http

Analyze the terminal output to locate any version of Symfony/security http in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.4.47), 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-287: Improper Authentication, where when an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct. In Symfony/security http, 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 When consuming a persisted remember-me cookie, Symfony does not check if the username persisted in the database matches the username attached with the cookie, leading to authentication bypass. ### Resolution The `PersistentRememberMeHandler` class now ensures the submitted username is the cookie owner. The patch for this issue is available [here](https://github.com/symfony/symfony/commit/81354d392c5f0b7a52bcbd729d6f82501e94135a) for branch 5.4. ### Credits We would like to thank Moritz Rauch - Pentryx AG for reporting the issue and Jérémy Derussé for providing the fix.

CVE-2024-51996 Affected Symfony/security http Versions

3 component(s)
Fixed Versions:
5.4.476.4.157.1.8
Product / Package Ecosystem Affected Versions Fixed Version
symfony/security-http
Packagist
≥ 5.3.0
< 5.4.47
5.4.47
symfony/security-http
Packagist
≥ 6.0.0-BETA1
< 6.4.15
6.4.15
symfony/security-http
Packagist
≥ 7.0.0-BETA1
< 7.1.8
7.1.8

References

Frequently Asked Questions

What is CVE-2024-51996?
CVE-2024-51996 is a security vulnerability in Symfony/security http involving Symfony has an Authentication Bypass via RememberMe under CWE-287: Improper Authentication.
Which Symfony/security http versions are affected?
Affected versions include releases prior to 5.4.47, 6.4.15, 7.1.8 across affected packages: symfony/security-http.
What version fixes CVE-2024-51996?
Upgrading to 5.4.47, 6.4.15, 7.1.8 (or the latest patched release for your respective branch) resolves the vulnerability.
Is symfony/security-http affected?
Yes, symfony/security-http is affected in releases prior to 5.4.47, 6.4.15, 7.1.8. Upgrade your dependency to 5.4.47, 6.4.15, 7.1.8 or later.
What is the CVSS score of CVE-2024-51996?
CVE-2024-51996 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2024-51996?
CVE-2024-51996 is classified under CWE-287: Improper Authentication (When an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct.).
How can I check Packagist dependencies for CVE-2024-51996?
Run the dependency tree command: 'inspect dependencies for symfony/security-http'. 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-cg23-qf8f-62rr",
  "modified" : "2024-11-14T23:55:43Z",
  "published" : "2024-11-13T18:29:04Z",
  "aliases" : [ "CVE-2024-51996" ],
  "summary" : "Symfony has an Authentication Bypass via RememberMe",
  "details" : "### Description\n\nWhen consuming a persisted remember-me cookie, Symfony does not check if the username persisted in the database matches the username attached with the cookie, leading to authentication bypass.\n\n### Resolution\n\nThe `PersistentRememberMeHandler` class now ensures the submitted username is the cookie owner.\n\nThe patch for this issue is available [here](https://github.com/symfony/symfony/commit/81354d392c5f0b7a52bcbd729d6f82501e94135a) for branch 5.4.\n\n### Credits\n\nWe would like to thank Moritz Rauch - Pentryx AG for reporting the issue and Jérémy Derussé for providing the fix.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/security-http"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.3.0"
      }, {
        "fixed" : "5.4.47"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/security-http"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.0.0-BETA1"
      }, {
        "fixed" : "6.4.15"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/security-http"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "7.0.0-BETA1"
      }, {
        "fixed" : "7.1.8"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/symfony/symfony/security/advisories/GHSA-cg23-qf8f-62rr"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-51996"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/symfony/symfony/commit/81354d392c5f0b7a52bcbd729d6f82501e94135a"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/security-http/CVE-2024-51996.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/symfony/CVE-2024-51996.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/symfony/symfony"
  }, {
    "type" : "WEB",
    "url" : "https://symfony.com/cve-2024-51996"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-287", "CWE-289" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-11-13T18:29:04Z",
    "nvd_published_at" : "2024-11-13T17:15:11Z"
  }
}