Skip to content

fix(security): sandbox RLM REPL exec — CRITICAL prompt-injection RCE - #10

Open
zenprocess wants to merge 1 commit into
mainfrom
fix/rlm-repl-sandbox-rce
Open

fix(security): sandbox RLM REPL exec — CRITICAL prompt-injection RCE#10
zenprocess wants to merge 1 commit into
mainfrom
fix/rlm-repl-sandbox-rce

Conversation

@zenprocess

Copy link
Copy Markdown
Owner

CRITICAL (found by the cal adversarial N-reviewer harness, 3/3 majority-verify).

vendor/rlm_repl/sandbox.py exec()'d LLM-authored Python with unrestricted __builtins__ on untrusted session-transcript content. The friction pass runs on transcripts >=10MB during default afterburn discover; an attacker planting a repl block (import os; os.system(...)) in a transcript message got RCE / secret exfil on the developer's machine merely by analyzing a session.

Defense in depth: (1) safe-builtins allowlist, no import/open/eval/exec/getattr; (2) AST pre-check rejecting imports, dunder-attribute escapes, forbidden names; (3) opt-in gate AFTERBURN_ENABLE_RLM_EXEC — default discover skips model-authored exec with a warning. 24 new tests; full suite 108 green.

vendor/rlm_repl/sandbox.py exec()'d LLM-authored Python with unrestricted
__builtins__ on untrusted session-transcript content — an attacker planting
a repl block in a transcript got RCE on the developer's machine merely by
running `afterburn discover`. Defense in depth:
- safe-builtins allowlist (~50 names; no __import__/open/eval/exec/compile/getattr)
- AST check rejecting imports, dunder-attribute escapes (().__class__.__bases__...), forbidden names
- opt-in gate AFTERBURN_ENABLE_RLM_EXEC; default discover SKIPS model-authored exec with a warning
- 24 tests: blocks import os/__import__/open/subclasses-escape/eval/exec/globals; benign analysis still works
Found by the cal adversarial N-reviewer harness (3/3 majority-verify).
@sonarqubecloud

sonarqubecloud Bot commented Jul 3, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant