{"id":"CVE-2026-27199","published":"2026-02-21T05:15:53Z","modified":"2026-02-24T19:02:19Z","title":"Werkzeug safe_join() allows Windows special device names","vendor":"pallets","product":"werkzeug","tier":"tail","description":{"text":"Werkzeug is a comprehensive WSGI web application library. Versions 3.1.5 and below, the safe_join function allows Windows device names as filenames if preceded by other path segments. This was previously reported as GHSA-hgf8-39gv-g3f2, but the added filtering failed to account for the fact that safe_join accepts paths with multiple segments, such as example/NUL. The function send_from_directory uses safe_join to safely serve files at user-specified paths under a directory. If the application is running on Windows, and the requested path ends with a special device name, the file will be opened successfully, but reading will hang indefinitely. This issue has been fixed in version 3.1.6.","provenance":"source","from":"CVE.org"},"cvss":{"score":6.3,"severity":"MEDIUM","version":"4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00622,"percentile":0.50766,"provenance":"source"},"cwes":[{"id":"CWE-67","name":"Improper Handling of Windows Device Names"}],"references":[{"url":"https://github.com/pallets/werkzeug/security/advisories/GHSA-29vq-49wr-vm6x","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/pallets/werkzeug/commit/f407712fdc60a09c2b3f4fe7db557703e5d9338d","tags":["x_refsource_MISC"]},{"url":"https://github.com/pallets/werkzeug/releases/tag/3.1.6","tags":["x_refsource_MISC"]}],"priority":{"score":14.6,"factors":[{"name":"EPSS percentile","points":10.15},{"name":"CVSS severity","points":4.41}]},"vendorSlug":"pallets","affectedVersions":[{"vendor":"pallets","product":"werkzeug","versions":["< 3.1.6"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2026-02-24T19:02:05.165135Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"werkzeug","vulnerableRanges":["<3.1.6"],"patched":["3.1.6"],"from":["GHSA-29vq-49wr-vm6x","PYSEC-2026-2320"],"provenance":"source"}],"summary":{"text":"The Werkzeug library's safe_join() function, which send_from_directory() relies on to serve files under a directory, fails to block Windows special device names (such as NUL) when they appear after other path segments. An unauthenticated remote attacker can exploit this with a network request for a path ending in such a device name, but only when the application runs on Windows, causing the request to hang indefinitely and tie up the server.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:35:52Z"},"euvd":{"id":"EUVD-2026-7732","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-pallets-werkzeug-cve-2025-66221","packageHistory":[{"cve":"CVE-2019-14322","published":"2019-07-28","fixed":"0.15.5","kev":false},{"cve":"CVE-2022-29361","published":"2022-05-24","fixed":"2.1.1","kev":false},{"cve":"CVE-2025-66221","published":"2025-11-29","fixed":"3.1.4","kev":false,"link":{"from":"CVE-2025-66221","to":"CVE-2026-27199","relation":"successor","confidence":"medium","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:werkzeug","fromFixed":"3.1.4","toFixed":"3.1.6","daysApart":84},{"kind":"similar","provenance":"machine","score":0.56,"basis":"same product + CWE + description similarity"}]}},{"cve":"CVE-2026-27199","published":"2026-02-21","fixed":"3.1.6","kev":false}],"package":"PyPI:werkzeug"}}