You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
security(sandbox): ambient re-entrancy markers can disable isolation #727
Zero trusts the inherited ZERO_SANDBOXED=1 and non-empty ZERO_SANDBOX_BACKEND environment variables as proof that the current process is already sandboxed. These values are user-controlled when Zero starts outside a sandbox.
Policy evaluation can auto-allow an ordinary shell request because the configured engine reports a native backend, while command planning independently sees the forged re-entrancy markers and emits a direct, unwrapped command plan.
Affected code
internal/sandbox/types.go:24-31 reads both markers from the ambient environment.
internal/sandbox/engine.go:222-248 and 406-412 allow ordinary shell commands based on configured backend capability.
internal/sandbox/runner.go:130-170 changes command planning to pass-through/direct execution when the markers are present.
internal/sandbox/reentrancy_test.go:115-136 confirms that a caller-supplied marker pair triggers pass-through behavior.
Trigger
Start Zero from an otherwise unsandboxed process with both variables set:
Then execute a shell command that is auto-allowed because native sandbox isolation is expected.
Impact
The command can run directly on the host without the filesystem/network isolation that justified auto-allowing it. A process genuinely inside an outer sandbox remains constrained by that sandbox; the defect is false provenance at an unsandboxed process boundary.
Suggested fix
As an immediate mitigation, disable shell auto-allow whenever re-entrancy causes wrapping to be skipped. Longer term, replace ambient marker trust with authenticated in-process launch state or backend-verifiable confinement.
Add a regression test proving forged startup variables cannot combine an auto-allow decision with an unwrapped command plan.
Activity
fix(sandbox): don't auto-allow shell when re-entrancy skips wrapping (#…
fix(sandbox): say so when the nesting markers skip wrapping
fix(sandbox): say when a session's sandbox enforcement is degraded (#…