CVE-2026-126604

Incorrect Behavior Order: Validate Before Canonicalize in sanitize-filename

Published Dec 3, 2026 CVSS 3.1 · 7.4 High EPSS n/a KEV · Not listed
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")`

Remediation

Vendor Solution

Upgrade to sanitize-filename 1.2.1 or later.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
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")`
Title Incorrect Behavior Order: Validate Before Canonicalize in sanitize-filename
Weaknesses CWE-180
References
Metrics cvssV3_1

{'score': 7.4, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N'}

Subscriptions

No data.

Weaknesses

Sources

Status
PUBLISHED
Assigner
GitLab
Published
Updated
Dec 3, 2026, 11:33 PM
Reserved
Nov 11, 2026, 8:24 AM

No data.