Incorrect Behavior Order: Validate Before Canonicalize in sanitize-filename
- CVE-2026-126604
- GHSA-6v59-65x2-cq7r
- EUVD-2026-143764
Summary
The sanitize-filename Python package, versions below 1.2.1, removes blacklisted characters before applying Unicode NFKD normalization, which is the wrong order. Fullwidth solidus (U+FF0F), fullwidth reverse solidus (U+FF3C) and small reverse solidus (U+FE68) pass the blacklist and are turned into ordinary path separators by normalization. An attacker who controls the input filename can therefore make sanitize() return a path traversal sequence or an absolute path. The record gives a sample input built from these characters and ending in etc/passwd. The CVSS score is 7.4, and the record states the issue is not in the CISA known exploited list. Upgrading to 1.2.1 or later addresses it.
AI summary · verify against the vendor advisory
Description
sanitize-filename (PyPI) < 1.2.1 is vulnerable to path traversal attacks. sanitize() removed blacklisted characters before applying Unicode NFKD normalization. Characters such as FULLWIDTH SOLIDUS (U+FF0F), FULLWIDTH REVERSE SOLIDUS (U+FF3C) and SMALL REVERSE SOLIDUS (U+FE68) passed the blacklist and became real path separators in the returned value. An attacker who controls the input filename could make sanitize() return an absolute path. Example, `sanitize("\uFF0F..\uFF0F..\uFF0F..\uFF0Fetc\uFF0Fpasswd")`
Text from the CVE.org record.
Recommendation
J++ / Newsworthy sanitize-filename
- If you run a version before 1.2.1update to 1.2.1 or later
Taken from the version ranges of the CVE.org record. Check the vendor advisory: nothing is said about versions the ranges do not list. Breaking-change risk is read from the version numbers only.
Affected
J++ / Newsworthy sanitize-filename
Affected versions Fixed in before 1.2.1 1.2.1
Product versions from the CVE.org record.
Timeline
- Published
Related news
No article from the followed outlets names this vulnerability.