Loading advisory.
Loading advisory.
RestrictedPython vulnerable to arbitrary code execution via stack frame sandbox escape
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.
Published 2023-07-10 21:53 UTC · Modified 2026-09-10 03:49 UTC
Severity and EPSS are shown separately. Helm does not combine them into one score. How tiers work
| Package | Ecosystem | Affected | Fixed in | Upgrade command |
|---|---|---|---|---|
| restrictedpython | PyPI | < 5.3 >= 6.0a1.dev0, < 6.1 git commits in https://github.com/zopefoundation/RestrictedPython: < c8eca66ae49081f0016d2e1f094c3d72095ef531 versions 3.4.2, 3.4.3, 3.5.0, 3.5.1, 3.5.2, 3.6.0, 3.6.0a1, 4.0, 4.0a1, 4.0a2, 4.0a3, 4.0b1, 4.0b2, 4.0b3, 4.0b4, 4.0b5, 4.0b6, 4.0b7, 4.0b8, 5.0 and 6 more | 5.3, 6.1, c8eca66ae49081f0016d2e1f094c3d72095ef531 | pip install --upgrade 'restrictedpython>=5.3'pip install --upgrade 'restrictedpython>=6.1'pip install --upgrade 'restrictedpython>=c8eca66ae49081f0016d2e1f094c3d72095ef531' |
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.
The problem has been fixed in releases 5.3 and 6.1.
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.
If you have any questions or comments about this advisory:
Open an issue in the RestrictedPython issue tracker
Email us at security@plone.org
Thanks for analysing and reporting the go to:
Nakul Choudhary (Quasar0147 on GitHub)
despawningbone on GitHub
Robert Xiao (nneonneo on GitHub)
No public exploit code known to Helm's sources (Nuclei templates, Metasploit, Exploit-DB and PoC-in-GitHub). That does not mean none exists.
EPSS went from 0.008 on 2026-11-24 to 0.011 on 2026-11-26, over 2 recorded scores.
| Date | Score | Previous | Model |
|---|---|---|---|
| 2026-11-24 | 0.008 | first score | v2026.06.15 |
| 2026-11-26 | 0.011 | 0.008 | v2026.06.15 |