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 package | Versions | Reported by |
|---|---|---|
| ericnorris striptags | < 3.2.0 | CVE List |
| striptags (npm) | before 3.2.0 | GitHub Advisory Database |
| striptags_project striptags | before 3.2.0 | NVD |
All scores
| GitHub_M | 3.7low CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N |
| GitHub | 3.7medium CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N |
| NVD | 5.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N |
| NVD | 5.0medium CVSS:2.0 | AV: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
| https://github.com/ericnorris/striptags/security/advisories/GHSA-qxg5-2qff-p49r | third-party-advisory, web | |
| https://github.com/ericnorris/striptags/commit/f252a6b0819499cd65403707ebaf5cc925f2faca | patch, third-party-advisory, web | |
| https://github.com/ericnorris/striptags/releases/tag/v3.2.0 | third-party-advisory, web | |
| https://www.npmjs.com/package/striptags | product, third-party-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2021-32696 | advisory | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-32696 changed 2024-08-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-qxg5-2qff-p49r changed 2026-07-08 | CC-BY-4.0 |
| NVD | CVE-2021-32696 changed 2026-06-17 | Public domain |