slug is vulnerable to Cross-Site Scripting (XSS)
59
Medium Risk
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.
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.
slug is vulnerable to Cross-Site Scripting (XSS) in versions 4.0.4 - 12.0.0.
Upgrade the slug library to the patch version.
Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.
Free. No credit card required.

I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant