Skip to content

release: to prod#1553

Merged
eskp merged 2 commits into
prodfrom
staging
Jun 15, 2026
Merged

release: to prod#1553
eskp merged 2 commits into
prodfrom
staging

Conversation

@eskp

@eskp eskp commented Jun 15, 2026

Copy link
Copy Markdown

Summary

Promote the following merged PRs from staging to prod:

Post-deploy verification

  • deploy-keeperhub workflow finishes green, including the @keeperhub/sandbox image rebuild (the fix lives in the sandbox child-source template, executed by the sandbox service)
  • curl -fsS https://app.keeperhub.com/api/health returns 200
  • Smoke-test the sandbox Code node SSRF guard: a divergent-URL probe fetch({ url: "http://allowed/", toString() { return "http://169.254.169.254/" } }) is rejected with "SSRF blocked" (it never dials IMDS), and a normal fetch to an allowed public host still succeeds
  • Watch Sentry / logs for ~10 minutes after the rollout

eskp and others added 2 commits June 15, 2026 14:51
The sandboxed fetch validated the SSRF guard against extractUrl(resource)
(which read resource.url) while pinnedFetch independently re-derived the dial
target via new Request(resource).url (which coerces the resource via
toString / Symbol.toPrimitive). For an object resource these two URLs could
diverge, and when the dialed value was an IP literal node:http's net.connect
dials it directly and skips the custom pinned lookup, so the validated address
set was never consulted. User code in a Code node could therefore pass the
guard with an allowed host and still dial a blocked target:

  fetch({ url: "http://allowed/", toString() { return "http://169.254.169.254/..." } })

reaching IMDS / ECS / K8s ClusterIPs / loopback. External IMDS is backstopped
by the sandbox NetworkPolicy, but cluster-internal targets are not, and the
app-layer guard added previously was fully bypassed.

Fix:
- Build the WHATWG Request exactly once in sandboxedFetch and validate + dial
  that single object (remove the divergent extractUrl helper). A hostile
  toString / Symbol.toPrimitive is now invoked once, so it cannot hand one
  value to the guard and another to the socket.
- pinnedFetch reads url/method/headers/body from the passed-in Request (no
  second construction) and, before dialing, asserts that any IP-literal dial
  host is in the validated pinned set - a load-bearing backstop for the
  net.connect lookup-skip path that holds even if a future change reintroduces
  a divergent URL derivation.
- Redirect hops build the next request from the re-validated Location href, so
  no hop's dial URL can diverge from what was just validated.

Adds regression coverage for the exact bypass (toString and Symbol.toPrimitive
divergence), a single-coercion lock, non-canonical IPv4/IPv6 literal forms
(octal/decimal/hex/short/IPv4-mapped), and the redirect path, plus negative
controls that legitimate object-resource fetches still work.
…nding-toctou-between-ssrf-guard-and-host-fetch

fix(sandbox): validate the URL the sandboxed fetch actually dials
@eskp eskp merged commit 9a006cf into prod Jun 15, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant