Hoch

RestrictedPython vulnerable to arbitrary code execution via stack frame sandbox escape

  • Veröffentlicht: 10.07.2023
  • Aktualisiert: 11.10.2026 15:17

Impact

RestrictedPython does not check access to stack frames and their attributes. Stack frames are accessible within at least generators and generator expressions, which are allowed inside RestrictedPython. An attacker with access to a RestrictedPython environment can write code that gets the current stack frame in a generator and then walk the stack all the way beyond the RestrictedPython invocation boundary, thus breaking out of the restricted scope allowing the call of unrestricted Python code and therefore potentially allowing arbitrary code execution in the Python interpreter.

All RestrictedPython deployments that allow untrusted users to write Python code in the RestrictedPython environment are at risk. In terms of Zope and Plone, this would mean deployments where the administrator allows untrusted users to create and/or edit objects of type Script (Python), DTML Method, DTML Document or Zope Page Template. This is a non-default configuration and likely to be extremely rare.

Patches

The problem has been fixed in releases 5.3 and 6.1.

Workarounds

There is no workaround available. If you cannot upgrade to the latest release you should ensure the RestrictedPython environment is only available for trusted users.

References

For more information

If you have any questions or comments about this advisory:

Credits

Thanks for analysing and reporting the go to:

  • Nakul Choudhary (Quasar0147 on GitHub)
  • despawningbone on GitHub
  • Robert Xiao (nneonneo on GitHub)

Betroffene Software

Klicken Sie auf eine Technologie, um alle zugehörigen Schwachstellen anzuzeigen.

PlattformPaketAnfällige VersionenBehoben in
Python (PyPI) restrictedpython < 5.3, >= 6.0a1.dev0, < 6.1, < 5.3 5.3, 6.1

Verweise

CVSS-Wert 8.4/10
CVSS-Vektor
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:L
Schwäche (CWE)
CWE-913
Plattform
Python (PyPI)
Paket
restrictedpython
Veröffentlicht
10.07.2023
Aktualisiert
11.10.2026 15:17

Quellen und Lizenzen

OSV / GitHub Advisory Database - PYSEC-2023-118 - PyPA Advisory Database; CC BY 4.0

OSV / GitHub Advisory Database - GHSA-wqc8-x2pr-7jqh - CC BY 4.0

Schwachstellenhistorie: restrictedpython

Alle veröffentlichten Schwachstellen dieses Pakets (Python (PyPI)), neueste zuerst. Zeigt, ob es ein einmaliger Ausrutscher ist oder ein Paket, das man im Auge behalten muss.

Einträge insgesamt
6
Erste → letzte
07.2023 09.2026
Ohne Fix
0
In Angriffen ausgenutzt
0

Verteilung nach Schweregrad

  • Hoch 6

Veröffentlichungen pro Jahr

  1. 2023: 2
  2. 2024: 1
  3. 2025: 1
  4. 2026: 2
  1. Hoch · 8.3 CVE-2023-41039 < 5.4, >= 6.0, < 6.2 5.4, 6.2
  2. RestrictedPython vulnerable to arbitrary code execution via stack frame sandbox escape dieser Eintrag
    Hoch · 8.4 CVE-2023-37271 < 5.3, >= 6.0a1.dev0, < 6.1, < 5.3 5.3, 6.1

Erkennen Sie Schwachstellen in Ihrer Anwendung

Mit der DockRay-Integration und aktivierter Softwareinventarisierung prüft DockRay gemeldete Komponentenversionen auf bekannte Schwachstellen und benachrichtigt Sie über bestätigte Treffer. Die Abdeckung hängt von der unterstützten Technologie und den verfügbaren Meldungen ab.

Anwendung verbinden
DockRay Newsletter

Anwendungssicherheit in Ihrem Postfach

Wichtige Schwachstellen, konkrete Empfehlungen und praktische Tipps für Ihre Anwendungen. Wählen Sie Ihre Technologien und verfolgen Sie, was für Ihr Projekt relevant ist.

  • Eine tägliche Zusammenfassung neuer Schwachstellen, auch kritischer.
  • Benachrichtigungen über wichtige Updates.
  • Praktische Tipps zur Sicherheit und Überwachung von Anwendungen.

Leer lassen, um Meldungen zu allen Technologien zu erhalten.

Kostenlos anmelden. In jeder E-Mail mit einem Klick abmelden.