Patchfirst
CVE-2024-49766 Medium · 6.3 EPSS 0.8%

Werkzeug safe_join not safe on Windows

Fix:upgrade Werkzeug to 3.0.6 or later also fixes CVE-2019-14322 Details ↓

pallets · werkzeug

Summary

The flaw is in Werkzeug, a Web Server Gateway Interface web application library, where its safe_join() function fails to block UNC paths such as //server/share on Python versions before 3.11 running on Windows, because os.path.isabs() does not detect them. An attacker with network access and no authentication or user interaction could potentially produce a path that escapes the intended directory and gain access to data beyond what the application meant to expose, but only where the application runs on Python below 3.11 on Windows.

Official description · CVE.org

Werkzeug is a Web Server Gateway Interface web application library. On Python < 3.11 on Windows, os.path.isabs() does not catch UNC paths like //server/share. Werkzeug's safe_join() relies on this check, and so can produce a path that is not safe, potentially allowing unintended access to data. Applications using Python >= 3.11, or not using Windows, are not vulnerable. Werkzeug version 3.0.6 contains a patch.

Breakdown
70.8 / 100
Exploited
Yes, in VulnCheck KEV
Reports
0
Tactics
0/15

First seen exploited 23 months after disclosure.

  1. Disclosedday 0
  2. First seen exploitedVulnCheck KEV evidence+23 mo

7 fixes in Werkzeug over 4 years. The latest fix listed for Werkzeug is 3.1.9.

Fixes in WerkzeugPyPI package, by fixed version. Earlier and later fixes in the same package, not necessarily the same bug.

  1. 2.2.3CVE-2023-2557714 Feb 2023
  2. 3.0.1CVE-2023-4613624 Oct 2023
  3. 3.0.3CVE-2024-340696 May 2024
  4. 3.0.6CVE-2024-4976625 Oct 2024
  5. 3.0.6CVE-2024-4976725 Oct 2024
  6. 3.1.5CVE-2026-218608 Jan 2026
  7. 3.1.9CVE-2026-10259829 Sep 2026Latest listed

Affected versions and fixes

as published in the CVE record

pallets werkzeug

Affected: < 3.0.6

Am I affected? What do I upgrade to?

From GitHub Security Advisories and OSV

1 package in 1 ecosystem. Main package: Werkzeug.

Upgrade to 3.0.6 or later

Fixes this CVE and 1 other known vulnerability in this package (CVE-2019-14322).

pippip install "Werkzeug>=3.0.6"

The first fix for CVE-2024-49766.

Affected versions

If you runUpgrade to
All versions before 3.0.63.0.6

“Up to” means the second version is the fix and is not affected.

Check your lockfile against all CVEs

References

4 links, grouped by NVD tag
↑ ↓ chooseEnter openEsc close