CVE-2024-37156: Sulu/form bundle TokenController FormName Not Sanitized Vulnerability

MODERATE
Advisory Identifier: GHSA-rrvc-c7xg-7cf3
CVSS 6.1
CWE-80 CWE-79
Published
Advisory Summary

CVE-2024-37156 is a MODERATE (CVSS 6.1) tokencontroller formname not sanitized vulnerability (CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS)) affecting Sulu/form bundle libraries in the Packagist ecosystem. The issue involves tokencontroller formname not sanitized in hidden input. Remediation is available by upgrading affected packages to version 2.5.3.

CVE-2024-37156 at a Glance

CVE Identifier CVE-2024-37156
GHSA Identifier GHSA-rrvc-c7xg-7cf3
Severity MODERATE
CVSS v3.1 Base Score 6.1
CWE Classification CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS)
Affected Product Sulu/form bundle
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 6.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:C/C:L/I:L/A:N).

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

How to Fix CVE-2024-37156

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

sulu/form-bundle fixed: 2.5.3
Upgrade sulu/form-bundle to 2.5.3
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 sulu/form-bundle

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-37156, inspect your project dependencies for Sulu/form bundle:

inspect dependencies for sulu/form-bundle

Analyze the terminal output to locate any version of Sulu/form bundle in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.5.3), 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-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS), where the product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special characters such as "<", ">", and "&" that could be interpreted as web-scripting elements when they are sent to a downstream component that processes web pages. In Sulu/form 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

### Impact TokenController get parameter formName not sanitized in returned input field leads to XSS. _What kind of vulnerability is it? Who is impacted?_ ### Patches _Has the problem been patched? What versions should users upgrade to?_ ### Workarounds _Is there a way for users to fix or remediate the vulnerability without upgrading?_ Create a custom Symfony Request listener which checks for the get value of `form` for the TokenController and if not valid stop the request dispatching and return a error status code. ### References _Are there any links users can visit to find out more?_

CVE-2024-37156 Affected Sulu/form bundle Versions

1 component(s)
Fixed Versions:
2.5.3
Product / Package Ecosystem Affected Versions Fixed Version
sulu/form-bundle
Packagist
≥ 2.0.0
< 2.5.3
2.5.3

References

Frequently Asked Questions

What is CVE-2024-37156?
CVE-2024-37156 is a security vulnerability in Sulu/form bundle involving TokenController formName not sanitized in hidden input under CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS).
Which Sulu/form bundle versions are affected?
Affected versions include releases prior to 2.5.3 across affected packages: sulu/form-bundle.
What version fixes CVE-2024-37156?
Upgrading to 2.5.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is sulu/form-bundle affected?
Yes, sulu/form-bundle is affected in releases prior to 2.5.3. Upgrade your dependency to 2.5.3 or later.
What is the CVSS score of CVE-2024-37156?
CVE-2024-37156 has a CVSS v3.1 base score of 6.1 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2024-37156?
CVE-2024-37156 is classified under CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS) (The product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special characters such as "<", ">", and "&" that could be interpreted as web-scripting elements when they are sent to a downstream component that processes web pages.).
How can I check Packagist dependencies for CVE-2024-37156?
Run the dependency tree command: 'inspect dependencies for sulu/form-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-rrvc-c7xg-7cf3",
  "modified" : "2024-06-06T21:36:40Z",
  "published" : "2024-06-06T21:36:40Z",
  "aliases" : [ "CVE-2024-37156" ],
  "summary" : "TokenController formName not sanitized in hidden input",
  "details" : "### Impact\n\nTokenController get parameter formName not sanitized in returned input field leads to XSS.\n\n_What kind of vulnerability is it? Who is impacted?_\n\n### Patches\n\n_Has the problem been patched? What versions should users upgrade to?_\n\n### Workarounds\n\n_Is there a way for users to fix or remediate the vulnerability without upgrading?_\n\nCreate a custom Symfony Request listener which checks for the get value of `form` for the TokenController and if not valid stop the request dispatching and return a error status code.\n\n### References\n\n_Are there any links users can visit to find out more?_\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "sulu/form-bundle"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.5.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/sulu/SuluFormBundle/security/advisories/GHSA-rrvc-c7xg-7cf3"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-37156"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sulu/SuluFormBundle/commit/3f341b71a7309cbc8fd2c5bff894c654d1679b17"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/sulu/SuluFormBundle"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79", "CWE-80" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-06-06T21:36:40Z",
    "nvd_published_at" : "2024-06-06T16:15:13Z"
  }
}