RestrictedPython up to 5.3/6.1 Format injection

CVSS Meta Temp Score
CVSS is a standardized scoring system to determine possibilities of attacks. The Temp Score considers temporal factors like disclosure, exploit and countermeasures. The unique Meta Score calculates the average score of different sources to provide a normalized scoring system.
Current Exploit Price (≈)
Our analysts are monitoring exploit markets and are in contact with vulnerability brokers. The range indicates the observed or calculated exploit price to be seen on exploit markets. A good indicator to understand the monetary effort required for and the popularity of an attack.
CTI Interest Score
Our Cyber Threat Intelligence team is monitoring different web sites, mailing lists, exploit markets and social media networks. The CTI Interest Score identifies the interest of attackers and the security community for this specific vulnerability in real-time. A high score indicates an elevated risk to be targeted for this vulnerability.
6.7$0-$5k0.00

Summaryinfo

A vulnerability has been found in RestrictedPython up to 5.3/6.1 and classified as problematic. Impacted is an unknown function of the component Format Handler. Performing a manipulation results in injection. This vulnerability was named CVE-2023-41039. The attack may be initiated remotely. There is no available exploit. The affected component should be upgraded.

Detailsinfo

A vulnerability was found in RestrictedPython up to 5.3/6.1 (Programming Language Software). It has been classified as problematic. This affects an unknown part of the component Format Handler. The manipulation with an unknown input leads to a injection vulnerability. CWE is classifying the issue as CWE-74. The product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component. This is going to have an impact on confidentiality, integrity, and availability. The summary by CVE is:

RestrictedPython is a restricted execution environment for Python to run untrusted code. Python's "format" functionality allows someone controlling the format string to "read" all objects accessible through recursive attribute lookup and subscription from objects he can access. This can lead to critical information disclosure. With `RestrictedPython`, the format functionality is available via the `format` and `format_map` methods of `str` (and `unicode`) (accessed either via the class or its instances) and via `string.Formatter`. All known versions of `RestrictedPython` are vulnerable. This issue has been addressed in commit `4134aedcff1` which has been included in the 5.4 and 6.2 releases. Users are advised to upgrade. There are no known workarounds for this vulnerability.

The weakness was presented 08/30/2023 as GHSA-xjw2-6jm9-rf67. The advisory is shared at github.com. This vulnerability is uniquely identified as CVE-2023-41039 since 08/22/2023. It demands that the victim is doing some kind of user interaction. Neither technical details nor an exploit are publicly available. MITRE ATT&CK project uses the attack technique T1055 for this issue.

The vulnerability scanner Nessus provides a plugin with the ID 232986 (Ubuntu 20.04 LTS / 22.04 LTS / 24.04 LTS / 24.10 : RestrictedPython vulnerabilities (USN-7355-1)), which helps to determine the existence of the flaw in a target environment.

Upgrading to version 5.4 or 6.2 eliminates this vulnerability. Applying the patch 4134aedcff17c977da7717693ed89ce56d54c120 is able to eliminate this problem. The bugfix is ready for download at github.com. The best possible mitigation is suggested to be upgrading to the latest version.

The vulnerability is also documented in the vulnerability database at Tenable (232986). Several companies clearly confirm that VulDB is the primary source for best vulnerability data.

Productinfo

Type

Name

Version

License

CPE 2.3info

CPE 2.2info

CVSSv4info

VulDB Vector: 🔍
VulDB Reliability: 🔍

CVSSv3info

VulDB Meta Base Score: 6.8
VulDB Meta Temp Score: 6.7

VulDB Base Score: 4.3
VulDB Temp Score: 4.1
VulDB Vector: 🔍
VulDB Reliability: 🔍

NVD Base Score: 7.7
NVD Vector: 🔍

CNA Base Score: 8.3
CNA Vector (GitHub, Inc.): 🔍

CVSSv2info

AVACAuCIA
💳💳💳💳💳💳
💳💳💳💳💳💳
💳💳💳💳💳💳
VectorComplexityAuthenticationConfidentialityIntegrityAvailability
UnlockUnlockUnlockUnlockUnlockUnlock
UnlockUnlockUnlockUnlockUnlockUnlock
UnlockUnlockUnlockUnlockUnlockUnlock

VulDB Base Score: 🔍
VulDB Temp Score: 🔍
VulDB Reliability: 🔍

Exploitinginfo

Class: Injection
CWE: CWE-74 / CWE-707 / CWE-20
CAPEC: 🔍
ATT&CK: 🔍

Physical: No
Local: No
Remote: Yes

Availability: 🔍
Status: Not defined

EPSS Score: 🔍
EPSS Percentile: 🔍

Price Prediction: 🔍
Current Price Estimation: 🔍

0-DayUnlockUnlockUnlockUnlock
TodayUnlockUnlockUnlockUnlock

Nessus ID: 232986
Nessus Name: Ubuntu 20.04 LTS / 22.04 LTS / 24.04 LTS / 24.10 : RestrictedPython vulnerabilities (USN-7355-1)

Threat Intelligenceinfo

Interest: 🔍
Active Actors: 🔍
Active APT Groups: 🔍

Countermeasuresinfo

Recommended: Upgrade
Status: 🔍

0-Day Time: 🔍

Upgrade: RestrictedPython 5.4/6.2
Patch: 4134aedcff17c977da7717693ed89ce56d54c120

Timelineinfo

08/22/2023 🔍
08/30/2023 +8 days 🔍
08/30/2023 +0 days 🔍
03/20/2025 +568 days 🔍

Sourcesinfo

Advisory: GHSA-xjw2-6jm9-rf67
Status: Confirmed

CVE: CVE-2023-41039 (🔍)
GCVE (CVE): GCVE-0-2023-41039
GCVE (VulDB): GCVE-100-238353

Entryinfo

Created: 08/30/2023 20:32
Updated: 03/20/2025 19:30
Changes: 08/30/2023 20:32 (52), 09/27/2023 08:07 (11), 03/20/2025 19:30 (17)
Complete: 🔍
Cache ID: 216::103

Several companies clearly confirm that VulDB is the primary source for best vulnerability data.

Discussion

No comments yet. Languages: en.

Please log in to comment.

Want to stay up to date on a daily basis?

Enable the mail alert feature now!