Open actionable advisories and recorded vendor fixes. This public package view has no inventory attached and cannot establish whether your deployment is affected. A vendor fix never resolves your finding; verify your installed version and the source guidance.
Open advisories
6 actionable advisories, newest first. Withdrawn advisories and news are excluded. Coverage is partial.
Impact RestrictedPython could allow a sandbox escape when a policy exposes the standard library string module, or otherwise exposes string.Formatter, to restricted code. string.Formatter field resolution methods such as getfield can perform attribute and item traversal internally and return live object references. This can bypass RestrictedPython's normal attribute guards and may allow access to sensitive objects such as function globals, builtins, file access, or code execution primitives. Users are impacted if they run untrusted code with RestrictedPython and expose string.Formatter, directly or indirectly, for example through a custom import policy or globals. Patches The problem has been patched by blocking access to string.Formatter and unsafe string.Formatter traversal methods in safergetattr. Users should upgrade to the patched release once available. Affected and patched version numbers should be filled in when the release is published. Workarounds Do not expose the standard…
Recommended action: Upgrade to 8.4 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.
Impact RestrictedPython rewrites sensitive operations to go through guard hooks. Attribute access becomes getattr(obj, name), item access becomes getitem(obj, key), writes go through write, and print goes through print. The embedding application supplies these hooks to enforce its policy. Argument-name validation rejects these protected names for regular arguments, args, kwargs, and keyword-only arguments, but it misses positional-only arguments (the ones before /). So a function like: makes getattr a local that shadows the policy hook, and the rewritten access calls evil instead. The same works for getitem, write, and print. Shadowing print can also be used to capture the internal getattr hook that RestrictedPython passes in. The result is that sandboxed code can bypass the access policy the embedding application relies on. In applications that also handle sandbox-controlled objects unsafely (for example serializing them with pickle), this primitive can be chained further, up to…
Recommended action: Upgrade to 8.3 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.
Impact Via a type confusion bug in the CPython interpreter when using try/except RestrictedPython could be bypassed. We believe this should be fixed upstream in Python itself until that we remove support for try/except from RestrictedPython. (It has been fixed for some Python versions.) Patches Patched in version 8.0 by removing support for try/except clauses Workarounds There is no workaround. References none
Recommended action: Upgrade to 8.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.
Impact A user can gain access to protected (and potentially sensible) information indirectly via AttributeError.obj and the string module. Patches The problem will be fixed in version 7.3. Workarounds If the application does not require access to the module string, it can remove it from RestrictedPython.Utilities.utilitybuiltins or otherwise do not make it available in the restricted execution environment.
Recommended action: Upgrade to 7.3 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.
Impact 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 formatmap methods of str (and unicode) (accessed either via the class or its instances) and via string.Formatter. All known versions of RestrictedPython are vulnerable. Patches The issue will be fixed in 5.4 and 6.2. Workarounds There are no workarounds to fix the issue without upgrading. References https://docs.python.org/3/library/stdtypes.html#str.formatmap http://lucumr.pocoo.org/2016/12/29/careful-with-str-format/ https://www.exploit-db.com/exploits/51580 For more information If you have any questions or comments about this advisory: Open an issue in the RestrictedPython issue tracker Email us at security@plone.org Credits Thanks for analysing and reporting…
Recommended action: Upgrade to 6.2 or 5.4 by release line, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.
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.…
Recommended action: Upgrade to 6.1 or 5.3 by release line, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.