CVE-2022-24894: Symfony/symfony Symfony Storing Cookie Headers Vulnerability

MODERATE
Advisory Identifier: GHSA-h7vf-5wrv-9fhv
CVSS 5.9
CWE-285
Published
Advisory Summary

CVE-2022-24894 is a MODERATE (CVSS 5.9) symfony storing cookie headers vulnerability (CWE-285: Improper Authorization) affecting Symfony/symfony libraries in the Packagist ecosystem. The issue involves symfony storing cookie headers in httpcache. Remediation is available by upgrading affected packages to version 6.0.20, 6.1.12, 4.4.50, 5.4.20, 6.2.6.

CVE-2022-24894 at a Glance

CVE Identifier CVE-2022-24894
GHSA Identifier GHSA-h7vf-5wrv-9fhv
Severity MODERATE
CVSS v3.1 Base Score 5.9
CWE Classification CWE-285: Improper Authorization
Affected Product Symfony/symfony
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 5.9

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

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

How to Fix CVE-2022-24894

To remediate this vulnerability, upgrade all affected Symfony/symfony 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/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/http-kernel fixed: 4.4.50
Upgrade symfony/http-kernel to 4.4.50
symfony/http-kernel fixed: 5.4.20
Upgrade symfony/http-kernel to 5.4.20
symfony/http-kernel fixed: 6.0.20
Upgrade symfony/http-kernel to 6.0.20
symfony/http-kernel fixed: 6.1.12
Upgrade symfony/http-kernel to 6.1.12
symfony/http-kernel fixed: 6.2.6
Upgrade symfony/http-kernel 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.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/symfony

How to Check if You Are Affected

To determine whether your application is affected by CVE-2022-24894, inspect your project dependencies for Symfony/symfony:

inspect dependencies for symfony/symfony

Analyze the terminal output to locate any version of Symfony/symfony in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 6.0.20), 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-285: Improper Authorization, where the product does not perform or incorrectly performs an authorization check when an actor attempts to access a resource or perform an action. In Symfony/symfony, 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 ----------- The Symfony HTTP cache system acts as a reverse proxy: it caches HTTP responses (including headers) and returns them to clients. In a recent `AbstractSessionListener` change, the response might now contain a `Set-Cookie` header. If the Symfony HTTP cache system is enabled, this header might be stored and returned to some other clients. An attacker can use this vulnerability to retrieve the victim's session. Resolution ---------- The `HttpStore` constructor now takes a parameter containing a list of private headers that are removed from the HTTP response headers. The default value for this parameter is `Set-Cookie`, but it can be overridden or extended by the application. The patch for this issue is available [here](https://github.com/symfony/symfony/commit/d2f6322af9444ac5cd1ef3ac6f280dbef7f9d1fb) for branch 4.4. Credits ------- We would like to thank Soner Sayakci for reporting the issue and Nicolas Grekas for fixing it.

CVE-2022-24894 Affected Symfony/symfony Versions

10 component(s)
Fixed Versions:
6.0.206.1.124.4.505.4.206.2.6
Product / Package Ecosystem Affected Versions Fixed Version
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/http-kernel
Packagist
≥ 2.0.0
< 4.4.50
4.4.50
symfony/http-kernel
Packagist
≥ 5.0.0
< 5.4.20
5.4.20
symfony/http-kernel
Packagist
≥ 6.0.0
< 6.0.20
6.0.20
symfony/http-kernel
Packagist
≥ 6.1.0
< 6.1.12
6.1.12
symfony/http-kernel
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.2.0
< 6.2.6
6.2.6

References

Frequently Asked Questions

What is CVE-2022-24894?
CVE-2022-24894 is a security vulnerability in Symfony/symfony involving Symfony storing cookie headers in HttpCache under CWE-285: Improper Authorization.
Which Symfony/symfony versions are affected?
Affected versions include releases prior to 6.0.20, 6.1.12, 4.4.50, 5.4.20, 6.2.6 across affected packages: symfony/symfony, symfony/http-kernel.
What version fixes CVE-2022-24894?
Upgrading to 6.0.20, 6.1.12, 4.4.50, 5.4.20, 6.2.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is symfony/symfony affected?
Yes, symfony/symfony is affected in releases prior to 6.0.20, 6.1.12, 4.4.50, 5.4.20, 6.2.6. Upgrade your dependency to 6.0.20, 6.1.12, 4.4.50, 5.4.20, 6.2.6 or later.
Is symfony/http-kernel affected?
Yes, symfony/http-kernel 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-24894?
CVE-2022-24894 has a CVSS v3.1 base score of 5.9 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:H/I:L/A:L.
What CWE is associated with CVE-2022-24894?
CVE-2022-24894 is classified under CWE-285: Improper Authorization (The product does not perform or incorrectly performs an authorization check when an actor attempts to access a resource or perform an action.).
How can I check Packagist dependencies for CVE-2022-24894?
Run the dependency tree command: 'inspect dependencies for symfony/symfony'. 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-h7vf-5wrv-9fhv",
  "modified" : "2025-02-13T18:36:40Z",
  "published" : "2023-02-01T18:48:09Z",
  "aliases" : [ "CVE-2022-24894" ],
  "summary" : "Symfony storing cookie headers in HttpCache",
  "details" : "Description\n-----------\n\nThe Symfony HTTP cache system acts as a reverse proxy: it caches HTTP responses (including headers) and returns them to clients.\n\nIn a recent `AbstractSessionListener` change, the response might now contain a `Set-Cookie` header. If the Symfony HTTP cache system is enabled, this header might be stored and returned to some other clients. An attacker can use this vulnerability to retrieve the victim's session.\n\nResolution\n----------\n\nThe `HttpStore` constructor now takes a parameter containing a list of private headers that are removed from the HTTP response headers.\nThe default value for this parameter is `Set-Cookie`, but it can be overridden or extended by the application.\n\nThe patch for this issue is available [here](https://github.com/symfony/symfony/commit/d2f6322af9444ac5cd1ef3ac6f280dbef7f9d1fb) for branch 4.4.\n\nCredits\n-------\n\nWe would like to thank Soner Sayakci for reporting the issue and Nicolas Grekas for fixing it.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:H/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/http-kernel"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "4.4.50"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/http-kernel"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.0.0"
      }, {
        "fixed" : "5.4.20"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/http-kernel"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.0.0"
      }, {
        "fixed" : "6.0.20"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/http-kernel"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.1.0"
      }, {
        "fixed" : "6.1.12"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/http-kernel"
    },
    "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-h7vf-5wrv-9fhv"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-24894"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/symfony/symfony/commit/d2f6322af9444ac5cd1ef3ac6f280dbef7f9d1fb"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/http-kernel/CVE-2022-24894.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/symfony/CVE-2022-24894.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-24894"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-285" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-02-01T18:48:09Z",
    "nvd_published_at" : "2023-02-03T22:15:00Z"
  }
}