CVE-2021-32696
JSON

3.7low

Passing in a non-string 'html' argument can lead to unsanitized output

Severity
3.7low CVSS:3.1 by GitHub_M
Exploit likelihood
1.08% (higher than 66% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-qxg5-2qff-p49r

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

Product or packageVersionsReported by
ericnorris striptags< 3.2.0CVE List
striptags (npm)before 3.2.0GitHub Advisory Database
striptags_project striptagsbefore 3.2.0NVD

All scores

GitHub_M3.7low CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N
GitHub3.7medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N
NVD5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
NVD5.0medium CVSS:2.0AV:N/AC:L/Au:N/C:N/I:P/A:N

Classification

What each source says

CVE List

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.

GitHub Advisory Database

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.

Impact

XSS

Patches

3.2.0

Workarounds

Ensure that the html parameter is a string before calling the function.

NVD (es)

El paquete npm "striptags" es una implementación de strip_tags de PHP en Typescript. En striptags versiones anteriores a 3.2.0, una vulnerabilidad de confusión de tipos puede causar que "striptags" concatene cadenas no saneadas cuando es pasado un objeto tipo array como el parámetro "html". Esto puede ser abusado por un atacante que pueda controlar la forma de su entrada, por ejemplo, si los parámetros query son pasados directamente a la función. Esto puede conllevar una vulnerabilidad de tipo XSS

References

Sources

SourceRecordLicence
CVE ListCVE-2021-32696 changed 2024-08-03CVE Terms of Use
GitHub Advisory DatabaseGHSA-qxg5-2qff-p49r changed 2026-07-08CC-BY-4.0
NVDCVE-2021-32696 changed 2026-06-17Public domain