CVE-2026-126604 PUBLISHED

Incorrect Behavior Order: Validate Before Canonicalize in sanitize-filename

Assigner: GitLab
Reserved: 11.11.2026 Published: 03.12.2026 Updated: 03.12.2026

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")

Metrics

CVSS Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N
CVSS Score: 7.4

Product Status

Vendor J++ / Newsworthy
Product sanitize-filename
Versions Default: unaffected
  • affected from 0 to 1.2.1 (excl.)

Solutions

Upgrade to sanitize-filename 1.2.1 or later.

Credits

  • Alex Brumen (@brumens2) finder

References

Problem Types

  • CWE-180: Incorrect Behavior Order: Validate Before Canonicalize CWE