CVE-2023-29159
Python vulnerability analysis and mitigation

Overview

Starlette versions 0.13.5 and later, prior to 0.27.0, contain a directory traversal vulnerability that allows remote unauthenticated attackers to view files in web services built using Starlette. The vulnerability was discovered by Masashi Yamane of LAC Co., Ltd and reported to JPCERT/CC Vulnerability Coordination Group (JPCERT Advisory, GitHub Advisory).

Technical details

The vulnerability (CVE-2023-29159) stems from the improper use of os.path.commonprefix() in the StaticFiles component. When a file or directory name starts with the same prefix as the StaticFiles directory, the file becomes exposed due to path traversal. This occurs because os.path.commonprefix() works character by character rather than treating arguments as paths. For example, when accessing '/static/../static1.txt', the function returns './static' as the common part between './static1.txt' and './static', incorrectly allowing access to files outside the intended directory (GitHub Advisory).

Impact

The vulnerability breaches confidentiality by allowing attackers to obtain files that should not be publicly accessible. The CVSS v3.1 base score is 7.5 HIGH (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N), indicating significant potential for unauthorized file access (NVD).

Exploitability

The vulnerability can be exploited by an unauthenticated remote attacker by sending specially crafted paths to access files outside the intended static files directory. A proof of concept exists demonstrating how files like 'static1.txt' and directories like 'static_disallow' can be exposed through path traversal (GitHub Advisory).

Mitigation and workarounds

The vulnerability has been fixed in Starlette version 0.27.0 by replacing os.path.commonprefix with os.path.commonpath, which properly handles path comparisons. Users should update to version 0.27.0 or later to address this security issue (GitHub Release).

Additional resources


SourceThis report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-48039CRITICAL9.1
  • Python logoPython
  • meta-ads-mcp
NoYesAug 07, 2026
CVE-2026-48169HIGH8.8
  • Python logoPython
  • praisonai-platform
NoYesAug 07, 2026
GHSA-wvpp-8hx9-p66jHIGH8.8
  • Python logoPython
  • gitpython
NoYesAug 07, 2026
CVE-2026-71870MEDIUM4.8
  • Python logoPython
  • nemo
NoYesAug 07, 2026
CVE-2026-71852MEDIUM4.8
  • Python logoPython
  • pypdf
NoYesAug 07, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management