Skip to main content
Date: 2026-08-21 · Auditor: Claude Opus (in-family adversarial audit + fuzzing) · Target: v0.4.0 and unreleased main · Records: findings and disposition only. AUDIT.md is the full pre-publication audit narrative and is not superseded by this document; this is a dated follow-up review, not a replacement.

Threat model

Same boundary SECURITY.md already states, read again from an attacker’s seat rather than a reader’s: In scope. A malicious caller, malicious executed code, or adversarial tool input that:
  • escapes the sandbox to run code outside the executor’s constraints,
  • reads or writes host files outside the session workspace or the 23-entry env allowlist,
  • reaches the network when no_net was requested and believed enforced,
  • or — the class this audit spent the most time on — makes the server report a guarantee it did not apply. A false unenforced: [] is in scope even where no data actually left the machine, because the caller has no way to tell the difference from the result alone.
Out of scope, deliberately. codecalc is documented as a single-operator, local, stdio-only tool (SECURITY.md). This audit did not test multi-tenant isolation, did not assume a hostile co-tenant sharing the same server process, and did not treat same-uid resource exhaustion as a finding — both are already named as out of scope by the project’s own threat model, and testing against a boundary the software never claimed to have would not have produced an actionable finding.

Method

Two passes, not one:
  1. Read. Every surface below, source plus its own docstrings/comments, checking each claim a comment or docstring makes against what the code actually does — the same discipline AUDIT.md and the fuzz campaign already established for this repo (a docstring that asserts a mitigation is a claim, and claims get checked, not trusted).
  2. Live adversarial probes. Where a claim was checkable by running code through the real sandbox — Rust backend, native binary, no_net shim loaded — it was run, not reasoned about. E-1 traces to exactly such a probe: a no_net result that returned a different answer than the unenforced field beside it promised. N-2 was found the other way, by reading — a write-path docstring that contradicted the read-path one — and its parent-directory TOCTOU residual is accepted from the code’s structure (final-component O_NOFOLLOW only), not demonstrated by a live exploit.
This was not a cross-vendor review. A Codex pass was attempted and declined by Codex’s own cybersecurity content filter before it could examine the sandbox code at all — the request itself (executing untrusted code, bypassing a network block) reads as the thing the filter exists to catch, so this repo cannot currently get a Codex second opinion on its own security surface. See Residuals below; that gap is an owner action, not something this audit could route around from inside a single vendor’s models.

Surfaces reviewed

Six, chosen as the boundaries between a caller/executed-code and something that matters if crossed:
  1. Parse screen (safe_expr.py, logic.py, linalg.py) — the denylist between a caller’s expression string and SymPy’s parse_expr.
  2. Session jail (sessions.py) — path confinement, symlink handling, quotas, and workspace cleanup for stateful sessions.
  3. Executor (executor.py, executor/src/*.rs) — env allowlist, rlimits, process-group kill, no_net, and result-shape parity between the Rust and Python-fallback backends.
  4. Packages (packages.py) — install_package’s argv construction and fail-closed behaviour when a manager cannot be confined.
  5. HTTP transport (server.py, mcp_middleware.py) — DNS-rebinding protection, token auth, and the request/response size guard on serve-http.
  6. Info leaks (errors.py, audit.py, pydantic validation) — whether an error path, an audit log entry, or a validation failure echoes something it should not (a raw argument value, a host path, a secret).

Findings

What held

Per surface, what was probed and did not break:
  • Parse screen. No RCE reachable through safe_expr/logic.truth_table/ SymPy parse_expr in this pass — CRITICAL-01’s dunder-chain class stays closed (tests/test_security.py still asserts it live). safe_global_dict() has no Python builtins in it, verified by inspection and by probing for an evaluator reachable through the exposed SymPy namespace; none was found. Cost bounds (MAX_SYMBOLIC_EXPONENT, MAX_NUMERIC_DIGITS, the variable-count and expression-length caps) fired on the inputs built to trip them.
  • Session jail. No escape found: the component-wise is_relative_to boundary check held against sibling-directory and symlink probes; _jail’s length/segment caps held against the fuzz-shaped DoS inputs surfaced; quota accounting and workspace cleanup (_rmtree_checked, identity-checked against a swapped directory) held.
  • Executor. Env-drop (the 23-entry allowlist), rlimits (CPU/memory/output/ process-count), process-group kill on timeout, and workdir-identity cleanup all held under adversarial probes — except no_net, which is E-1 above. Every other ceiling that claims enforcement on this platform (test_platform_contract.py’s “anything NOT reported unenforced must actually bite” half) still bites.
  • Packages. install_package still passes package strings as argv only, never through a shell, and still fails closed rather than silently degrading when a manager cannot be confined (Landlock unavailable, or a platform with no equivalent).
  • HTTP. DNS-rebinding protection (loopback allowlist vs. a spoofed Host header), token auth, and the request/response size guard on serve-http all held against the probes built against them.
  • Info leaks. pydantic validation errors no longer echo a caller’s raw argument value (#212b) and still hold; audit-log entries and error paths probed for this audit did not surface a host path, secret, or argument value that the existing redaction should have caught.

Residuals for the owner

Nothing here is new — each is already named in SECURITY.md or AUDIT.md’s own residual-risk sections — restated because this audit specifically re-checked each one rather than assuming it still held:
  1. No true network isolation without a container/microVM. no_net (post-E-1) now says so honestly; it was never meant to be more than a speed bump. Real isolation is --network=none or gVisor/Firecracker, not a symbol shim, on any platform. Update 2026-08-21: narrower than stated above for Linux specifically — a seccomp-bpf filter now enforces no_net there in-kernel (the socket syscall itself is refused, not just the symbol), so this residual is now a macOS/no-seccomp-fallback statement rather than a universal one. The container/microVM caveat still holds everywhere for isolation beyond no_net alone (filesystem, other same-uid processes, etc.).
  2. Same-uid execution. rlimits constrain, they do not sandbox a hostile program away from other files this user can read. Full isolation needs containers or a VM — out of scope for the tool as documented, in scope the moment anyone points it at multi-tenant or internet-facing traffic.
  3. No independent third-party review. This audit and its fuzzing-campaign predecessor are both Claude-family (in-house). The attempted cross-vendor Codex pass was blocked by Codex’s own content filter before it could examine sandbox code at all (see Method) — a genuinely independent security review (a firm, or an external maintainer with no relationship to this codebase’s own model family) has not happened and remains an owner action, not something addressable from inside this audit.
  4. No external maintainer. Single-maintainer project (SECURITY.md already says so for response-time expectations); a second set of eyes with commit access and no stake in any given PR would catch a different class of thing than either this audit or a fuzz campaign can.

What this document is not

Not a certification, not a warranty, and not independent of the codebase it reviews — an in-family model auditing a project whose threat model centers on “a model executes code here” carries the same limitation AUDIT.md already names for its own author. Weigh it accordingly, same instruction SECURITY.md gives for AUDIT.md itself.