CVE-2022-24895: Symfony/security bundle Symfony Vulnerable To Session Fixation Vulnerability

MODERATE
Advisory Identifier: GHSA-3gv2-29qc-v67m
CVSS 6.3
CWE-613 CWE-384
Published
Advisory Summary

CVE-2022-24895 is a MODERATE (CVSS 6.3) symfony vulnerable to session fixation vulnerability (CWE-613: Insufficient Session Expiration) affecting Symfony/security bundle libraries in the Packagist ecosystem. The issue involves symfony vulnerable to session fixation of csrf tokens. Remediation is available by upgrading affected packages to version 4.4.50, 5.4.20, 6.0.20, 6.1.12, 6.2.6.

CVE-2022-24895 at a Glance

CVE Identifier CVE-2022-24895
GHSA Identifier GHSA-3gv2-29qc-v67m
Severity MODERATE
CVSS v3.1 Base Score 6.3
CWE Classification CWE-613: Insufficient Session Expiration
Affected Product Symfony/security bundle
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 6.3

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:R/S:U/C:L/I:L/A:L).

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

How to Fix CVE-2022-24895

To remediate this vulnerability, upgrade all affected Symfony/security 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.

symfony/security-bundle fixed: 4.4.50
Upgrade symfony/security-bundle to 4.4.50
symfony/security-bundle fixed: 5.4.20
Upgrade symfony/security-bundle to 5.4.20
symfony/security-bundle fixed: 6.0.20
Upgrade symfony/security-bundle to 6.0.20
symfony/security-bundle fixed: 6.1.12
Upgrade symfony/security-bundle to 6.1.12
symfony/security-bundle fixed: 6.2.6
Upgrade symfony/security-bundle to 6.2.6
symfony/symfony fixed: 4.4.50
Upgrade symfony/symfony to 4.4.50
symfony/symfony fixed: 5.4.20
Upgrade symfony/symfony to 5.4.20
symfony/symfony fixed: 6.0.20
Upgrade symfony/symfony to 6.0.20
symfony/symfony fixed: 6.1.12
Upgrade symfony/symfony to 6.1.12
symfony/symfony fixed: 6.2.6
Upgrade symfony/symfony to 6.2.6
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-bundle

How to Check if You Are Affected

To determine whether your application is affected by CVE-2022-24895, inspect your project dependencies for Symfony/security bundle:

inspect dependencies for symfony/security-bundle

