Advisory

GHSA-cf4q-4cqr-7g7w

Also known as: None

Summary

SVG with embedded scripts can lead to cross-site scripting attacks in xml2rfc

Details

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.

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:

Severity

Medium Basis: The source's own band: MODERATE

Dates

Published
2022-04-22 20:25 UTC
Modified
2024-12-05 05:42 UTC

Affected packages and fixes

xml2rfc

PyPI · All systems

Affected

  • introduced 0, fixed 3.12.4 (ecosystem)

Fixed versions

3.12.4

Fix

  • Fixed version 3.12.4
    pip install --upgrade xml2rfc==3.12.4

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences