CVE-2021-41268: Symfony/security bundle Cookie Persistence After Password Changes Vulnerability

MODERATE
Advisory Identifier: GHSA-qw36-p97w-vcqr
CVSS 6.5
CWE-384
Published
Advisory Summary

CVE-2021-41268 is a MODERATE (CVSS 6.5) cookie persistence after password changes vulnerability (CWE-384: Session Fixation) affecting Symfony/security bundle libraries in the Packagist ecosystem. The issue involves cookie persistence after password changes in symfony/security-bundle. Remediation is available by upgrading affected packages to version 5.3.12.

CVE-2021-41268 at a Glance

CVE Identifier CVE-2021-41268
GHSA Identifier GHSA-qw36-p97w-vcqr
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-384: Session Fixation
Affected Product Symfony/security bundle
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 6.5

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

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
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-2021-41268

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: 5.3.12
Upgrade symfony/security-bundle to 5.3.12
symfony/symfony fixed: 5.3.12
Upgrade symfony/symfony to 5.3.12
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-2021-41268, 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 5.3.12), 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-384: Session Fixation, where authenticating a user, or otherwise establishing a new user session, without invalidating any existing session identifier gives an attacker the opportunity to steal authenticated sessions. 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 ----------- Since the rework of the Remember me cookie in Symfony 5.3, the cookie is not invalidated anymore when the user changes its password. Attackers can therefore maintain their access to the account even if the password is changed as long as they have had the chance to login once and get a valid remember me cookie. Resolution ---------- Symfony now makes the password part of the signature by default. In that way, when the password changes then the cookie is not valid anymore. The patch for this issue is available [here](https://github.com/symfony/symfony/commit/36a808b857cd3240244f4b224452fb1e70dc6dfc) for branch 5.3. Credits ------- We would like to thank Thibaut Decherit for reporting the issue and Wouter J for fixing the issue.

CVE-2021-41268 Affected Symfony/security bundle Versions

2 component(s)
Fixed Versions:
5.3.12
Product / Package Ecosystem Affected Versions Fixed Version
symfony/security-bundle
Packagist
≥ 5.3.0
< 5.3.12
5.3.12
symfony/symfony
Packagist
≥ 5.3.0
< 5.3.12
5.3.12

References

Frequently Asked Questions

What is CVE-2021-41268?
CVE-2021-41268 is a security vulnerability in Symfony/security bundle involving Cookie persistence after password changes in symfony/security-bundle under CWE-384: Session Fixation.
Which Symfony/security bundle versions are affected?
Affected versions include releases prior to 5.3.12 across affected packages: symfony/security-bundle, symfony/symfony.
What version fixes CVE-2021-41268?
Upgrading to 5.3.12 (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 5.3.12. Upgrade your dependency to 5.3.12 or later.
Is symfony/symfony affected?
Yes, symfony/symfony is affected in releases prior to 5.3.12. Upgrade your dependency to 5.3.12 or later.
What is the CVSS score of CVE-2021-41268?
CVE-2021-41268 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2021-41268?
CVE-2021-41268 is classified under CWE-384: Session Fixation (Authenticating a user, or otherwise establishing a new user session, without invalidating any existing session identifier gives an attacker the opportunity to steal authenticated sessions.).
How can I check Packagist dependencies for CVE-2021-41268?
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-qw36-p97w-vcqr",
  "modified" : "2021-12-01T14:36:09Z",
  "published" : "2021-11-24T20:05:22Z",
  "aliases" : [ "CVE-2021-41268" ],
  "summary" : "Cookie persistence after password changes in symfony/security-bundle",
  "details" : "Description\n-----------\n\nSince the rework of the Remember me cookie in Symfony 5.3, the cookie is not invalidated anymore when the user changes its password. \n\nAttackers can therefore maintain their access to the account even if the password is changed as long as they have had the chance to login once and get a valid remember me cookie.\n\nResolution\n----------\n\nSymfony now makes the password part of the signature by default. In that way, when the password changes then the cookie is not valid anymore.\n\nThe patch for this issue is available [here](https://github.com/symfony/symfony/commit/36a808b857cd3240244f4b224452fb1e70dc6dfc) for branch 5.3.\n\nCredits\n-------\n\nWe would like to thank Thibaut Decherit for reporting the issue and Wouter J for fixing the issue.\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/security-bundle"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.3.0"
      }, {
        "fixed" : "5.3.12"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/symfony"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.3.0"
      }, {
        "fixed" : "5.3.12"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/symfony/symfony/security/advisories/GHSA-qw36-p97w-vcqr"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-41268"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/symfony/symfony/pull/44243"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/symfony/symfony/commit/36a808b857cd3240244f4b224452fb1e70dc6dfc"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/security-bundle/CVE-2021-41268.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/symfony/CVE-2021-41268.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/symfony/symfony"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/symfony/symfony/releases/tag/v5.3.12"
  }, {
    "type" : "WEB",
    "url" : "https://symfony.com/cve-2021-41268"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-384" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-11-24T20:00:03Z",
    "nvd_published_at" : "2021-11-24T19:15:00Z"
  }
}