cve.bz

CVE-2026-126604 Incorrect Behavior Order: Validate Before Canonicalize in sanitize-filename

7.4 high

High (7.4) in j++ / newsworthy sanitize-filename.

On this page
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")`

Severity

CVSS 3.1

7.4 high
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N
CWE
CWE-180 Incorrect Behavior Order: Validate Before Canonicalize
Published
Assigned by
GitLab (CNA)
NVD analysis
Not in the NVD yet
Record from
the CVE List, synced

Ask an AI about this CVE

Show the promptExplain CVE-2026-126604 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2026-126604?via=ask-ai-copy and https://cve.bz/cve/CVE-2026-126604?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2026-126604 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the CNA's record in the CVE List.

ProductAffected
J++ / Newsworthy sanitize-filenamebefore 1.2.1

Attack patterns (CAPEC)

  • CAPEC-3 Using Leading 'Ghost' Character Sequences to Bypass Input Filters Likelihood: Medium · Severity: Medium
  • CAPEC-71 Using Unicode Encoding to Bypass Validation Logic Likelihood: Medium · Severity: High
  • CAPEC-78 Using Escaped Slashes in Alternate Encoding Likelihood: High · Severity: High
  • CAPEC-79 Using Slashes in Alternate Encoding Likelihood: High · Severity: High
  • CAPEC-80 Using UTF-8 Encoding to Bypass Validation Logic Likelihood: High · Severity: High
  • CAPEC-267 Leverage Alternate Encoding Likelihood: High · Severity: High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON