slug is vulnerable to Cross-Site Scripting (XSS)
59
CVE Score
Medium
Cross-Site Scripting (XSS)
The slugify function skips its disallowed-character sanitizer when the replacement option is set to an empty string. Because String.prototype.includes('') always returns true, every character takes the replacement-preserving branch and the final character-stripping filter never runs. As a result, characters such as < > " ' ( ) / and .. pass through unchanged instead of being removed, so output can carry markup or path-traversal sequences that the module normally strips. The fix guards that branch so an empty replacement falls through to the character filter.
Upgrade the slug library to the patch version.
You are affected if you are using a version that falls within the vulnerable range and you call slug with the replacement option set to an empty string.
4.0.4 - 12.0.0
Fixed in 12.0.1slug is vulnerable to Cross-Site Scripting (XSS) in versions 4.0.4 - 12.0.0.
Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.
No credit card required | Scan results in 32 seconds.
I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant
ISO 42001Compliant© All Intel data is openly available and commercially licensed.