---
id: CVE-2025-66221
title: Werkzeug is a comprehensive WSGI web application library
summary: >-
  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 imp…
severity: medium
cvss: 5.3
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L'
cwe:
  - CWE-67
vendor: palletsprojects
product: werkzeug
affected:
  - werkzeug < 3.1.4
patched:
  - werkzeug 3.1.4
published: '2025-11-29'
updated: '2026-10-07'
sourceUpdated: '2026-10-07T20:10:01.970'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2025-66221'
references:
  - url: >-
      https://github.com/pallets/werkzeug/commit/4b833376a45c323a189cd11d2362bcffdb1c0c13
    label: security-advisories@github.com
  - url: 'https://github.com/pallets/werkzeug/releases/tag/3.1.4'
    label: security-advisories@github.com
  - url: >-
      https://github.com/pallets/werkzeug/security/advisories/GHSA-hgf8-39gv-g3f2
    label: security-advisories@github.com
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2025-66221'
  - url: 'https://github.com/pallets/werkzeug'
tags:
  - nvd
  - osv
  - pip
epss: 0.00511
epssPercentile: 0.43356
aliases:
  - GHSA-hgf8-39gv-g3f2
  - PYSEC-2026-2046
ecosystem: pip
ingestedAt: '2026-07-08T18:25:50.210Z'
---

## Overview

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

- `werkzeug < 3.1.4`

## Remediation

Upgrade past the affected range:

- `werkzeug 3.1.4`

## Package advisory (CVE-2025-66221)

Affected packages:

- `werkzeug < 3.1.4`

Patched in:

- `werkzeug 3.1.4`

Source: https://osv.dev/vulnerability/GHSA-hgf8-39gv-g3f2
