GHSA-xrqq-wqh4-5hg2

Suggest an improvement
Source
https://github.com/advisories/GHSA-xrqq-wqh4-5hg2
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2023/03/GHSA-xrqq-wqh4-5hg2/GHSA-xrqq-wqh4-5hg2.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-xrqq-wqh4-5hg2
Aliases
  • CVE-2023-28426
Withdrawn
2023-03-23T12:50:28Z
Published
2023-03-20T20:44:30Z
Modified
2026-09-10T03:49:53Z
Severity
  • 5.3 (Medium) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N CVSS Calculator
Summary
svg-sanitizer has Cross-site Scripting Bypass
Details

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 daryll@enshrined.co.uk

Database specific
{
    "cwe_ids":  [
        "CWE-79"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2023-03-20T20:44:30Z",
    "nvd_published_at":  "2023-03-20T14:15:00Z",
    "severity":  "MODERATE"
}
References

Affected packages

Packagist / enshrined/svg-sanitize

Package

Name
enshrined/svg-sanitize
Purl
pkg:composer/enshrined/svg-sanitize

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
0.16.0

Affected versions

0.*
0.1.0
0.1.1
0.1.2
0.1.3
0.1.4
0.1.5
0.1.6
0.2.0
0.2.1
0.3.0
0.4.0
0.4.1
0.5.0
0.5.1
0.5.2
0.5.3
0.5.3.1
0.6.0
0.7.0
0.7.1
0.7.2
0.8.0
0.8.1
0.8.2
0.9.0
0.9.1
0.9.2
0.10.0
0.11.0
0.12.0
0.13.0
0.13.1
0.13.2
0.13.3
0.14.0
0.14.1
0.15.0
0.15.1
0.15.2
0.15.3
0.15.4

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2023/03/GHSA-xrqq-wqh4-5hg2/GHSA-xrqq-wqh4-5hg2.json"