CVE-2026-27199
JSON

6.3medium

Werkzeug safe_join() allows Windows special device names

Severity
6.3medium CVSS:4.0 by GitHub_M
Exploit likelihood
0.65% (higher than 46% of CVEs)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-29vq-49wr-vm6xPYSEC-2026-2320

Description

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.

Affected

Product or packageVersionsReported by
pallets werkzeug< 3.1.6CVE List
werkzeug (PyPI)before 3.1.6GitHub Advisory Database, PyPA Advisory Database
palletsprojects werkzeugbefore 3.1.6NVD

All scores

GitHub_M6.3medium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N
GitHubmedium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N
NVD5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
PyPA Advisory Database5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

Classification

CWE-67

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

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.

GitHub Advisory Database

Werkzeug's safe_join function allows Windows device names as filenames if when preceded by other path segments.

This was previously reported as https://github.com/pallets/werkzeug/security/advisories/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.

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.

NVD (es)

Werkzeug es una completa biblioteca de aplicaciones web WSGI. Las versiones 3.1.5 e inferiores, la función safe_join permite nombres de dispositivos de Windows como nombres de archivo si van precedidos por otros segmentos de ruta. Esto fue reportado previamente como GHSA-hgf8-39gv-g3f2, pero el filtrado añadido no tuvo en cuenta el hecho de que safe_join acepta rutas con múltiples segmentos, como example/NUL. La función send_from_directory utiliza safe_join para servir archivos de forma segura en rutas especificadas por el usuario bajo un directorio. Si la aplicación se está ejecutando en Windows, y la ruta solicitada termina con un nombre de dispositivo especial, el archivo se abrirá con éxito, pero la lectura se colgará indefinidamente. Este problema ha sido solucionado en la versión 3.1.6.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-27199 changed 2026-02-24CVE Terms of Use
GitHub Advisory DatabaseGHSA-29vq-49wr-vm6x changed 2026-09-10CC-BY-4.0
NVDCVE-2026-27199 changed 2026-06-17Public domain
PyPA Advisory DatabasePYSEC-2026-2320 changed 2026-07-13CC-BY-4.0