Vulnerability · Published Jun 18, 2021 · Assigned by GitHub_M
CVE-2021-32696Passing in a non-string 'html' argument can lead to unsanitized output
Low 3.7
In plain English
A low-severity cross-site scripting in striptags from ericnorris. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 1.1% (higher than 65% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
The npm package "striptags" is an implementation of PHP's strip_tags in Typescript. In striptags before version 3.2.0, a type-confusion vulnerability can cause `striptags` to concatenate unsanitized strings when an array-like object is passed in as the `html` parameter. This can be abused by an attacker who can control the shape of their input, e.g. if query parameters are passed directly into the function. This can lead to a XSS.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| npm | striptags | 3.2.0 | GHSA-qxg5-2qff-p49r |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| ericnorris | striptags | < 3.2.0 |
Weakness: CWE-241, CWE-79 · Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N
References
- https://github.com/ericnorris/striptags/security/advisories/GHSA-qxg5-2qff-p49r x_refsource_CONFIRM
- https://github.com/ericnorris/striptags/commit/f252a6b0819499cd65403707ebaf5cc925f2faca x_refsource_MISC
- https://github.com/ericnorris/striptags/releases/tag/v3.2.0 x_refsource_MISC
- https://www.npmjs.com/package/striptags x_refsource_MISC