CVE-2023-41105
JSON

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 packageVersionsReported by
Unspecified productn/aCVE List
python pythonfrom 3.11 up to 3.11.4, from 3.11.0 up to 3.11.4CVE List, NVD
https://github.com/python/cpythonfrom 7c12e4835ebe52287acd200a2e76b533413b15d0 before 09322724319d4c23195300b222a1c0ea720af56b, before ede98958810b76694cf756d305b564cd6adc1a48, before ccf81e1088c25a9f4464e478dc3b5c03ed7ee63bPython Software Foundation
netapp active_iq_unified_managerNot specifiedNVD
libpython (Bitnami)from 3.11.0 before 3.11.5Bitnami Vulnerability Database
python (Bitnami)from 3.11.0 before 3.11.5Bitnami Vulnerability Database
python-min (Bitnami)from 3.11.0 before 3.11.5Bitnami Vulnerability Database

All scores

NVD7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Bitnami Vulnerability Databasehigh rating

Classification

CWE-426

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

SourceRecordLicence
CVE ListCVE-2023-41105 changed 2024-10-03CVE Terms of Use
Python Software FoundationPSF-2023-9 changed 2025-10-09CC-BY-4.0
NVDCVE-2023-41105 changed 2026-06-17Public domain
Bitnami Vulnerability DatabaseBIT-LIBPYTHON-2023-41105 changed 2026-09-08Apache-2.0
Bitnami Vulnerability DatabaseBIT-PYTHON-2023-41105 changed 2026-09-08Apache-2.0
Bitnami Vulnerability DatabaseBIT-PYTHON-MIN-2023-41105 changed 2026-09-08Apache-2.0