Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS00M2NwLTZwM3EtMnBjNM4AA2Px

HtmlSanitizer vulnerable to Cross-site Scripting in Foreign Content

Impact

The vulnerability occurs in configurations where foreign content is allowed, i.e. either svg or math are in the list of allowed elements.
Specifically, the requirements for the vulnerability are:

  1. Allowing one foreign element: svg, or math
  2. Comments or one raw text element: iframe, noembed, xmp, title, noframes, style or noscript

Configurations that meet the above requirements plus the following are vulnerable to an additional vulnerability:

In case an application sanitizes user input with a vulnerable configuration, an attacker could
bypass the sanitization and inject arbitrary HTML, including JavaScript code.

Note that in the default configuration the vulnerability is not present.

Patches

The vulnerability has been fixed in versions 8.0.723 and 8.1.722-beta (preview version).

Workarounds

Disallow foreign elements svg and math. This is the case in the default configuration, which is therefore not affected by the vulnerability.

Permalink: https://github.com/advisories/GHSA-43cp-6p3q-2pc4
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS00M2NwLTZwM3EtMnBjNM4AA2Px
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Moderate
Classification: General
Published: 7 months ago
Updated: 6 months ago


CVSS Score: 6.1
CVSS vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

Identifiers: GHSA-43cp-6p3q-2pc4, CVE-2023-44390
References: Repository: https://github.com/mganss/HtmlSanitizer
Blast Radius: 1.0

Affected Packages

nuget:HtmlSanitizer
Dependent packages: 0
Dependent repositories: 0
Downloads: 39,285,511 total
Affected Version Ranges: >= 8.1.0-beta, < 8.1.722-beta, < 8.0.723
Fixed in: 8.1.722-beta, 8.0.723
All affected versions: 3.1.76, 3.1.79, 3.1.91, 3.1.93, 3.1.98, 3.2.103, 3.2.105, 3.3.142, 3.4.156, 4.0.179, 4.0.180, 4.0.181, 4.0.182, 4.0.183, 4.0.185, 4.0.187, 4.0.197, 4.0.199, 4.0.201, 4.0.204, 4.0.205, 4.0.207, 4.0.210, 4.0.217, 5.0.298, 5.0.304, 5.0.310, 5.0.319, 5.0.331, 5.0.342, 5.0.343, 5.0.353, 5.0.355, 5.0.372, 5.0.376, 5.0.404, 6.0.437, 6.0.441, 6.0.453, 7.0.473, 7.1.475, 7.1.488, 7.1.509, 7.1.512, 7.1.542, 8.0.601, 8.0.645, 8.0.692, 8.0.718
All unaffected versions: 8.0.723, 8.0.744, 8.0.746, 8.0.795, 8.0.811, 8.0.838, 8.0.843, 8.0.865