Skip to main content

Threat Intelligence Database

Comprehensive database of the latest cyber threats affecting organizations worldwide. Filter and search to find specific threat intelligence relevant to your organization.

Pro Console Lifetime

Stop chasing alerts. Route them.

Start free, then upgrade once to turn Radar into an automated delivery engine for your security stack.

Custom feeds / Automations: email, Slack, webhooks, SIEM/MISP / API access (baseline limits)

View Plans & Pricing

API access activates after upgrading in Console -> Billing.

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now

Filter Threats

Narrow down the results by type, severity, or affected countries

Search threats by title, CVE ID, or description. Maximum 100 characters.
Active filters (1):Package: pkg:pypi/restrictedpython

Threat Intelligence

Click on any threat for detailed analysis and mitigation recommendations

CVE-2026-76825 is a high-severity vulnerability in zopefoundation's RestrictedPython prior to version 8.4. The issue allows restricted code to escape the sandbox by exploiting the string.Formatter class and its methods, which bypass RestrictedPython's attribute access protections. This can lead to unauthorized access to function globals, builtins, file access, or code execution primitives, impacting confidentiality, integrity, and availability. The vulnerability is fixed in version 8.4.

Join the discussion

### 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: ```python 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. ### Proof of concept On an unpatched RestrictedPython this prints `shadowed` and an empty `calls` list, meaning the policy `_getattr_` never ran. With the fix, `compile_restricted` rejects the code. ```python from RestrictedPython import compile_restricted from RestrictedPython.Guards import safe_globals, safer_getattr calls = [] def policy_getattr(obj, name, default=None): calls.append(name) # the real guard records every access return safer_getattr(obj, name, default) src = """ def f(o, _getattr_=lambda obj, name: "shadowed", /): return o.x """ code = compile_restricted(src, "<s>", "exec") # currently compiles, should be rejected g = dict(safe_globals) g["_getattr_"] = policy_getattr exec(code, g) class O: x = "secret" print(g["f"](O())) # -> "shadowed" (attacker's local was used) print(calls) # -> [] (policy _getattr_ never ran) ``` ### Patches The fix validates positional-only argument names the same way the other argument kinds are already validated. It will ship in the next release. ### Workarounds None other than upgrading. If you cannot upgrade immediately, reject any submitted code whose function or lambda definitions use positional-only parameters with leading-underscore names before compiling.

Join the discussion

Showing 1 to 2 of 2 results

Filters:Package: pkg:pypi/restrictedpython
Page 1 of 1
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses