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

CVE-2026-55830: RestrictedPython guard hooks can be shadowed via positional-only arguments

August 28, 2026

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:

def f(_getattr_=evil, /):
return o.x

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 remote code execution. That part depends on the embedding application, but the underlying guard bypass is in RestrictedPython.

References

  • github.com/advisories/GHSA-ffg3-p8fm-mjx2
  • github.com/zopefoundation/RestrictedPython/commit/3737596ec9f28c34a073cc845bd2f4c0a80cb671
  • github.com/zopefoundation/RestrictedPython/security/advisories/GHSA-ffg3-p8fm-mjx2
  • nvd.nist.gov/vuln/detail/CVE-2026-55830

Code Behaviors & Features

Detect and mitigate CVE-2026-55830 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 before 8.3.0

Fixed versions

  • 8.3.0

Solution

Upgrade to version 8.3.0 or above.

Impact 8.3 HIGH

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

Learn more about CVSS

Weakness

  • CWE-184: Incomplete List of Disallowed Inputs

Source file

pypi/RestrictedPython/CVE-2026-55830.yml

Spotted a mistake? Edit the file on GitLab.

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

Page generated Sat, 29 Aug 2026 00:18:16 +0000.