GHSA-cf4q-4cqr-7g7w: Xml2rfc Cross-Site Scripting Vulnerability

MODERATE
CWE-79
Published
Advisory Summary

GHSA-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

CVE Identifier N/A
GHSA Identifier GHSA-cf4q-4cqr-7g7w
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Xml2rfc
Package Ecosystem PyPI
Published Date
Last Updated

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.

xml2rfc fixed: 3.12.4
pip install xml2rfc>=3.12.4
Verify Direct and Transitive Dependencies

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

xml2rfc allows `script` elements in SVG sources. In HTML output having these script elements can lead to XSS attacks. Sample XML snippet: ``` <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"> </artwork> ``` ### Impact This vulnerability impacts website that publish HTML drafts and RFCs. ### Patches This has been fixed in version [3.12.4](https://github.com/ietf-tools/xml2rfc/releases/tag/v3.12.4). ### Workarounds If SVG source is self-contained within the XML, scraping `script` elements from SVG files. ### References * https://developer.mozilla.org/en-US/docs/Web/SVG/Element/script ### For more information If you have any questions or comments about this advisory: * Open an issue in [xml2rfc](https://github.com/ietf-tools/xml2rfc/) * Email us at [operational-vulnerability@ietf.org](mailto:operational-vulnerability@ietf.org) * [Infrastructure and Services Vulnerability Disclosure](https://www.ietf.org/about/administration/policies-procedures/vulnerability-disclosure/)

GHSA-cf4q-4cqr-7g7w Affected Xml2rfc Versions

1 component(s)
Fixed Versions:
3.12.4
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?
GHSA-cf4q-4cqr-7g7w is a security vulnerability in Xml2rfc involving SVG with embedded scripts can lead to cross-site scripting attacks in xml2rfc under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Xml2rfc versions are affected?
Affected versions include releases prior to 3.12.4 across affected packages: xml2rfc.
What version fixes GHSA-cf4q-4cqr-7g7w?
Upgrading to 3.12.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is xml2rfc affected?
Yes, xml2rfc is affected in releases prior to 3.12.4. Upgrade your dependency to 3.12.4 or later.
What CWE is associated with GHSA-cf4q-4cqr-7g7w?
GHSA-cf4q-4cqr-7g7w is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (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.).
How can I check PyPI dependencies for GHSA-cf4q-4cqr-7g7w?
Run the dependency tree command: 'pip show xml2rfc'. 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-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
  }
}