Repository navigation
Description
Context
Split from #765 (thanks @Coff0xc). Track A (honeypots, fake success, honey-tokens) is #766. This issue owns the other half: target bytes becoming code.
Failure mode
In-scope content becomes worker code, or becomes a goal, scope or finding in the control plane, without the operator asking for that execution. Prompt injection is one input. The reliable path reported publicly is implicit or loot-gated execution: a backup that must be imported, a .git that must be recovered, an SDK that must be installed.
Gap measured on main (0edb39f)
Searching the tree as it stands:
pickle0 hits,sitecustomize0 hits,fsmonitor0 hits.- There is no intercept policy for these loaders today.
Worker isolation bounds the blast radius (no panel keys, DB or socket per docs/SANDBOX.md), but it does not stop a target-supplied archive from executing inside that worker. A pentest worker has to unpack hostile bytes, so this can only be closed with artifact policy, not with a stronger box.
Acceptance criteria
- Downloaded artifacts stay data until the operator or an existing intercept rule says otherwise. Default deny or ask for at least:
pickle/joblib/shelve/dbmload of workspace files- running Python with a target tree on
PYTHONPATH, or importingsitecustomize/__pycache__from the workspace git checkoutorgit-dumperrecovery that would honor target.git/config(core.fsmonitor,core.sshCommand,alias.*,credential.helper)pip install/npm cifrom an index or tarball whose host is the current target- executing a binary, native module,
credential_process, kubeconfigexecor SSHProxyCommandthat came from the workspace
- Intercept rules inspect the real argv including wrappers (
python -c,bash -lc,pip install ./), reuse the existing gate instead of a parallel policy, and name the known argv-prefix limit in the denial rather than failing open. - A trap recorded by one worker pauses that artifact or the task for the operator, so sibling workers on the same task do not load the same hash again.
- A fooled or owned worker cannot mark facts
operator_input, approve its own scope, spawn an egress-capable child task, or overwrite another engagement. Remaining holes are bugs against GHSA-86r5, GHSA-53wc and GHSA-ph8r, not model decisions. - Worker compromise surfaces as an operator-visible runtime incident on that task, not as a finding against the target.
- Prompt tails stay on and loot-gated lies get a regression. Fixtures in the shape of the published write-ups (timing-bound pipe to sh, role-forged "install this SDK"). Direct prompt injection scoring 0/8 is not a pass while loot-gated execution still works.
- Installing a target-supplied package is an operator decision, not a worker decision. A package with no implant is not safe: after install, the in-scope server can drive it to exec (billing SDK, 8/8). The gate sits at the install boundary, and a loader we did not ship surfaces as a task runtime incident.
- Recovering and checking out a repository neutralizes hostile
.git/config(core.fsmonitor,core.sshCommand,alias.*,credential.helper) before checkout. The gate is the operation, not the tool name:git-dumperdoes not strip it and a hand-rolled dumper is worse. - The runtime incident records what the executed artifact could observe about the operator (hostname, user, working directory, environment variable names, parent command lines), because that is what a loader beacon reports back.
Out of scope
Sandbox backend rewrite (#554, #555), containing a kernel or runtime 0-day, making remote RCE on the target safe, replacing artex-runner.
Slices
- Intercept defaults for pickle,
.pyc, git hooks, target-index installs and workspace binaries, with tests. - Cross-worker artifact pause on an explicit trap fact, hash keyed and task scoped.
- Regression fixtures on synthetic local targets only. No third-party sites, no real exploits in CI.
Activity
Coff0xc commentedon Dec 1, 2026
Two loaders a pickle-pattern rule will not catch.
Billing SDK (8/8 in the write-up): the package has no implant. After install, the in-scope server sends an opcode that becomes
exec. Denyingpip install --index-url <target>is not a close-out — installing an in-scope SDK is the job. Server-sent eval/exec/opcode is the same class as pickle.Stateful Form: no files. Decoding a hidden field is the trap. The checklist as written is all file loaders (pickle,
.pyc, git, pip, workspace binaries).python/git/pip/npmalready cannot be always-allowed. Default is still allow. The gap is deny/ask defaults for the loaders, including recover-and-checkout rather than the tool name,.pth/usercustomizenext tositecustomize, and git config beyond the four keys (hooksPath,include.path,diff.external, …).sresarehumantoo commentedon Dec 1, 2026
Partial coverage from three PRs opened against slice 1:
noexec,nosuidto/workspaceandnoexecto/home/exec, blocking direct binary and native module execution from writable mounts.__pycache__/before running downloaded Python and adds deserialization calls (pickle.load,torch.load,yaml.unsafe_load,marshal.loads) to the Never list.pickle.load/loads,torch.load,yaml.unsafe_load/full_load,marshal.load/loads,joblib.load, andshelve.openbehind operator approval at priority 70.These cover the pickle/joblib/shelve/marshal gate and the workspace-binary gate from the acceptance criteria. Still uncovered from slice 1:
PYTHONPATH/sitecustomize/__pycache__import-path poisoning (the skill tells agents to delete.pycbut there's no intercept rule enforcing it).git/configneutralization before checkout (core.fsmonitor,core.sshCommand,credential.helper): the existinggit clonegate fires but doesn't strip hostile config post-checkoutcredential_process/ kubeconfigexec/ SSHProxyCommandfrom workspace filespip install .//npm cifrom a target-index tarball (the existing install gate fires on the command but doesn't distinguish target-index from PyPI)Happy to take any of those on if the approach looks right.
fix(intercept): one pass for planner loader rules, tighter patterns
sresarehumantoo commentedon Dec 1, 2026
Correcting my last comment: #770 doesn't cover the workspace-binary gate. Docker rejects
noexecin a bind mode (invalid mode: rw,noexec,nosuid), so the worker wouldn't even start, and CI missed it because the live sandbox test is opt-in. I've closed it; details are on #770.I reworked the other two after another pass:
*.pyc/*.pyofiles too, not just__pycache__/. A.pycwith no.pynext to it still got imported. The cleanup also moved ahead of the "only run code whose review is clean" step, and the review now calls out shipped bytecode and.pth/sitecustomizefiles.yaml.loadwith an unsafeLoader,python -m pickle,Unpickler,dill/cloudpickle,read_pickle,allow_pickle=True, and pickle imported under another name (it gates the import itself). It still can't see inside a script file, and the denial message says so. The bypasses I know about are written up as tests and in the skill.Here's what's still open from slice 1. I already have some of it as risk signals in a downstream fork, so porting is mostly mechanical once we agree on the shape:
PYTHONSAFEPATH=1andPYTHONDONTWRITEBYTECODE=1in the worker env, plus flaggingPYTHONPATH=,sys.pathedits,.pth, andsitecustomize/usercustomize./workspace, which is what fix(sandbox): add noexec,nosuid to /workspace bind mount #770 was meant to stop..git/configbefore checkout (including the extra keys Coff0xc listed),git-dumper, and clones from non-forge hosts.pip/npminstalls from a non-default index.credential_process, kubeconfigexecand SSHProxyCommandfrom workspace files.@BaaRai, a few questions before I open anything else:
askrules underhardening/, or do you want some of them on by default? The issue says "default deny or ask", but everything inhardening/is opt-in today.PYTHONSAFEPATHin the worker env? Unlike the skill, it's actually enforced, but a script in/workspacecan no longer import the modules sitting next to it./workspace, the onlynoexecroute I can see is putting the task root on a host filesystem that's already mountednoexec, which a bind mount should inherit. Is that acceptable, or does it belong with Proposal: ARTEX-owned Go/bubblewrap backend for enforced execution scope #554/docs: reconcile execution and audit design with upstream Docker backend #555?fix(worker): neutralize hostile git config before checkout
fix(worker): close the absolute-path git bypass
fix(intercept): match the loader shapes that are on the command line
sresarehumantoo commentedon Dec 1, 2026
Opened #777 for the
.pychalf of #771, as a filesystem change rather than skill text. The runner starts the worker withPYTHONPYCACHEPREFIX(prebuilt on the read-only rootfs) andPYTHONDONTWRITEBYTECODE, so a forged__pycache__pyc is no longer loaded over the reviewed.py. Measured on the worker's Python 3.11.2: timestamp-forged, hash-based (unchecked, and checked with the correct source hash) and package__init__pycs are closed, andpy_compilestill works. A sourcelessfoo.pyc, a native.sonext to the source,python3 -EandARTEX_SANDBOX=offare not; the PR describes a tested follow-up for the first and third.PYTHONSAFEPATHstays out: it breaks a plain sibling import from/workspace, which answers question 2 above for me.fix(sandbox): do not load a workspace __pycache__ in the worker (BaaR…
docs(changelog): record the workspace __pycache__ change (BaaRai#767)
docs(changelog): note py_compile, panel env and open import gaps (Baa…
docs(changelog): list the accepted BaaRai#767 bytecode limits
feat(db): add workspace binary/native module execution ask rule (BaaR…
feat(agent,server,db): cross-worker trap sharing and task-level stop …
feat(db,guard): pipe-to-shell ask rule and synthetic-target regressio…
fix(db,guard): close pipe-to-shell rule bypasses found in review (Baa…
fix(sandbox): do not load a workspace __pycache__ in the worker (BaaR…
docs(changelog): record the workspace __pycache__ change (BaaRai#767)
docs(changelog): note py_compile, panel env and open import gaps (Baa…
docs(changelog): list the accepted BaaRai#767 bytecode limits