Skip to content

release: to prod#1482

Merged
joelorzet merged 3 commits into
prodfrom
staging
Jun 6, 2026
Merged

release: to prod#1482
joelorzet merged 3 commits into
prodfrom
staging

Conversation

@joelorzet

Copy link
Copy Markdown

No description provided.

joelorzet added 3 commits June 6, 2026 01:32
The Code-node sandbox fetch wrapper checked the SSRF blocklist only on the
initial URL, then let undici follow 3xx redirects transparently. A redirect
from a public attacker host could chase a 302 into IMDS (169.254.169.254),
the K8s apiserver, or *.svc.cluster.local and return the response to the
sandbox.

Follow redirects manually with redirect:"manual", re-running the scheme and
SSRF checks on each Location before issuing the next request, capped at 20
hops with POST->GET body downgrade matching undici's follow semantics. This
mirrors the per-hop validation lib/safe-fetch.ts already performs via its
undici connector.
The redirect test server reflected a request query param into the Location
header, which CodeQL flags as a server-side open redirect. Key a fixed,
server-defined target table by request path instead so no request data
reaches the redirect target. Behaviour is unchanged.
…-ssrf-revalidation

fix(sandbox): re-validate SSRF on every redirect hop in sandboxed fetch
@joelorzet joelorzet requested review from a team, OleksandrUA, eskp and suisuss and removed request for a team June 6, 2026 04:51
@joelorzet joelorzet merged commit d5a65ad into prod Jun 6, 2026
25 of 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.

2 participants