Critical Information Disclosure Vulnerability in RestrictedPython Package

restrictedpython Updated 02 Oct 2025

Summary

30/08/2023
N/A
Yes i
Unrated
Not published

DEBIAN-CVE-2023-41039: RestrictedPython is a restricted execution environment for Python to run untrusted code. Affects restrictedpython versions < 6.2-1. Fixed in 6.2-1. 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 MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

RestrictedPython is a specialized execution environment designed for Python that allows untrusted code to run safely. It restricts access to certain Python functionalities to prevent malicious actions. However, due to its reliance on Python's format functionality, it is susceptible to vulnerabilities that can lead to unauthorized access to sensitive information.

Vulnerability Detail

The vulnerability arises from Python's 'format' functionality, which can be exploited by an attacker controlling the format string. This allows them to 'read' all objects accessible through recursive attribute lookup and subscription from objects they can access. The issue is present in all known versions of RestrictedPython, leading to critical information disclosure. The vulnerability has been addressed in commit '4134aedcff1', included in the 5.4 and 6.2 releases.

How To Fix

Minimum fixed version

6.2-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade restrictedpython

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There are no known workarounds for this vulnerability. The best course of action is to upgrade to the patched version of RestrictedPython.

Conclusion

The vulnerability in the RestrictedPython package poses a significant risk of information disclosure due to its reliance on Python's format functionality. Users are strongly advised to upgrade to the latest patched version to mitigate this risk.

See every vulnerability recorded for restrictedpython →

Share this vulnerability

FAQ

RestrictedPython is a restricted execution environment for Python that allows untrusted code to run safely.

This vulnerability allows an attacker to access sensitive information through unauthorized object access via format strings.

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

Yes, the vulnerability has been patched in versions 5.4 and 6.2 of RestrictedPython.

There are no known workarounds for this vulnerability, so it is crucial to prioritize upgrading to the patched version.

Related vulnerabilities

Recent vulnerabilities recorded for restrictedpython.

How To Fix

Minimum fixed version

6.2-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade restrictedpython

Tip — Not sure which version your app runs? Vulert can match this fix to it. 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