Skip to content

fix(envd): require sha256 for upgrade body - #3536

Open
SashaMIT wants to merge 1 commit into
e2b-dev:mainfrom
SashaMIT:fix/envd-require-sha256-upgrade-body
Open

fix(envd): require sha256 for upgrade body#3536
SashaMIT wants to merge 1 commit into
e2b-dev:mainfrom
SashaMIT:fix/envd-require-sha256-upgrade-body

Conversation

@SashaMIT

@SashaMIT SashaMIT commented Aug 5, 2026

Copy link
Copy Markdown

Summary

  • Require X-Envd-Upgrade-Sha256 (lowercase hex SHA-256 of the request body) when POST /upgrade carries a non-empty body; reject with 400 if the header is missing, malformed, or mismatches — before writing /usr/bin/envd.next.
  • Empty-body upgrade (restart / re-exec without a new binary) is unchanged.
  • Orchestrator CallEnvdUpgrade hashes the local envd binary and sets the header when streaming the body.
  • Complements auth fail-closed work in fix(envd): fail closed privileged routes when access token unset #3535 with content integrity (secure defaults / hardening).

Test plan

  • go test ./internal/services/process/ -run WriteUpgradeBinary (packages/envd) — missing / malformed / wrong / correct hash paths
  • go build packages/envd
  • CI: go test packages/orchestrator/pkg/sandbox (TestCallEnvdUpgrade_SetsBodySHA256Header, linux) — not executable on darwin host here
  • Manual: resume-path live upgrade still delivers via orchestrator with matching digest

Made with Cursor

Require X-Envd-Upgrade-Sha256 (lowercase hex) for non-empty POST /upgrade
bodies and verify before writing envd.next. Orchestrator CallEnvdUpgrade
now attests the streamed binary digest so content integrity is enforced
alongside auth and the fixed-path allowlist.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant