Task-level block rules do not constrain sandbox egress, so a deny rule is bypassable by Bash in the default mode

Aperta
#802 4 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@00xcyd ci sta già lavorando.

Dal 2/12/2026.

  • #821 di @00xcyd — aperta

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
docker, go

Direzione di ricerca

Start with server/sandbox.go and sandbox/policy.go, then trace how SandboxRunInfo reaches the ARTEX_* container environment and artex-egress-proxy. Read the gate contract in intercept/target_gate_pg_test.go and check how sandbox WebFetch handles URLs and redirects. Done means block rules consistently deny matching sandbox egress, including when a host is also allowed, with the chosen behavior documented in the changelog.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug P1

Problem

A task-level block (deny) rule is evaluated in two places: the target gate (intercept/target_gate.go) and asset insertion (db/asset_intercept_match.go). Neither sees the traffic of a sandboxed worker, and the sandbox egress policy does not read block rules at all.

With ARTEX_SANDBOX=required (the default since 0.7.1), Bash runs in artex-worker, whose network is enforced by artex-egress-proxy against sandbox.EgressPolicy. That policy is an allowlist only:

  • sandbox/policy.go:129 — EgressPolicy has Domains and CIDRs; there is no deny list field.
  • server/sandbox.go:66-155 — taskSandboxRunInfo builds that list from task_scope rows with approved_by_operator = true, frozen company grants (task_scope_egress), and task_intercept_rules where action='allow'. Block rules are never read.

Impact

A task-level deny rule does not stop a worker curl/python/nmap to any host the task already has in scope. Operators reasonably read the rule editor as an enforcement control — the same reading the UI now invites by putting the target gate next to it.

Concretely: task scope approves example.com; an operator adds a block rule for admin.example.com; the planner's worker fetches it with curl and the rule never fires. Only the target gate would stop it, and the gate never sees the socket.

Proposal (needs a design decision, not a quick patch)

  1. Read task_intercept_rules with action='block' in taskSandboxRunInfo and propagate them as a deny list through SandboxRunInfo → EgressPolicy → ARTEX_* container env → artex-egress-proxy, matching the existing "block wins over allow" order documented for the gate.
  2. Decide the semantics for a pattern that is both allowed (scope/company) and blocked (rule): block should win, as it does at the gate.
  3. Decide whether the deny list also applies to WebFetch in sandbox mode, which currently enforces EgressPolicy per URL and redirect hop — it should, for consistency.
  4. Migration/behaviour note: this narrows egress for existing tasks that carry block rules today; that is the intent, but it belongs in the changelog as a security fix.

Related

The gate's own contract is documented in intercept/target_gate_pg_test.go ("Task allow rules play no role in the gate: they neither satisfy it nor restrict it. Block rules, global and of the task, always win."), which is the behaviour the sandbox path should mirror.

Lingua principale
Go
Stelle
18.7k
Fork
7k
Merge medio
10h 57m
PR unite (30g)
494

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di BaaRai/ARTEX

Tutte le issue di BaaRai/ARTEX

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.