CVE-2023-29159
published 2023-06-01CVE-2023-29159: Directory traversal vulnerability in Starlette versions 0.13.5 and later and prior to 0.27.0 allows a remote unauthenticated attacker to view files in a web…
PriorityP349high7.5CVSS 3.1
AVNACLPRNUINSUCHINAN
EPSS
2.03%
78.6th percentile
Directory traversal vulnerability in Starlette versions 0.13.5 and later and prior to 0.27.0 allows a remote unauthenticated attacker to view files in a web service which was built using Starlette.
Affected
6 ranges
| Vendor | Product | Version range | Fixed in |
|---|---|---|---|
| debian | starlette | < starlette 0.28.0-1 (forky) | starlette 0.28.0-1 (forky) |
| encode | starlette | — | — |
| encode | starlette | >= 0 < 0.28.0-1 | 0.28.0-1 |
| encode | starlette | >= 0 < 0.28.0-1 | 0.28.0-1 |
| encode | starlette | >= 0.13.5 < 0.27.0 | 0.27.0 |
| encode | starlette | >= 0.13.5 < 0.27.0 | 0.27.0 |
CVSS provenance
nvdv3.17.5HIGHCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
osv7.5HIGH
vendor_debian7.5HIGH
Stop checking back — get the weekly exploitation signal.
Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.
Debian
CVE-2023-29159: starlette - Directory traversal vulnerability in Starlette versions 0.13.5 and later and pri...
vendor_debian·2023·CVSS 7.5
CVE-2023-29159 [HIGH] CVE-2023-29159: starlette - Directory traversal vulnerability in Starlette versions 0.13.5 and later and pri...
Directory traversal vulnerability in Starlette versions 0.13.5 and later and prior to 0.27.0 allows a remote unauthenticated attacker to view files in a web service which was built using Starlette.
Scope: local
bookworm: open
bullseye: open
forky: resolved (fixed in 0.28.0-1)
sid: resolved (fixed in 0.28.0-1)
trixie: resolved (fixed in 0.28.0-1)
OSV
CVE-2023-29159: Directory traversal vulnerability in Starlette versions 0
osv·2023-06-01·CVSS 7.5
CVE-2023-29159 [HIGH] CVE-2023-29159: Directory traversal vulnerability in Starlette versions 0
Directory traversal vulnerability in Starlette versions 0.13.5 and later and prior to 0.27.0 allows a remote unauthenticated attacker to view files in a web service which was built using Starlette.
OSV
Starlette has Path Traversal vulnerability in StaticFiles
osv·2023-05-17
CVE-2023-29159 [MEDIUM] Starlette has Path Traversal vulnerability in StaticFiles
Starlette has Path Traversal vulnerability in StaticFiles
### Summary
When using `StaticFiles`, if there's a file or directory that starts with the same name as the `StaticFiles` directory, that file or directory is also exposed via `StaticFiles` which is a path traversal vulnerability.
### Details
The root cause of this issue is the usage of `os.path.commonprefix()`:
https://github.com/encode/starlette/blob/4bab981d9e870f6cee1bd4cd59b87ddaf355b2dc/starlette/staticfiles.py#L172-L174
As stated in the Python documentation (https://docs.python.org/3/library/os.path.html#os.path.commonprefix) this function returns the longest prefix common to paths.
When passing a path like `/static/../static1.txt`, `os.path.commonprefix([full_path, directory])` returns `./static` which is the common part
GHSA
Starlette has Path Traversal vulnerability in StaticFiles
ghsa·2023-05-17
CVE-2023-29159 [MEDIUM] CWE-22 Starlette has Path Traversal vulnerability in StaticFiles
Starlette has Path Traversal vulnerability in StaticFiles
### Summary
When using `StaticFiles`, if there's a file or directory that starts with the same name as the `StaticFiles` directory, that file or directory is also exposed via `StaticFiles` which is a path traversal vulnerability.
### Details
The root cause of this issue is the usage of `os.path.commonprefix()`:
https://github.com/encode/starlette/blob/4bab981d9e870f6cee1bd4cd59b87ddaf355b2dc/starlette/staticfiles.py#L172-L174
As stated in the Python documentation (https://docs.python.org/3/library/os.path.html#os.path.commonprefix) this function returns the longest prefix common to paths.
When passing a path like `/static/../static1.txt`, `os.path.commonprefix([full_path, directory])` returns `./static` which is the common part
No detection rules found.
No public exploits indexed.
No writeups or analysis indexed.
https://github.com/encode/starlette/releases/tag/0.27.0https://github.com/encode/starlette/security/advisories/GHSA-v5gw-mw7f-84pxhttps://jvn.jp/en/jp/JVN95981715/https://github.com/encode/starlette/releases/tag/0.27.0https://github.com/encode/starlette/security/advisories/GHSA-v5gw-mw7f-84pxhttps://jvn.jp/en/jp/JVN95981715/
2023-06-01
Published