7.5high
os.path.normpath() truncates on null bytes
- Severity
- 7.5high CVSS:3.1 by NVD
- Exploit likelihood
- 2.52% (higher than 85% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- mitre
- Also known as
- PSF-2023-9BIT-LIBPYTHON-2023-41105BIT-PYTHON-2023-41105BIT-PYTHON-MIN-2023-41105
Description
An issue was discovered in Python 3.11 through 3.11.4. If a path containing '\0' bytes is passed to os.path.normpath(), the path will be truncated unexpectedly at the first '\0' byte. There are plausible cases in which an application would have rejected a filename for security reasons in Python 3.10.x or earlier, but that filename is no longer rejected in Python 3.11.x.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Unspecified product | n/a | CVE List |
| python python | from 3.11 up to 3.11.4, from 3.11.0 up to 3.11.4 | CVE List, NVD |
| https://github.com/python/cpython | from 7c12e4835ebe52287acd200a2e76b533413b15d0 before 09322724319d4c23195300b222a1c0ea720af56b, before ede98958810b76694cf756d305b564cd6adc1a48, before ccf81e1088c25a9f4464e478dc3b5c03ed7ee63b | Python Software Foundation |
| netapp active_iq_unified_manager | Not specified | NVD |
| libpython (Bitnami) | from 3.11.0 before 3.11.5 | Bitnami Vulnerability Database |
| python (Bitnami) | from 3.11.0 before 3.11.5 | Bitnami Vulnerability Database |
| python-min (Bitnami) | from 3.11.0 before 3.11.5 | Bitnami Vulnerability Database |
All scores
| NVD | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N |
| Bitnami Vulnerability Database | high rating |
Classification
SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.
What each source says
CVE List
An issue was discovered in Python 3.11 through 3.11.4. If a path containing '\0' bytes is passed to os.path.normpath(), the path will be truncated unexpectedly at the first '\0' byte. There are plausible cases in which an application would have rejected a filename for security reasons in Python 3.10.x or earlier, but that filename is no longer rejected in Python 3.11.x.
Python Software Foundation
Passing a path with null bytes to the os.path.normpath() function causes the returned path to be unexpectedly truncated at the first occurrence of null bytes within the path. Python versions before 3.11.0 didn’t truncate the path on null bytes.
If allowlisting is applied before a call to os.path.normpath() is used later in the program, the allowlisting can be circumvented if the path containing null bytes is constructed to pass the allowlist but then change to the targeted resource after truncation.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2023-41105 changed 2024-10-03 | CVE Terms of Use |
| Python Software Foundation | PSF-2023-9 changed 2025-10-09 | CC-BY-4.0 |
| NVD | CVE-2023-41105 changed 2026-06-17 | Public domain |
| Bitnami Vulnerability Database | BIT-LIBPYTHON-2023-41105 changed 2026-09-08 | Apache-2.0 |
| Bitnami Vulnerability Database | BIT-PYTHON-2023-41105 changed 2026-09-08 | Apache-2.0 |
| Bitnami Vulnerability Database | BIT-PYTHON-MIN-2023-41105 changed 2026-09-08 | Apache-2.0 |