Path Truncation Vulnerability in Python 3.11 - CVE-2023-41105

python3.11 Updated 02 Oct 2025

Summary

23/08/2023
N/A
No i
High
7.5

UBUNTU-CVE-2023-41105: An issue was discovered in Python 3.11 through 3.11.4. Affects python3.11 versions 3.11.0~rc1-1~22.04. No fix is published. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Python 3.11 is a widely used programming language known for its simplicity and versatility in various applications, including web development, data analysis, and automation. This version introduced several enhancements and features, but it also introduced a vulnerability that affects how paths containing null bytes ('\0') are handled, potentially leading to unexpected behavior in applications relying on file path validation.

Vulnerability Detail

An issue was discovered in Python 3.11 through 3.11.4 where passing a path containing '\0' bytes to os.path.normpath() results in the path being truncated at the first '\0' byte. This change in behavior from Python 3.10.x and earlier versions can lead to security vulnerabilities, as applications may accept filenames that should have been rejected, potentially allowing unauthorized access or manipulation of files.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As a temporary workaround, avoid using paths that contain null bytes ('\0') in your applications. Implement additional validation checks in your code to reject such filenames before passing them to os.path.normpath().

Conclusion

CVE-2023-41105 presents a significant security risk in Python 3.11 due to its handling of paths with null bytes. It is crucial to update to the patched version to ensure the security of applications using this version of Python. Implementing workarounds can help mitigate risks until an update can be applied.

See every vulnerability recorded for python3.11 →

Share this vulnerability

FAQ

CVE-2023-41105 is a vulnerability in Python 3.11 that allows paths containing null bytes to be truncated, potentially leading to security issues.

You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

The risks include unauthorized access to files and manipulation of file paths that should have been rejected, leading to potential security breaches.

Yes, a patched version of Python 3.11 is available. Update to version 3.11.0~rc1-1~22.04.1~esm1 to mitigate the vulnerability.

If you cannot update immediately, implement additional validation checks in your code to reject filenames containing null bytes.

Related vulnerabilities

Recent vulnerabilities recorded for python3.11.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback