← Back
CVE-2025-66221
Vulnerability in werkzeug (CVE-2025-66221)
Summary
vulnerability in werkzeug (CVE-2025-66221). Risk of unauthorized operations or information disclosure. Exploitable via ``safe_join``. Mitigation: upgrade to `3.1.4` or later.
AI summary snake-internal / snake-material-v2
A vulnerability tracked as **CVE-2025-66221** has been found in werkzeug.
Attackers can target a specific entry point like ``safe_join`` over the network to misuse the product.
Risk of unauthorized operations or information disclosure. CVSS score: ?/10.
What to do: upgrade werkzeug to **3.1.4** or later.
If unsure, ask your IT team or search "werkzeug CVE-2025-66221" on the vendor's site.
CVE-2025-66221 (werkzeug) — CWE-67 /
Attack surface: `safe_join` / `CON` / `AUX` / `send_from_directory`
Patched: `3.1.4` — apply immediately
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.
❓ What is the problem
**A vulnerability** (CWE-67) exists in werkzeug. Attackers reach the vulnerable code path via ``safe_join`` without authentication.
📍 Affected scope
werkzeug — . Attack surface: `safe_join` / `CON` / `AUX` / `send_from_directory`.
🔥 Severity
Severity: ?. Risk of unauthorized operations or information disclosure
🔧 How to fix
Update to **3.1.4**.
🛡️ Workaround
Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.
🔍 Detection
Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run `grep -r 'werkzeug' .` against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.
Response Actions (7 steps)
Concrete steps and command examples for SOC/SRE teams to execute in order
-
1Identify exposure identify
grep -r 'werkzeug' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で `werkzeug` を grep し、稼働しているサービス・バージョンを把握する。
-
6Apply patch patch
Upgrade werkzeug to 3.1.4ステージング環境で 3.1.4 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスと、Step 3 で見つけた異常検知の続報チェックを含めること。
-
7Post-deployment verification verify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番では Step 3 と同じログクエリでアラート再発が無いか継続監視。
Affected packages
PyPI
werkzeug
[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.1.4"}]}]
References
- advisory https://nvd.nist.gov/vuln/detail/CVE-2025-66221
- advisory https://github.com/advisories/GHSA-hgf8-39gv-g3f2
- package https://github.com/pallets/werkzeug
- package https://pypi.org/project/werkzeug
- web https://github.com/pallets/werkzeug/security/advisories/GHSA-hgf8-39gv-g3f2
- web https://github.com/pallets/werkzeug/commit/4b833376a45c323a189cd11d2362bcffdb1c0c13
- web https://github.com/pallets/werkzeug/releases/tag/3.1.4