GHSA-cf4q-4cqr-7g7w: Xml2rfc Cross-Site Scripting Vulnerability
MODERATEGHSA-cf4q-4cqr-7g7w is a MODERATE cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Xml2rfc libraries in the PyPI ecosystem. The issue involves svg with embedded scripts can lead to cross-site scripting attacks in xml2rfc. Remediation is available by upgrading affected packages to version 3.12.4.
GHSA-cf4q-4cqr-7g7w at a Glance
How to Fix GHSA-cf4q-4cqr-7g7w
To remediate this vulnerability, upgrade all affected Xml2rfc dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install xml2rfc>=3.12.4
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show xml2rfc
How to Check if You Are Affected
To determine whether your Python environment is affected by GHSA-cf4q-4cqr-7g7w, inspect your installed packages using pip:
pip show xml2rfc
Analyze the terminal output to locate any version of Xml2rfc in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.12.4), your application is affected.
Note: The pip show xml2rfc command checks currently installed packages in your active Python environment.
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 Xml2rfc, 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
GHSA-cf4q-4cqr-7g7w Affected Xml2rfc Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
xml2rfc
|
PyPI |
< 3.12.4
|
3.12.4
|
References
Frequently Asked Questions
What is GHSA-cf4q-4cqr-7g7w?
Which Xml2rfc versions are affected?
What version fixes GHSA-cf4q-4cqr-7g7w?
Is xml2rfc affected?
What CWE is associated with GHSA-cf4q-4cqr-7g7w?
How can I check PyPI dependencies for GHSA-cf4q-4cqr-7g7w?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-cf4q-4cqr-7g7w",
"modified" : "2022-04-22T20:25:53Z",
"published" : "2022-04-22T20:25:53Z",
"aliases" : [ ],
"summary" : "SVG with embedded scripts can lead to cross-site scripting attacks in xml2rfc",
"details" : "xml2rfc allows `script` elements in SVG sources.\nIn HTML output having these script elements can lead to XSS attacks.\n\nSample XML snippet:\n```\n<artwork type=\"svg\" src=\"data:image/svg+xml,%3Csvg viewBox='0 0 10 10' xmlns='http://www.w3.org/2000/svg'%3E%3Cscript%3E window.alert('Test Alert'); %3C/script%3E%3C/svg%3E\">\n</artwork>\n```\n\n### Impact\nThis vulnerability impacts website that publish HTML drafts and RFCs.\n\n### Patches\nThis has been fixed in version [3.12.4](https://github.com/ietf-tools/xml2rfc/releases/tag/v3.12.4).\n\n### Workarounds\nIf SVG source is self-contained within the XML, scraping `script` elements from SVG files.\n\n### References\n* https://developer.mozilla.org/en-US/docs/Web/SVG/Element/script\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [xml2rfc](https://github.com/ietf-tools/xml2rfc/)\n* Email us at [operational-vulnerability@ietf.org](mailto:operational-vulnerability@ietf.org)\n* [Infrastructure and Services Vulnerability Disclosure](https://www.ietf.org/about/administration/policies-procedures/vulnerability-disclosure/)\n",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "xml2rfc"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.12.4"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/ietf-tools/xml2rfc/security/advisories/GHSA-cf4q-4cqr-7g7w"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/ietf-tools/xml2rfc"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2022-04-22T20:25:53Z",
"nvd_published_at" : null
}
}