Vulnerabilities in pkg:pypi/werkzeug

PACKAGE
Advisory Identifier: GHSA-29vq-49wr-vm6x
Advisory Summary

CVE-2026-27199 is a MODERATE werkzeug safe_join() allows windows special vulnerability (CWE-67: Improper Handling of Windows Device Names) affecting Werkzeug libraries in the PyPI ecosystem. The issue involves werkzeug safe_join() allows windows special device names. Remediation is available by upgrading affected packages to version 3.1.6.

5 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/werkzeug

5 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/werkzeug. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-29vq-49wr-vm6x CVE-2026-27199 MODERATE Werkzeug safe_join() allows Windows special device names
GHSA-hgf8-39gv-g3f2 CVE-2025-66221 MODERATE Werkzeug safe_join() allows Windows special device names
GHSA-3p3h-qghp-hvh2 CVE-2020-28724 MODERATE Open Redirect in werkzeug
GHSA-gq9m-qvpx-68hc CVE-2019-14806 HIGH Pallets Werkzeug Insufficient Entropy
GHSA-j544-7q9p-6xp8 CVE-2019-14322 HIGH Pallets Werkzeug vulnerable to Path Traversal

CVE-2026-27199 at a Glance

CVE Identifier CVE-2026-27199
GHSA Identifier GHSA-29vq-49wr-vm6x
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-67: Improper Handling of Windows Device Names
Affected Product Werkzeug
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix CVE-2026-27199

To remediate this vulnerability, upgrade all affected Werkzeug dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

werkzeug fixed: 3.1.6
pip install werkzeug>=3.1.6
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show werkzeug

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-27199, inspect your installed packages using pip:

pip show werkzeug

Analyze the terminal output to locate any version of Werkzeug in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.1.6), your application is affected.

Note: The pip show werkzeug command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-67: Improper Handling of Windows Device Names, where the product constructs pathnames from user input, but it does not handle or incorrectly handles a pathname containing a windows device name such as aux or con. this typically leads to denial of service or an information exposure when the application attempts to process the pathname as a regular file. In Werkzeug, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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.

CVE-2026-27199 Affected Werkzeug Versions

1 component(s)
Fixed Versions:
3.1.6
Product / Package Ecosystem Affected Versions Fixed Version
werkzeug
PyPI
< 3.1.6
3.1.6

References

Frequently Asked Questions

What is CVE-2026-27199?
CVE-2026-27199 is a security vulnerability in Werkzeug involving Werkzeug safe_join() allows Windows special device names under CWE-67: Improper Handling of Windows Device Names.
Which Werkzeug versions are affected?
Affected versions include releases prior to 3.1.6 across affected packages: werkzeug.
What version fixes CVE-2026-27199?
Upgrading to 3.1.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is werkzeug affected?
Yes, werkzeug is affected in releases prior to 3.1.6. Upgrade your dependency to 3.1.6 or later.
What CWE is associated with CVE-2026-27199?
CVE-2026-27199 is classified under CWE-67: Improper Handling of Windows Device Names (The product constructs pathnames from user input, but it does not handle or incorrectly handles a pathname containing a Windows device name such as AUX or CON. This typically leads to denial of service or an information exposure when the application attempts to process the pathname as a regular file.).
How can I check PyPI dependencies for CVE-2026-27199?
Run the dependency tree command: 'pip show werkzeug'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-29vq-49wr-vm6x",
  "modified" : "2026-02-23T22:27:37Z",
  "published" : "2026-02-19T20:32:45Z",
  "aliases" : [ "CVE-2026-27199" ],
  "summary" : " Werkzeug safe_join() allows Windows special device names",
  "details" : "Werkzeug's `safe_join` function allows Windows device names as filenames if when preceded by other path segments.\n\nThis 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`.\n\n`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.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "werkzeug"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.1.6"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/pallets/werkzeug/security/advisories/GHSA-29vq-49wr-vm6x"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-27199"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pallets/werkzeug/commit/f407712fdc60a09c2b3f4fe7db557703e5d9338d"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/pallets/werkzeug"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pallets/werkzeug/releases/tag/3.1.6"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-67" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-02-19T20:32:45Z",
    "nvd_published_at" : "2026-02-21T06:17:00Z"
  }
}