security: disable jpkg env shell bridge
ober
21824d0a2f3520f73e0db60bf3dc5a6c0dc461ae
--- a/docs/kimi3-security-recommmendations.md +++ b/docs/kimi3-security-recommmendations.md @@ -1140,7 +1140,9 @@ fix must add its scanner rule in the same commit (write it into no longer constructs a shell `wait` command. The retired `(jerboa registry)` compatibility surface now creates registry directories without shelling out and fails closed for legacy mutable Git uninstalls instead of constructing an - `rm -rf` command. + `rm -rf` command. `jpkg env -- COMMAND` is disabled until the package CLI has + an argv exec/status API, removing the last shell-concatenation path from + `(std pkg commands)`. ### K3-P2-06 — Documentation consistency pass **Serves:** G5. **Effort:** 2 days. --- a/docs/security-reference.md +++ b/docs/security-reference.md @@ -1005,7 +1005,8 @@ These are known gaps documented as current limitations, not implementation promi performs recursive `mkdir` directly, and `process-status` no longer builds a shell `wait` command. The retired `(jerboa registry)` compatibility module creates registry directories without shelling out and disables legacy mutable - Git uninstall. + Git uninstall. `jpkg env -- COMMAND` fails closed until the package CLI has a + real argv exec/status API instead of a shell-concatenated compatibility path. - **No red team evaluation.** No independent adversarial testing has been performed. - **Secure memory still exposes a raw region escape hatch.** The high-level `secure-bytevector` API is bounds-checked and integrated with --- a/docs/status.md +++ b/docs/status.md @@ -29,7 +29,7 @@ release artifacts are built as Jerboa multicall binaries with `jerboa`, | Native Rust exports | The native export review now has 190 exported functions: 183 tracked Scheme references and 7 retained standalone C/binary helpers. The previous 35 no-Scheme-reference removal candidates no longer have C ABI export markers. | Re-run `make native-export-review-check` whenever adding or removing native exports. | | Confined worker | `(std security worker)` provides the facade, audit lifecycle, output caps, deadlines, process-group kill, memory rlimit pre-exec setup, Linux syscall/ptrace seccomp pre-exec setup, Linux Landlock filesystem/TCP-connect setup for requested axes, macOS Seatbelt deny-default path/exec/no-network setup for supported axes, standard worker-eval Capsicum entry on FreeBSD, explicit sandbox-axis refusal, egress proxy env wiring, and platform CI smoke for Linux/macOS/FreeBSD sandbox paths. | Keep Linux/macOS/FreeBSD parity tests current; finish arbitrary-command/proxy-aware Capsicum worker paths. | | Fuzzing | `tests/fuzz/corpus/` has 15 checked-in seed inputs, `tests/fuzz/regression/` has 11 crash/rejection regressions, `make fuzz-smoke` runs the deterministic regression gate first, and GitHub CI runs smoke fuzzing normally plus deep fuzzing on scheduled daily runs. | Keep adding minimized corpus and regression inputs for every parser/security bug found. | -| Safe surface | Direct scripts default to the safe prelude; raw access requires `--unsafe-prelude` or `(jerboa prelude unsafe)`. Core compatibility helpers avoid shell construction for recursive directory creation and process-status cleanup; the retired `(jerboa registry)` surface fails closed for mutable Git uninstall. | Continue moving risky APIs behind explicit unsafe imports as new modules land. | +| Safe surface | Direct scripts default to the safe prelude; raw access requires `--unsafe-prelude` or `(jerboa prelude unsafe)`. Core compatibility helpers avoid shell construction for recursive directory creation and process-status cleanup; the retired `(jerboa registry)` surface fails closed for mutable Git uninstall; `jpkg env -- COMMAND` is disabled until there is an argv exec/status API. | Continue moving risky APIs behind explicit unsafe imports as new modules land. | ## Compatibility Notes --- a/lib/std/pkg/commands.ss +++ b/lib/std/pkg/commands.ss @@ -507,26 +507,7 @@ (for-each (lambda (p) (say "~a" p)) (project-env-paths)) 0] [(string=? (car args) "--") - (when (null? (cdr args)) - (jpkg-error "usage: jpkg env -- COMMAND [ARGS ...]")) - (let* ([paths (project-env-paths)] - [joined (string-join-list paths ":")] - [quoted (map (lambda (a) - (string-append - "'" - (apply string-append - (map (lambda (c) - (if (char=? c #\') - "'\"'\"'" - (string c))) - (string->list a))) - "'")) - (cdr args))] - [old (getenv "JERBOA_PKG_PATH")]) - (putenv "JERBOA_PKG_PATH" joined) - (let ([rc (system (string-join-list quoted " "))]) - (when old (putenv "JERBOA_PKG_PATH" old)) - (if (= rc 0) 0 1)))] + (jpkg-error "jpkg env -- COMMAND is disabled until jpkg has an argv exec/status API; set JERBOA_PKG_PATH from `jpkg env` output instead")] [else (jpkg-error "usage: jpkg env [-- COMMAND ...]")])) ) ;; end library