Skip to content

svg-sanitizer has Cross-site Scripting Bypass

Moderate severity GitHub Reviewed Published Mar 20, 2023 in darylldoyle/svg-sanitizer • Updated Mar 23, 2023
Withdrawn This advisory was withdrawn on Mar 23, 2023

Package

composer enshrined/svg-sanitize (Composer)

Affected versions

< 0.16.0

Patched versions

0.16.0

Description

Update

In #88 we have determined that the bypass this security advisory was created for, was a false positive and as such we have requested that the CVE be rejected.


A bypass has been found that allows an attacker to upload an SVG with persistent XSS.

HTML elements within CDATA needed to be sanitized correctly, as we were converting them to a textnode and therefore, the library wasn't seeing them as DOM elements.

Any data within a CDATA node will now be sanitised using HTMLPurifier. We've also removed many of the HTML and MathML elements from the allowed element list, as without ForiegnObject, they're not legal within the SVG context.

Additional tests have been added to the test suite to account for these new bypasses.

Impact

This impacts all users of the svg-sanitizer library.

Patches

This issue is fixed in 0.16.0 and higher.

Workarounds

There is currently no workaround available without upgrading.

For more information

If you have any questions or comments about this advisory:

Open an issue in Github
Email us at [email protected]

References

@darylldoyle darylldoyle published to darylldoyle/svg-sanitizer Mar 20, 2023
Published by the National Vulnerability Database Mar 20, 2023
Published to the GitHub Advisory Database Mar 20, 2023
Reviewed Mar 20, 2023
Withdrawn Mar 23, 2023
Last updated Mar 23, 2023

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
None
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N

Weaknesses

CVE ID

CVE-2023-28426

GHSA ID

GHSA-xrqq-wqh4-5hg2

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.