MVP-0.4 · Stop executing untrusted customer code (clippy, repo eslint, package managers, Nix) #257

Closed
opened 2026-09-20 20:16:03 +00:00 by sharang · 0 comments
Owner

Goal

Untrusted customer code runs as root with every secret in the environment: clippy build scripts, the repository's own eslint binary, npm install scripts and the Nix build with sandbox=false. The MVP decision is that this is off in production — firmware builds belong to Firmwerk, and these capabilities return later as sandboxed Werkbank jobs.

What to change

  • A production flag disables pipeline/lint/clippy.rs and lint/eslint.rs (which executes the repo's own node_modules/.bin).
  • Disable npm install, cargo generate-lockfile and cargo metadata in pipeline/sbom/mod.rs:57,112,141. Read lockfiles only, or use --ignore-scripts.
  • Disable the firmware Nix build in pipeline/firmware_sbom.rs / orchestrator.rs:1001-1036. Keep firmwerk_core detect.
  • Every remaining subprocess gets env_clear() plus a PATH/HOME allowlist, kill_on_drop(true) and a timeout.

Acceptance

  • With PW_FEATURES=source_only / APP_ENV=production, no scan stage executes code from the customer repository; the affected stages report skipped with a reason instead of failing the run.
  • SBOM extraction works from lockfiles alone on the demo targets, with the golden baselines unchanged or updated deliberately.
  • No subprocess inherits the agent environment: a test asserts env_clear() and the allowlist.
  • Every subprocess has a timeout and kill_on_drop(true); no orphaned child survives a cancelled scan.
  • Nix is not invoked at all on the production path (image change tracked in MVP-0.8).
## Goal Untrusted customer code runs as root with every secret in the environment: clippy build scripts, the repository's own eslint binary, `npm install` scripts and the Nix build with `sandbox=false`. The MVP decision is that this is **off in production** — firmware builds belong to Firmwerk, and these capabilities return later as sandboxed Werkbank jobs. ## What to change - A production flag disables `pipeline/lint/clippy.rs` and `lint/eslint.rs` (which executes the repo's own `node_modules/.bin`). - Disable `npm install`, `cargo generate-lockfile` and `cargo metadata` in `pipeline/sbom/mod.rs:57,112,141`. Read lockfiles only, or use `--ignore-scripts`. - Disable the firmware Nix build in `pipeline/firmware_sbom.rs` / `orchestrator.rs:1001-1036`. Keep `firmwerk_core` *detect*. - Every remaining subprocess gets `env_clear()` plus a PATH/HOME allowlist, `kill_on_drop(true)` and a timeout. ## Acceptance - [ ] With `PW_FEATURES=source_only` / `APP_ENV=production`, no scan stage executes code from the customer repository; the affected stages report `skipped` with a reason instead of failing the run. - [ ] SBOM extraction works from lockfiles alone on the demo targets, with the golden baselines unchanged or updated deliberately. - [ ] No subprocess inherits the agent environment: a test asserts `env_clear()` and the allowlist. - [ ] Every subprocess has a timeout and `kill_on_drop(true)`; no orphaned child survives a cancelled scan. - [ ] Nix is not invoked at all on the production path (image change tracked in MVP-0.8).
sharang added this to the Production MVP milestone 2026-09-20 20:16:03 +00:00
sharang added the criticalsecurity labels 2026-09-20 20:16:03 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: platform/pruefwerk#257