8.3

CVE-2023-41039: Sandbox escape via various forms of "format" in RestrictedPython

Modified
AliasesGHSA-xjw2-6jm9-rf67PYSEC-2023-159UBUNTU-CVE-2023-41039
Published 30-08-2023Last modified 01-10-2024

Vulnerability summary

CVE-2023-41039 is a high (CVSS 8.3) vulnerability in zope restrictedpython. EPSS estimates a 0.68% chance of exploitation in the next 30 days, higher than 52.5% of scored vulnerabilities.

Priority
Routine

Not severe (CVSS 8.3, network access); no exploitation reported by the 5 checked sources

Source freshness unavailable

How is this decided?
CVSS score
8.3/10
010
High · v3.1 (CVE.org)
EPSS score
0.68%
0%100%
Low · 0.00 pp in 30 days
KEVNot listedNot listed by any tracked catalog.
RansomwareNot flaggedNo ransomware use recorded.
Public exploits0No public exploits recorded

Advisory lineage

Upstream 0 · Downstream 1 · Related 1

Timeline

  1. 30-08-2023
    PublishedVulnerability first disclosed.
  2. 01-10-2024
    Last modifiedVulnerability information updated.

Description

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.

CVSS metrics

5 scores · 5 sources · 1 version

EPSS trend

Probability

0.68%

Chance of exploitation in the next 30 days

Percentile

53%

Versus all other CVEs

30-day change

No change 0.00 pp

From 0.68% on 04-10-2026

04-10-202603-11-2026

Known exploited

Compare KEV catalogs
CISA KEV

Not in the CISA KEV catalog.

ENISA CNW

Not in the ENISA CNW catalog.

CIRCL

Not in the CIRCL catalog.

Public exploits

0 found

No public exploits indexed.

Weaknesses

CWE · root cause

Affected systems

Version check

Known conditions: network-reachable, administrative account, user interaction (CVSS vector). Other conditions: not stated in public data.

Debian1 product
  • restrictedpythonAll versions (No fix recorded) | < 6.2-1
PyPI1 product
  • restrictedpython≥ 6.0, < 6.2 | < 4134aedcff17c977da7717693ed89ce56d54c120 | < 5.4
Ubuntu1 product
  • restrictedpython< 4.0~b3-2ubuntu0.1~esm1 | < 4.0~b3-3ubuntu0.1~esm1
Zope1 product
Zopefoundation1 product

5 vendors · 5 products

References

8 links