pipelock blocks legitimate egress cred injection (scan_env sees EGRESS_TOKEN_*)
#84
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Symptom
Inside a smolmachines bottle, any agent request to a host that egress has an
authroute for (e.g.gitea.dideric.is) is blocked at the pipelock layer with:Reproducible: an in-bottle
curl -s https://gitea.dideric.is/<owner>/<repo>returns the pipelock 403 body even though curl itself sends no Authorization header.Root cause
The sidecar bundle's proxy chain is
agent → egress → pipelock → internet. Egress injects the configuredauth_schemetoken into theAuthorizationheader on outbound requests for routes that declare one. Pipelock is configured withscan_env: true+scan_headers: true+header_mode: all(seeclaude_bottle/pipelock.py:pipelock_build_config), and runs in the same container as egress under the bundle supervisor (claude_bottle/sidecar_init.py:_spawn).scan_env: truemakes pipelock treat every value in its own process env as a secret to scan request headers for. The supervisor spawns every daemon — egress, pipelock, git-gate, supervise — with the bundle container's full env, which includes theEGRESS_TOKEN_<n>slots set bydocker run -e EGRESS_TOKEN_n=<val>(seeclaude_bottle/backend/smolmachines/sidecar_bundle.py:start_bundleandclaude_bottle/backend/docker/compose.py). So:EGRESS_TOKEN_1from env, injectsAuthorization: Bearer <val>into the gitea request.EGRESS_UPSTREAM_PROXY=http://127.0.0.1:8888).It's a self-DOS by the bundle's two DLP-aware proxies.
Affected
Both backends — the chain order matches across docker and smolmachines (
claude_bottle/backend/smolmachines/launch.py:156notes the parity).Fix direction
Strip
EGRESS_TOKEN_*(and any other egress-only credential env vars) from the env passed to non-egress daemons inclaude_bottle/sidecar_init.py:_spawn. The agent never sees these values (they live in the bundle container, not the bottle), so removing them from pipelock's env loses no real DLP coverage — pipelock can't catch an exfil of a value the agent doesn't have in the first place. Egress still gets the full env, since it needs the token slots to do the injection.