# Sandbox escape via incomplete blocklist

Blocklists guarding sandboxes that miss traversal, frame, or constructor paths, or that only hook getattr()

_Area: Web injection and code execution. Seen in 2 disclosed reports; latest 2026-08-04. Updated 2026-11-09._

## How it works
A sandbox tries to stop dangerous operations by naming what is forbidden: attribute names, library functions, URL parts. The assumption that breaks is that the list is complete and that the check cannot be routed around. Two gaps recur: the list is a subset of the real attack surface (missing frame-traversal or constructor attributes), and the enforcement point only covers one access syntax (a `getattr()` hook that dot-notation attribute access never touches). A third gap is a validator that accepts input the downstream code treats as code: `new URL()` ignores the hash fragment, so a hash carrying JS is interpolated into sandboxed source [E1](https://bugbountylibrary.com/r/ghsa%3AGHSA-wg86-r78f-74mp.md). A patched library inside the sandbox can also be the escape: moment's locale path-traversal fix calls `name.match()`, and a crafted String with an overridden `match()` defeats it [E1](https://bugbountylibrary.com/r/ghsa%3AGHSA-wg86-r78f-74mp.md).

## Where it shows up
- Two parallel blocklists for the same protection (direct mode vs subprocess wrapper); the shorter one is the hole [E3](https://bugbountylibrary.com/r/ghsa%3AGHSA-qf73-2hrx-xprp.md)
- `_safe_getattr`-style hooks that intercept `getattr()` but not `obj.attr` [E3](https://bugbountylibrary.com/r/ghsa%3AGHSA-qf73-2hrx-xprp.md)
- Blocklists missing `__traceback__`, `tb_frame`, `f_back`, `f_builtins` [E3](https://bugbountylibrary.com/r/ghsa%3AGHSA-qf73-2hrx-xprp.md)
- URL validation via `new URL()` followed by string interpolation into generated code [E1](https://bugbountylibrary.com/r/ghsa%3AGHSA-wg86-r78f-74mp.md)
- Sandboxed libraries with their own path-traversal patches that call methods on attacker-supplied objects [E1](https://bugbountylibrary.com/r/ghsa%3AGHSA-wg86-r78f-74mp.md)
- Template/attribute evaluators that `eval` a user-controlled attribute value [E2](https://bugbountylibrary.com/r/blog%3Agithub-com-sudistark-bb-writeups-blob-main-2023-cve-2023-33733-rce-via-htmli-in-reportlab-md.md)
- Nodes or call sites still passing `useSandbox:false` [E1](https://bugbountylibrary.com/r/ghsa%3AGHSA-wg86-r78f-74mp.md)

## How to review
Find every enforcement point and ask what syntax or path it does not cover. The invariant: the sandbox must deny by construction (no reachable reference to real builtins, frames, or the host), not by enumerating names. Concretely: diff any two blocklists for the same protection and treat the weaker as the real boundary [E3](https://bugbountylibrary.com/r/ghsa%3AGHSA-qf73-2hrx-xprp.md); confirm attribute access is blocked for dot notation, not just `getattr()` [E3](https://bugbountylibrary.com/r/ghsa%3AGHSA-qf73-2hrx-xprp.md); confirm validators reject or neutralize every part of the input that reaches code generation, including fragments [E1](https://bugbountylibrary.com/r/ghsa%3AGHSA-wg86-r78f-74mp.md); confirm a patched library's fix does not dispatch through methods an attacker can override [E1](https://bugbountylibrary.com/r/ghsa%3AGHSA-wg86-r78f-74mp.md); confirm no path disables the sandbox [E1](https://bugbountylibrary.com/r/ghsa%3AGHSA-wg86-r78f-74mp.md).

## How finders spotted it
- Noted vm2 was deprecated and that some nodes set `useSandbox:false`, then read `isValidURL` and saw `new URL()` accepts arbitrary hash content that is interpolated into code [E1](https://bugbountylibrary.com/r/ghsa%3AGHSA-wg86-r78f-74mp.md)
- Recalled that moment's CVE-2022-24785 patch relies on `name.match()`, controllable on a String object [E1](https://bugbountylibrary.com/r/ghsa%3AGHSA-wg86-r78f-74mp.md)
- Compared the two `blocked_attrs` sets, saw the subprocess list was a strict subset missing frame-traversal names, and observed `_safe_getattr` only hooks `getattr()` [E3](https://bugbountylibrary.com/r/ghsa%3AGHSA-qf73-2hrx-xprp.md)
- Fingerprinted the rendering library by injecting HTML into a comment field and reading verbose parser errors (`invalid attribute name ... attrMap=[...]`), matched the string to ReportLab source, then tested the known CVE [E2](https://bugbountylibrary.com/r/blog%3Agithub-com-sudistark-bb-writeups-blob-main-2023-cve-2023-33733-rce-via-htmli-in-reportlab-md.md)
- Diagnosed a missing pingback by switching from curl to Python requests [E2](https://bugbountylibrary.com/r/blog%3Agithub-com-sudistark-bb-writeups-blob-main-2023-cve-2023-33733-rce-via-htmli-in-reportlab-md.md)

## Variants seen
- URL-validator gap feeding JS interpolation into a vm2 sandbox, escaping via a patched library [E1](https://bugbountylibrary.com/r/ghsa%3AGHSA-wg86-r78f-74mp.md)
- Subprocess sandbox with a truncated attribute blocklist plus a getattr-only hook, escaped via exception frame traversal [E3](https://bugbountylibrary.com/r/ghsa%3AGHSA-qf73-2hrx-xprp.md)
- Template attribute evaluator that evals user input, escaped via a known sandbox-bypass payload [E2](https://bugbountylibrary.com/r/blog%3Agithub-com-sudistark-bb-writeups-blob-main-2023-cve-2023-33733-rce-via-htmli-in-reportlab-md.md)

## Impact and severity
All three reached arbitrary code execution. E1 chained broken URL validation, JS injection, locale path traversal, vm2 escape and file require into RCE [E1](https://bugbountylibrary.com/r/ghsa%3AGHSA-wg86-r78f-74mp.md). E2 escalated RCE to cloud metadata and service-account token theft [E2](https://bugbountylibrary.com/r/blog%3Agithub-com-sudistark-bb-writeups-blob-main-2023-cve-2023-33733-rce-via-htmli-in-reportlab-md.md). E3 reached real builtins and ran shell commands, bypassing AST blocklist, getattr hook and exec-by-name checks at once [E3](https://bugbountylibrary.com/r/ghsa%3AGHSA-qf73-2hrx-xprp.md). Severity rises with reach: sandbox escape plus cloud metadata access turns web input into credential compromise [E2](https://bugbountylibrary.com/r/blog%3Agithub-com-sudistark-bb-writeups-blob-main-2023-cve-2023-33733-rce-via-htmli-in-reportlab-md.md).

## Seen in real software
Open-source packages and projects, and products, where this pattern was found. If the target runs one, compare the version it runs with the fix.
- **flowise (npm)** <= 3.1.2, fixed in 3.1.3: Flowise Sandbox Escape to RCE (CVE-2026-69253). Report: https://bugbountylibrary.com/r/ghsa%3AGHSA-wg86-r78f-74mp.md. Fix: https://github.com/FlowiseAI/Flowise/commit/3f257bdc8196082a178da7134a075824401b13b9
- **praisonaiagents (pip)** <= 1.5.114, fixed in 1.5.115: PraisonAI has sandbox escape via exception frame traversal in `execute_code` (subprocess mode) (CVE-2026-39888). Report: https://bugbountylibrary.com/r/ghsa%3AGHSA-qf73-2hrx-xprp.md

## Evidence
- E1: https://bugbountylibrary.com/r/ghsa%3AGHSA-wg86-r78f-74mp.md
- E2: https://bugbountylibrary.com/r/blog%3Agithub-com-sudistark-bb-writeups-blob-main-2023-cve-2023-33733-rce-via-htmli-in-reportlab-md.md
- E3: https://bugbountylibrary.com/r/ghsa%3AGHSA-qf73-2hrx-xprp.md
