Skip to content
Heist/ feed
Back to feed
Medium

Werkzeug safe_join() allows Windows special device names

Type: advisorySources: OSV

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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2026-27199
Confirmed fixed CVEs
Not specified
Updated in this feed
3 Nov 2026, 02:14 UTC · Revision 1

Source evidence

Werkzeug safe_join() allows Windows special device names

core-osv · Original source

Published 21 Feb 2026, 05:15 UTC

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.

osv:CVE-2026-27199
Complete source record
{
  "id": "d6b58544b23eab28531cf091e0876799d5de161d195cbb0d48be9f90f932254c",
  "url": "https://osv.dev/vulnerability/CVE-2026-27199",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Werkzeug safe_join() allows Windows special device names",
    "summary": "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.",
    "evidence": "osv:CVE-2026-27199",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2026-27199",
      "aliases": [
        "CVE-2026-27199",
        "GHSA-29vq-49wr-vm6x",
        "PYSEC-2026-2320"
      ],
      "metrics": [
        {
          "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": [
        {
          "ranges": [
            {
              "repo": "https://github.com/pallets/werkzeug",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "04da1b5221b7a7b57e82246e4b5741d37a6b2e56"
                },
                {
                  "fixed": "f407712fdc60a09c2b3f4fe7db557703e5d9338d"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:palletsprojects:werkzeug:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "3.1.6"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "range": [
                      {
                        "fixed": "f407712fdc60a09c2b3f4fe7db557703e5d9338d"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  },
                  {
                    "range": [
                      {
                        "fixed": "04da1b5221b7a7b57e82246e4b5741d37a6b2e56"
                      }
                    ],
                    "source": "REFERENCES_TAG",
                    "original_tag": "3.1.6"
                  }
                ]
              }
            }
          ],
          "versions": [
            "2.2.0",
            "2.2.0a1",
            "2.1.0",
            "2.0.0",
            "2.0.0rc5",
            "2.0.0rc4",
            "2.0.0rc3",
            "2.0.0rc2",
            "2.0.0rc1",
            "1.0.0",
            "1.0.0rc1",
            "0.15.0",
            "0.14",
            "0.13",
            "0.12",
            "0.11",
            "0.10",
            "0.9",
            "0.8",
            "0.7",
            "0.6.2",
            "0.6.1",
            "0.6",
            "0.4.1",
            "0.4",
            "0.3",
            "0.2",
            "0.1"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-27199.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:25.125932149Z",
      "provider": "osv",
      "references": [
        "https://github.com/pallets/werkzeug/releases/tag/3.1.6",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/27xxx/CVE-2026-27199.json",
        "https://github.com/pallets/werkzeug/security/advisories/GHSA-29vq-49wr-vm6x",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-27199",
        "https://github.com/pallets/werkzeug/commit/f407712fdc60a09c2b3f4fe7db557703e5d9338d"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-67"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/27xxx/CVE-2026-27199.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-27199",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 491818,
  "published_at": "2026-02-21T05:15:53.335+00:00"
}