summaryrefslogtreecommitdiff
path: root/internal/api/drops_test.go
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-07-04 09:43:11 +0000
committerPeter Stone <thepeterstone@gmail.com>2026-07-04 09:43:11 +0000
commit0abe8048f10bcf22baffc3fe9c3dfabb0cf0597a (patch)
tree88f734fcc89def7a70f8f3d391bf4f890203b580 /internal/api/drops_test.go
parentf8ae821240f33d615a9e91cdfeb6c026b7970782 (diff)
fix(sandbox): run GitPush from host to fix local-remote push + harden against sandbox escapefix/dockersandbox-gitpush-host-security
DockerSandbox.GitPush was running `git push` inside the container via `docker exec`, but the origin remote URL is a host filesystem path that was never bind-mounted into the container — only hostDir is. This caused `exit status 128` in TestDockerSandbox_RealContainer_Lifecycle. Fix: run `git -C hostDir push origin -- <ref>` from the host (mirroring HostSandbox.GitPush), so local-path remotes are reachable. Two security flags prevent a compromised workspace from escaping onto the host: - `-c core.hooksPath=/dev/null` neutralises any hooks planted in .git/ - `-c protocol.ext.allow=never` blocks the ext:: pseudo-protocol Also rejects refs starting with "-" and inserts "--" before the ref to prevent argument injection. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DNDHfCtTZDbQueEV5sUBiD
Diffstat (limited to 'internal/api/drops_test.go')
0 files changed, 0 insertions, 0 deletions