CVE-2025-66221: Werkzeug safe_join() allows Windows special device names
Werkzeug is a comprehensive WSGI web application library. Prior to version 3.1.4, Werkzeug's safe_join function allows path segments with Windows device names. On Windows, there are special device names such as CON, AUX, etc that are implicitly present and readable in every directory. 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 patched in version 3.1.4.
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2025-66221?
CVE-2025-66221 has been classified with medium severity due to the potential exposure of sensitive information through the unsafe handling of path segments.
How do I fix CVE-2025-66221?
To fix CVE-2025-66221, upgrade Werkzeug to version 3.1.4 or later where the vulnerability is addressed.
What specific issue does CVE-2025-66221 address?
CVE-2025-66221 addresses the vulnerability in Werkzeug's safe_join function that allows path segments with special Windows device names, which may lead to unauthorized access.
Which versions of Werkzeug are affected by CVE-2025-66221?
Werkzeug versions prior to 3.1.4 are affected by CVE-2025-66221.
Is there a patch for CVE-2025-66221?
Yes, the patch for CVE-2025-66221 is included in Werkzeug version 3.1.4 and later.