CVE-2023-46734: Symfony/twig bridge Cross-Site Scripting Vulnerability
MODERATECVE-2023-46734 is a MODERATE (CVSS 6.1) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Symfony/twig bridge libraries in the Packagist ecosystem. The issue involves symfony potential cross-site scripting vulnerabilities in codeextension filters. Remediation is available by upgrading affected packages to version 4.4.51, 5.4.31, 6.3.8.
CVE-2023-46734 at a Glance
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).
How to Fix CVE-2023-46734
To remediate this vulnerability, upgrade all affected Symfony/twig bridge dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade symfony/twig-bridge to 4.4.51
Upgrade symfony/twig-bridge to 5.4.31
Upgrade symfony/twig-bridge to 6.3.8
Upgrade symfony/symfony to 4.4.51
Upgrade symfony/symfony to 5.4.31
Upgrade symfony/symfony to 6.3.8
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for symfony/twig-bridge
How to Check if You Are Affected
To determine whether your application is affected by CVE-2023-46734, inspect your project dependencies for Symfony/twig bridge:
inspect dependencies for symfony/twig-bridge
Analyze the terminal output to locate any version of Symfony/twig bridge in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.4.51), 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-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Symfony/twig bridge, 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
CVE-2023-46734 Affected Symfony/twig bridge Versions
6 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
symfony/twig-bridge
|
Packagist |
≥ 2.0.0
< 4.4.51
|
4.4.51
|
|
symfony/twig-bridge
|
Packagist |
≥ 5.0.0
< 5.4.31
|
5.4.31
|
|
symfony/twig-bridge
|
Packagist |
≥ 6.0.0
< 6.3.8
|
6.3.8
|
|
symfony/symfony
|
Packagist |
≥ 2.0.0
< 4.4.51
|
4.4.51
|
|
symfony/symfony
|
Packagist |
≥ 5.0.0
< 5.4.31
|
5.4.31
|
|
symfony/symfony
|
Packagist |
≥ 6.0.0
< 6.3.8
|
6.3.8
|
References
Frequently Asked Questions
What is CVE-2023-46734?
Which Symfony/twig bridge versions are affected?
What version fixes CVE-2023-46734?
Is symfony/twig-bridge affected?
Is symfony/symfony affected?
What is the CVSS score of CVE-2023-46734?
What CWE is associated with CVE-2023-46734?
How can I check Packagist dependencies for CVE-2023-46734?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-q847-2q57-wmr3",
"modified" : "2023-11-12T15:52:51Z",
"published" : "2023-11-12T15:52:51Z",
"aliases" : [ "CVE-2023-46734" ],
"summary" : "Symfony potential Cross-site Scripting vulnerabilities in CodeExtension filters",
"details" : "### Description\n\nSome Twig filters in CodeExtension use \"is_safe=html\" but don't actually ensure their input is safe.\n\n### Resolution\n\nSymfony now escapes the output of the affected filters.\n\nThe patch for this issue is available [here](https://github.com/symfony/symfony/commit/9da9a145ce57e4585031ad4bee37c497353eec7c) for branch 4.4.\n\n### Credits\n\nWe would like to thank Pierre Rudloff for reporting the issue and to Nicolas Grekas for providing the fix.",
"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" : "symfony/twig-bridge"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.0.0"
}, {
"fixed" : "4.4.51"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "symfony/twig-bridge"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "5.0.0"
}, {
"fixed" : "5.4.31"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "symfony/twig-bridge"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "6.0.0"
}, {
"fixed" : "6.3.8"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "symfony/symfony"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.0.0"
}, {
"fixed" : "4.4.51"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "symfony/symfony"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "5.0.0"
}, {
"fixed" : "5.4.31"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "symfony/symfony"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "6.0.0"
}, {
"fixed" : "6.3.8"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/symfony/symfony/security/advisories/GHSA-q847-2q57-wmr3"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-46734"
}, {
"type" : "WEB",
"url" : "https://github.com/symfony/symfony/commit/5d095d5feb1322b16450284a04d6bb48d1198f54"
}, {
"type" : "WEB",
"url" : "https://github.com/symfony/symfony/commit/9da9a145ce57e4585031ad4bee37c497353eec7c"
}, {
"type" : "WEB",
"url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/symfony/CVE-2023-46734.yaml"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/symfony/symfony"
}, {
"type" : "WEB",
"url" : "https://lists.debian.org/debian-lts-announce/2023/11/msg00019.html"
}, {
"type" : "WEB",
"url" : "https://symfony.com/cve-2023-46734"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2023-11-12T15:52:51Z",
"nvd_published_at" : "2023-11-10T18:15:09Z"
}
}