Intel

AIKIDO-2026-730615

slug is vulnerable to Cross-Site Scripting (XSS)

Cross-Site Scripting (XSS) Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published 2 days ago

59

Medium Risk

This Affects:

JSslug
4.0.4 - 12.0.0
Fixed in 12.0.1
Are you affected? Scan for Free

TL;DR

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.

Who does this affect?

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.

Background info

slug is vulnerable to Cross-Site Scripting (XSS) in versions 4.0.4 - 12.0.0.

How to fix this

Upgrade the slug library to the patch version.