Analyze the terminal output to locate any version of Symfony/security bundle in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.4.50), 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-613: Insufficient Session Expiration, where according to wasc, "insufficient session expiration is when a web site permits an attacker to reuse old session credentials or session ids for authorization.". In Symfony/security 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 ----------- When authenticating users Symfony by default regenerates the session ID upon login, but preserves the rest of session attributes. Because this does not clear CSRF tokens upon login, this might enables [same-site attackers](https://canitakeyoursubdomain.name/) to bypass the CSRF protection mechanism by performing an attack similar to a session-fixation. Resolution ---------- Symfony removes all CSRF tokens from the session on successful login. The patch for this issue is available [here](https://github.com/symfony/symfony/commit/5909d74ecee359ea4982fcf4331aaf2e489a1fd4) for branch 4.4. Credits ------- We would like to thank Marco Squarcina for reporting the issue and Nicolas Grekas for fixing it.

CVE-2022-24895 Affected Symfony/security bundle Versions

10 component(s)
Fixed Versions:
4.4.505.4.206.0.206.1.126.2.6
Product / Package Ecosystem Affected Versions Fixed Version
symfony/security-bundle
Packagist
≥ 2.0.0
< 4.4.50
4.4.50
symfony/security-bundle
Packagist
≥ 5.0.0
< 5.4.20
5.4.20
symfony/security-bundle
Packagist
≥ 6.0.0
< 6.0.20
6.0.20
symfony/security-bundle
Packagist
≥ 6.1.0
< 6.1.12
6.1.12
symfony/security-bundle
Packagist
≥ 6.2.0
< 6.2.6
6.2.6
symfony/symfony
Packagist
≥ 2.0.0
< 4.4.50
4.4.50
symfony/symfony
Packagist
≥ 5.0.0
< 5.4.20
5.4.20
symfony/symfony
Packagist
≥ 6.0.0
< 6.0.20
6.0.20
symfony/symfony
Packagist
≥ 6.1.0
< 6.1.12
6.1.12
symfony/symfony
Packagist
≥ 6.2.0
< 6.2.6
6.2.6

References

Frequently Asked Questions

What is CVE-2022-24895?
CVE-2022-24895 is a security vulnerability in Symfony/security bundle involving Symfony vulnerable to Session Fixation of CSRF tokens under CWE-613: Insufficient Session Expiration.
Which Symfony/security bundle versions are affected?
Affected versions include releases prior to 4.4.50, 5.4.20, 6.0.20, 6.1.12, 6.2.6 across affected packages: symfony/security-bundle, symfony/symfony.
What version fixes CVE-2022-24895?
Upgrading to 4.4.50, 5.4.20, 6.0.20, 6.1.12, 6.2.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is symfony/security-bundle affected?
Yes, symfony/security-bundle is affected in releases prior to 4.4.50, 5.4.20, 6.0.20, 6.1.12, 6.2.6. Upgrade your dependency to 4.4.50, 5.4.20, 6.0.20, 6.1.12, 6.2.6 or later.
Is symfony/symfony affected?
Yes, symfony/symfony is affected in releases prior to 4.4.50, 5.4.20, 6.0.20, 6.1.12, 6.2.6. Upgrade your dependency to 4.4.50, 5.4.20, 6.0.20, 6.1.12, 6.2.6 or later.
What is the CVSS score of CVE-2022-24895?
CVE-2022-24895 has a CVSS v3.1 base score of 6.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:L.
What CWE is associated with CVE-2022-24895?
CVE-2022-24895 is classified under CWE-613: Insufficient Session Expiration (According to WASC, "Insufficient Session Expiration is when a web site permits an attacker to reuse old session credentials or session IDs for authorization.").
How can I check Packagist dependencies for CVE-2022-24895?
Run the dependency tree command: 'inspect dependencies for symfony/security-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-3gv2-29qc-v67m",
  "modified" : "2025-02-13T18:36:42Z",
  "published" : "2023-02-01T18:48:06Z",
  "aliases" : [ "CVE-2022-24895" ],
  "summary" : "Symfony vulnerable to Session Fixation of CSRF tokens",
  "details" : "Description\n-----------\n\nWhen authenticating users Symfony by default regenerates the session ID upon login, but preserves the rest of session attributes. Because this does not clear CSRF tokens upon login, this might enables [same-site attackers](https://canitakeyoursubdomain.name/) to bypass the CSRF protection mechanism by performing an attack similar to a session-fixation.\n\nResolution\n----------\n\nSymfony removes all CSRF tokens from the session on successful login.\n\nThe patch for this issue is available [here](https://github.com/symfony/symfony/commit/5909d74ecee359ea4982fcf4331aaf2e489a1fd4) for branch 4.4.\n\nCredits\n-------\n\nWe would like to thank Marco Squarcina for reporting the issue and Nicolas Grekas for fixing it.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/security-bundle"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "4.4.50"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/security-bundle"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.0.0"
      }, {
        "fixed" : "5.4.20"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/security-bundle"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.0.0"
      }, {
        "fixed" : "6.0.20"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/security-bundle"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.1.0"
      }, {
        "fixed" : "6.1.12"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/security-bundle"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.2.0"
      }, {
        "fixed" : "6.2.6"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/symfony"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "4.4.50"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/symfony"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.0.0"
      }, {
        "fixed" : "5.4.20"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/symfony"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.0.0"
      }, {
        "fixed" : "6.0.20"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/symfony"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.1.0"
      }, {
        "fixed" : "6.1.12"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/symfony"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.2.0"
      }, {
        "fixed" : "6.2.6"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/symfony/symfony/security/advisories/GHSA-3gv2-29qc-v67m"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-24895"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/symfony/security-bundle/commit/076fd2088ada33d760758d98ff07ddedbf567946"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/symfony/symfony/commit/5909d74ecee359ea4982fcf4331aaf2e489a1fd4"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/security-bundle/CVE-2022-24895.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/symfony/CVE-2022-24895.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/symfony/symfony"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2023/07/msg00014.html"
  }, {
    "type" : "WEB",
    "url" : "https://symfony.com/cve-2022-24895"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-384", "CWE-613" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-02-01T18:48:06Z",
    "nvd_published_at" : "2023-02-03T22:15:00Z"
  }
}