Passing in a non-string 'html' argument can lead to unsanitized output
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.
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| npm package | striptags | < 3.2.0 | 3.2.0 |
References
- https://github.com/ericnorris/striptags/security/advisories/GHSA-qxg5-2qff-p49r
- https://nvd.nist.gov/vuln/detail/CVE-2021-32696
- https://github.com/ericnorris/striptags/commit/f252a6b0819499cd65403707ebaf5cc925f2faca
- https://github.com/ericnorris/striptags/releases/tag/v3.2.0
- https://www.npmjs.com/package/striptags
- CVSS vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N- Weakness (CWE)
CWE-241, CWE-79, CWE-843- Platform
- npm
- Package
striptags- Disclosed
- 18.06.2021
- Updated
- 11.10.2026 10:22
Sources and licenses
OSV / GitHub Advisory Database - GHSA-qxg5-2qff-p49r - CC BY 4.0
Vulnerability history: striptags
All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.
This is the only known vulnerability of this package.
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.