Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. RestrictedPython
  4. ›
  5. CVE-2023-41039

CVE-2023-41039: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')

August 30, 2023

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 is 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.

References

  • github.com/advisories/GHSA-xjw2-6jm9-rf67
  • github.com/zopefoundation/RestrictedPython/commit/4134aedcff17c977da7717693ed89ce56d54c120
  • github.com/zopefoundation/RestrictedPython/security/advisories/GHSA-xjw2-6jm9-rf67
  • nvd.nist.gov/vuln/detail/CVE-2023-41039

Code Behaviors & Features

Detect and mitigate CVE-2023-41039 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions up to 5.3, all versions starting from 6.0 up to 6.1

Fixed versions

  • 5.4
  • 6.2

Solution

Upgrade to versions 5.4, 6.2 or above.

Impact 7.7 HIGH

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N

Learn more about CVSS

Weakness

  • CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')

Source file

pypi/RestrictedPython/CVE-2023-41039.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:15:33 +0000.