CVE-2022-23601: Symfony/framework bundle CSRF Token Missing Vulnerability

HIGH
Advisory Identifier: GHSA-vvmr-8829-6whx
CVSS 8.1
CWE-352
Published
Advisory Summary

CVE-2022-23601 is a HIGH (CVSS 8.1) csrf token missing vulnerability (CWE-352: Cross-Site Request Forgery (CSRF)) affecting Symfony/framework bundle libraries in the Packagist ecosystem. The issue involves csrf token missing in symfony. Remediation is available by upgrading affected packages to version 5.3.15, 5.4.4, 6.0.4.

CVE-2022-23601 at a Glance

CVE Identifier CVE-2022-23601
GHSA Identifier GHSA-vvmr-8829-6whx
Severity HIGH
CVSS v3.1 Base Score 8.1
CWE Classification CWE-352: Cross-Site Request Forgery (CSRF)
Affected Product Symfony/framework bundle
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 8.1

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:H/I:H/A:N).

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 High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2022-23601

To remediate this vulnerability, upgrade all affected Symfony/framework 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/framework-bundle fixed: 5.3.15
Upgrade symfony/framework-bundle to 5.3.15
symfony/framework-bundle fixed: 5.4.4
Upgrade symfony/framework-bundle to 5.4.4
symfony/framework-bundle fixed: 6.0.4
Upgrade symfony/framework-bundle to 6.0.4
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/framework-bundle

How to Check if You Are Affected

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

inspect dependencies for symfony/framework-bundle

Analyze the terminal output to locate any version of Symfony/framework 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.15), 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-352: Cross-Site Request Forgery (CSRF), where the web application does not, or cannot, sufficiently verify whether a request was intentionally provided by the user who sent the request, which could have originated from an unauthorized actor. In Symfony/framework 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 ----------- The Symfony form component provides a CSRF protection mechanism by using a random token injected in the form and using the session to store and control the token submitted by the user. When using the FrameworkBundle, this protection can be enabled or disabled with the configuration. If the configuration is not specified, by default, the mechanism is enabled as long as the session is enabled. In a recent change in the way the configuration is loaded, the default behavior has been dropped and, as a result, the CSRF protection is not enabled in form when not explicitly enabled, which makes the application sensible to CSRF attacks. Resolution ---------- Symfony restored the default configuration to enable the CSRF protection by default. The patch for this issue is available [here](https://github.com/symfony/symfony/commit/f0ffb775febdf07e57117aabadac96fa37857f50) for branch 5.3. Credits ------- We would like to thank Catalin Dan and David Lochner for reporting the issue and Jérémy Derussé for fixing the issue.

CVE-2022-23601 Affected Symfony/framework bundle Versions

3 component(s)
Fixed Versions:
5.3.155.4.46.0.4
Product / Package Ecosystem Affected Versions Fixed Version
symfony/framework-bundle
Packagist
≥ 5.3.14
< 5.3.15
All 1 versions
5.3.14
5.3.15
symfony/framework-bundle
Packagist
≥ 5.4.3
< 5.4.4
All 1 versions
5.4.3
5.4.4
symfony/framework-bundle
Packagist
≥ 6.0.3
< 6.0.4
All 1 versions
6.0.3
6.0.4

References

Frequently Asked Questions

What is CVE-2022-23601?
CVE-2022-23601 is a security vulnerability in Symfony/framework bundle involving CSRF token missing in Symfony under CWE-352: Cross-Site Request Forgery (CSRF).
Which Symfony/framework bundle versions are affected?
Affected versions include releases prior to 5.3.15, 5.4.4, 6.0.4 across affected packages: symfony/framework-bundle.
What version fixes CVE-2022-23601?
Upgrading to 5.3.15, 5.4.4, 6.0.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is symfony/framework-bundle affected?
Yes, symfony/framework-bundle is affected in releases prior to 5.3.15, 5.4.4, 6.0.4. Upgrade your dependency to 5.3.15, 5.4.4, 6.0.4 or later.
What is the CVSS score of CVE-2022-23601?
CVE-2022-23601 has a CVSS v3.1 base score of 8.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2022-23601?
CVE-2022-23601 is classified under CWE-352: Cross-Site Request Forgery (CSRF) (The web application does not, or cannot, sufficiently verify whether a request was intentionally provided by the user who sent the request, which could have originated from an unauthorized actor.).
How can I check Packagist dependencies for CVE-2022-23601?
Run the dependency tree command: 'inspect dependencies for symfony/framework-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-vvmr-8829-6whx",
  "modified" : "2024-04-22T18:35:37Z",
  "published" : "2022-02-01T00:46:57Z",
  "aliases" : [ "CVE-2022-23601" ],
  "summary" : "CSRF token missing in Symfony",
  "details" : "Description\n-----------\n\nThe Symfony form component provides a CSRF protection mechanism by using a random token injected in the form and using the session to store and control the token submitted by the user.\nWhen using the FrameworkBundle, this protection can be enabled or disabled with the configuration. If the configuration is not specified, by default, the mechanism is enabled as long as the session is enabled.\n\nIn a recent change in the way the configuration is loaded, the default behavior has been dropped and, as a result, the CSRF protection is not enabled in form when not explicitly enabled, which makes the application sensible to CSRF attacks.\n\nResolution\n----------\n\nSymfony restored the default configuration to enable the CSRF protection by default.\n\nThe patch for this issue is available [here](https://github.com/symfony/symfony/commit/f0ffb775febdf07e57117aabadac96fa37857f50) for branch 5.3.\n\nCredits\n-------\n\nWe would like to thank Catalin Dan and David Lochner for reporting the issue and Jérémy Derussé for fixing the issue.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/framework-bundle"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.3.14"
      }, {
        "fixed" : "5.3.15"
      } ]
    } ],
    "versions" : [ "5.3.14" ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/framework-bundle"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.4.3"
      }, {
        "fixed" : "5.4.4"
      } ]
    } ],
    "versions" : [ "5.4.3" ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/framework-bundle"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.0.3"
      }, {
        "fixed" : "6.0.4"
      } ]
    } ],
    "versions" : [ "6.0.3" ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/symfony/symfony/security/advisories/GHSA-vvmr-8829-6whx"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-23601"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/symfony/symfony/commit/f0ffb775febdf07e57117aabadac96fa37857f50"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/framework-bundle/CVE-2022-23601.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/symfony/CVE-2022-23601.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/symfony/symfony"
  }, {
    "type" : "WEB",
    "url" : "https://symfony.com/cve-2022-23601"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-352" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-01-31T22:03:31Z",
    "nvd_published_at" : "2022-02-01T13:15:00Z"
  }
}