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 package | Versions | Reported by |
|---|---|---|
| pallets werkzeug | < 3.1.6 | CVE List |
| werkzeug (PyPI) | before 3.1.6 | GitHub Advisory Database, PyPA Advisory Database |
| palletsprojects werkzeug | before 3.1.6 | NVD |
All scores
| GitHub_M | 6.3medium CVSS:4.0 | 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 |
| GitHub | medium CVSS:4.0 | 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 |
| NVD | 5.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L |
| PyPA Advisory Database | 5.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L |
Classification
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
| https://github.com/pallets/werkzeug/security/advisories/GHSA-29vq-49wr-vm6x | advisory, vendor-advisory, web | |
| https://github.com/pallets/werkzeug/commit/f407712fdc60a09c2b3f4fe7db557703e5d9338d | fix, patch, web | |
| https://github.com/pallets/werkzeug/releases/tag/3.1.6 | advisory, release-notes, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2026-27199 | advisory | |
| https://github.com/pallets/werkzeug | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-27199 changed 2026-02-24 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-29vq-49wr-vm6x changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2026-27199 changed 2026-06-17 | Public domain |
| PyPA Advisory Database | PYSEC-2026-2320 changed 2026-07-13 | CC-BY-4.0 |