Skip to content

feat(dev): add Origin validation to the dev server (DNS-rebinding defense in depth) - #557

Merged
kalenkevich merged 2 commits into
google:mainfrom
AmaadMartin:feat/dev-server-origin-host-validation
Sep 9, 2026
Merged

kalenkevich merged 2 commits into
google:mainfrom
AmaadMartin:feat/dev-server-origin-host-validation

Conversation

@AmaadMartin

@AmaadMartin AmaadMartin commented Jul 29, 2026 •

Copy link
Copy Markdown
Collaborator

Link to Issue or Description of Change

Describe the change:

Problem

The dev server's DNS-rebinding guard (from #744) inspects the Host header but not Origin, so a page on another origin can still drive state-changing requests (create a session, run an agent) that the browser sends with an Origin. --allow_origins was wired only to cors(), which sets response headers and never rejects a request. A comma-separated value also reached cors() as one string that no browser Origin can equal.

Solution

Add an Origin gate (dev/src/server/origin_check.ts) registered before every route, alongside the existing Host guard. A state-changing request (any method outside GET/HEAD/OPTIONS) that carries an Origin must be same-origin or on the allowlist; a request with no Origin passes, so curl, the ADK CLI and AdkApiClient are unaffected. --allow_origins is parsed as a comma-separated list of http:/https: origins, each origin's host is also added to the DNS-rebinding allowlist, and '*' allows every origin and turns that guard off. A rejected request returns 403 Forbidden: origin not allowed.

Behavioural change, intentional. A cross-origin state-changing browser request that used to succeed now returns 403. The escape hatch is --allow_origins <origin>.

This mirrors the request gate in the adk-python dev server (_OriginCheckMiddleware).

Testing Plan

  • dev/test/server/origin_check_test.ts — normalizeOrigin, parseAllowedOrigins and isRequestOriginAllowed, including the opaque Origin: null path.
  • dev/test/server/adk_api_server_origin_check_test.ts — the gate end to end over node:http, including a no-Origin POST (200) and a scheme-less --allow_origins entry that must not allowlist Origin: null.
  • dev/test/server/dns_rebinding_guard_test.ts — updated for the string[] signature, plus the wildcard-in-list opt-out.
  • dev/test/utils/log_utils_test.ts — the shared header-logging helper.
npx vitest run --project unit:dev dev/test
npm run ts:check && npm run lint && npm run format:check

Checklist

  • I have read the CONTRIBUTING.md document.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.

@Varun-S10

Copy link
Copy Markdown
Contributor

Hi @kalenkevich, I have tested and validated the proposed changes in this PR. Could you please review this PR?

@Varun-S10 Varun-S10 self-assigned this Aug 5, 2026
@Varun-S10 Varun-S10 added the needs review [Status] The PR/issue is awaiting review from the maintainer label Aug 5, 2026
@AmaadMartin
AmaadMartin force-pushed the feat/dev-server-origin-host-validation branch from 07bf654 to 0ea34eb Compare August 13, 2026 16:49

@kalenkevich kalenkevich left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work — the design is right, the module is small and well tested, and I confirmed the gate really does cover the A2A routes mounted later by initA2A() (403 for both a forged Host and a foreign Origin).

I merged the branch onto current main and ran it: 171 dev tests pass, tsc -p dev clean, eslint/prettier clean, and origin_check.ts is at 100% line and branch coverage.

One blocking bug: this 403s adk deploy cloud_run --with_ui. Details inline, plus two smaller things.

Also: the branch is 33 commits behind main (merges cleanly), and since AdkApiServer is exported from dev/src/index.ts, the new 403s deserve a release note.

Comment thread dev/src/server/origin_check.ts Outdated
// Forwarding headers are deliberately ignored -- an untrusted
// `X-Forwarded-Host` would let a caller forge this side of the comparison --
// and the dev server never terminates TLS, so the scheme is always http.
return headers.host !== undefined && origin === `http://${headers.host}`;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking. Hardcoding http:// breaks any TLS-terminated deploy.

deploy_utils.ts:111 runs adk web --host=0.0.0.0 and Cloud Run terminates TLS, so the browser sends Origin: https://svc.a.run.app while the container sees Host: svc.a.run.app — every POST from the deployed dev UI is 403. Verified locally. Same for ngrok/Codespaces.

Compare authorities instead, no forwarding header needed:

if (headers.host === undefined) return false;
try {
  return new URL(origin).host === headers.host.toLowerCase();
} catch {
  return false;
}

A browser can't forge Host, so this opens no cross-origin hole.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 5105d74: the same-origin check now compares new URL(origin).host to Host instead of prefixing http://, so an https Origin behind a TLS terminator matches its http Host. Added a test for the Cloud Run authority case.

Comment thread dev/src/server/origin_check.ts Outdated
const allowedHosts = new Set<string>();
for (const hostname of [serverHost, configuredHost, ...LOOPBACK_HOSTS]) {
const authority = net.isIPv6(hostname) ? `[${hostname}]` : hostname;
allowedHosts.add(`${authority}:${port}`.toLowerCase());

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--port 80 403s everything: the set gets localhost:80, but browsers omit the default port and send Host: localhost. Add the port-less spelling when port === 80.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 5105d74: buildOriginPolicy now also adds the port-less host when port === 80. Test added.

Comment thread dev/src/server/origin_check.ts Outdated
// Keep tunnelled or proxied setups declared via --allow_origins working.
for (const origin of allowedOrigins) {
try {
allowedHosts.add(new URL(origin).host);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: --allow_origins http://localhost:4200/ allowlists the host here, but the origin check is an exact includes and never matches — the escape hatch half-works. new URL(o).origin at parse time would make both sides agree.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 5105d74: --allow_origins entries are normalized with new URL(o).origin at parse time, so both the gate and cors() match the browser Origin. Test added.

Comment thread dev/src/server/adk_api_server.ts Outdated
});

if (this.allowOrigins) {
if (this.allowedOrigins.length > 0) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description lists /, /health and /dev-ui bypassing cors() as a bug this fixes, but cors() is still registered after those routes. Confirmed at runtime: with --allow_origins http://localhost:4200, /list-apps gets Access-Control-Allow-Origin and /version gets none. Move the block above the routes, or drop the claim.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 5105d74: cors() is now registered before the routes, so /, /health, /dev-ui and /version also carry the header. The description now holds.

Comment thread dev/src/server/adk_api_server.ts Outdated
* to: `port: 0` picks a free port, so it is only known once it is listening --
* which it always is by the time a request reaches the middleware.
*/
private policy(): OriginPolicy {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this rebuilds the Set and re-parses every allowed origin on each request, including every dev-UI static asset. The bound address can't change after listen, so it could be memoized on first use.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 5105d74: the policy is memoized on first use once the server is listening, so it is built once, not per request.

@AmaadMartin

Copy link
Copy Markdown
Collaborator Author

On the release note: the dev CHANGELOG is release-please-generated from the Feat: PR title, so a feature entry is produced automatically, and the behavioral change is documented in the PR body under "Behavioural change, intentional." I can retitle to Feat!: to add a BREAKING CHANGES entry (which bumps devtools to 2.0.0) if you want the new 403s flagged as breaking -- your call. The branch still merges cleanly against main, so no rebase is needed.

@AmaadMartin AmaadMartin changed the title Feat: Add Origin and Host validation (DNS-rebinding protection) to the dev server feat: Add Origin and Host validation (DNS-rebinding protection) to the dev server Aug 21, 2026
@ScottMansfield

Copy link
Copy Markdown
Member

Heads up: the ground under this PR moved today. #744 — "fix: guard reads in the dev server against DNS rebinding" — merged as 0fe9581 at 17:06Z, and it ships the Host half of what this PR does. This needs a rebase, and I think it needs a scope reduction with it.

What merged, and where it collides

0fe9581 touched five files, three of which this PR also touches:

dev/src/cli/cli.ts                            +28    <- also changed here (+1/-1)
dev/src/server/adk_api_server.ts              +44    <- also changed here (+56/-10)
dev/src/server/dns_rebinding_guard.ts        +145    <- new; overlaps origin_check.ts
dev/test/server/adk_api_server_test.ts        +79
dev/test/server/dns_rebinding_guard_test.ts  +182

That is why GitHub now reports mergeable: CONFLICTING / mergeState: DIRTY. The branch is 60 commits behind main.

The overlap is not incidental — it is function-for-function on the Host side:

origin_check.ts (this PR) on main via #744
isLoopbackAddress isLoopbackAddress — same job
isRequestHostAllowed isDnsRebindingRequest
buildOriginPolicy (host allowlist part) getAllowedRequestHosts
— stripPort (with port validation, hardened over two rounds)
isRequestOriginAllowed nothing on main
normalizeOrigin nothing on main

#744 also went through three rounds of hardening the Host path specifically — a port-validation bug where Host: 127.0.0.1:8000.evil.com read as loopback, a bounded/quoted rejection log, an allowedHosts opt-out that does not require wildcard CORS, and a dedicated test file that takes the module to 100% statements and 100% branches. Re-landing a second Host implementation alongside it would mean two guards to keep in sync, and the newer one has already absorbed fixes this branch has not.

What still stands, and is worth keeping

The Origin half is not on main and nothing else covers it. I checked: there is no request-Origin gate anywhere under dev/src. Measured against a freshly built main (3aaf49b, #744 included):

DNS rebinding (Host: evil.attacker.example)           403 BLOCKED
cross-origin GET /apps/app1/users/victim/sessions     200 ACCEPTED
cross-origin POST /run  (Host ok, Origin evil.com)    reached the handler

It also has upstream precedent — adk-python carries both halves: _is_request_origin_allowed (api_server.py:309) alongside its own DNS-rebinding guard. adk-js currently has one of the two.

Being straight about how much it matters, because it affects how you scope the rebase:

config                                     x-origin read   ACAO       rebinding
default (no --allow_origins)               200             (none)     403
--allow_origins 'http://localhost:4200'    200             scoped     403
--allow_origins '*'                        200             *          200

In the first two rows the server executes the cross-origin request but the browser refuses the response, and a JSON POST still needs a preflight that fails — so this is defence in depth rather than an open door. The third row is the real one: --allow_origins '*' disables the rebinding guard and makes every response readable by any origin. An Origin gate that is not derived from the CORS config is exactly what covers that case, and it is the gap I flagged on #744 as "the only full opt-out is wildcard CORS".

The ask

Rebase onto current main and cut this down to the Origin gate:

  1. Drop the host-allowlist logic from origin_check.ts and build on the merged dns_rebinding_guard.ts instead of beside it. getAllowedRequestHosts already accepts an allowedHosts list, so the derivation you need is there.
  2. Keep isRequestOriginAllowed, normalizeOrigin and their tests — that is the part with no equivalent on main.
  3. Re-check the two incidental fixes in the original description. The --allow_origins a,b multi-origin parse is still broken on main (it still resolves to one junk host), so that fix is still wanted. Route-ordering — /, /health, /dev-ui registered before the CORS middleware — is worth re-verifying against the current file rather than assumed.
  4. Worth confirming against adk-python's _is_request_origin_allowed while you are in there, so the two runtimes agree on the semantics rather than diverging on a second security control.

That should be a much smaller change than the current +674/−11, and it stops this duplicating code that already shipped.

kalenkevich's CHANGES_REQUESTED from 2026-08-20 is still open too, so those comments will want folding into the same pass. Happy to review the reduced version promptly once it is up — and sorry the timing worked out this way; #744 landed while this was waiting.

…ng guard

Rebased onto main. PR #744 shipped the Host-based DNS-rebinding guard, so this
drops the duplicate Host allowlist and keeps only the Origin gate, which has no
equivalent on main. The gate rejects cross-origin state-changing requests and
compares authorities, so a TLS-terminating proxy (Cloud Run, ngrok) still
passes as same-origin.

Also fixes multi-origin --allow_origins parsing: comma-separated origins now
reach cors as a list, and each origin host is vouched for by the guard. The
CORS block is registered before the routes so /, /health and /version carry
CORS headers too.
@AmaadMartin
AmaadMartin force-pushed the feat/dev-server-origin-host-validation branch from 5105d74 to 70e3d60 Compare August 25, 2026 20:51
@AmaadMartin

Copy link
Copy Markdown
Collaborator Author

Rebased onto main (3aaf49b) and cut down to the Origin gate. Pushed as 70e3d601.

  • Dropped the Host allowlist from origin_check.ts. The Host defence is now fix: guard reads in the dev server against DNS rebinding #744's dns_rebinding_guard.ts. Kept isRequestOriginAllowed and normalizeOrigin, which have no equivalent on main.
  • Built on the merged guard: each --allow_origins host feeds getAllowedRequestHosts through its allowedHosts list, so one derivation serves both controls.
  • Multi-origin parse: still fixed. Comma-separated origins reach cors as a list, and each host is vouched for by the guard.
  • Route ordering: still needed on main — cors was registered after /, /health and /version. Moved it before the routes.
  • Parity with adk-python _is_request_origin_allowed: allowlist, then same-origin. The gate compares authorities, not full origins, so a TLS-terminating proxy passes; adk-python reaches the same result via X-Forwarded-Proto. That divergence is deliberate, to avoid trusting attacker-controlled forwarding headers.

Host coverage lives in #744's tests, so I dropped the duplicate Host test and kept the Origin and CORS tests.

@AmaadMartin AmaadMartin changed the title feat: Add Origin and Host validation (DNS-rebinding protection) to the dev server feat(dev): add Origin validation to the dev server (DNS-rebinding defense in depth) Aug 25, 2026

@kalenkevich kalenkevich left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed the rebased head. All five earlier comments are fixed and the scope cut after #744 is right — 152 dev/server tests, tsc, eslint and prettier are clean here, and the gate does cover the A2A routes mounted later by initA2A().

One blocking bug found by probing config edge cases, plus small things inline. Two with no diff line to hang off:

  • ServerOptions.allowOrigins (adk_api_server.ts:77) still has no doc comment, though it is now a comma-separated list and a request gate, not just a CORS header. It is exported public API.
  • The description is stale post-rebase — host allowlist, buildOriginPolicy, --trust_proxy_headers, Forbidden: host not allowed, 100% coverage. It becomes the squash commit message.

Comment thread dev/src/server/origin_check.ts Outdated
return origin;
}
try {
return new URL(origin).origin;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking. new URL(x).origin is the string "null" for a scheme-less entry, so --allow_origins localhost:4200 puts 'null' on the allowlist. Verified against a running server:

  • POST Origin: http://localhost:4200 → 403 (the origin the user meant to allow)
  • POST Origin: null → 200, Access-Control-Allow-Origin: null

So a forgotten scheme inverts the escape hatch and grants every opaque origin: sandboxed iframes, data:/file:// documents, cross-origin-redirected POSTs. Same for --allow_origins file://.

Accept only entries parsing to an http:/https: URL, drop anything whose .origin is 'null', and warn on the dropped entry so the typo surfaces at startup.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in ac31e8b. normalizeOrigin now returns null for any entry that is not an http:/https: URL, and parseAllowedOrigins drops it and logs a warning at startup, so localhost:4200 and file:// no longer put null on the allowlist. An end-to-end test asserts that Origin: null gets a 403 under --allow_origins localhost:4200.

Comment thread dev/src/server/origin_check.ts Outdated
}
const reason = 'Forbidden: origin not allowed';
logger.warn(
`${reason}: ${req.method} ${req.originalUrl} (host: ${req.headers.host}, origin: ${req.headers.origin})`,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Host guard logs JSON.stringify(String(req.headers.host).slice(0, 128)) after #744's review rounds; this interpolates host, origin and URL raw and unbounded. Worth one shared helper rather than two conventions.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in ac31e8b. Both the Host guard and the Origin gate now log through one helper, formatHeaderForLog in dev/src/utils/log_utils.ts, which quotes the value and caps it at 128 characters.

[],
),
).toBe(false);
});

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage here is 95.9% stmts / 94.1% branches, not the 100% the description claims. The gap is the malformed-Origin catch (origin_check.ts:57-58) — which is exactly the path Origin: null takes, so it is worth a case.

Also missing: a POST with no Origin passing. That is the compat contract for AdkApiClient and curl; I confirmed it returns 200, it is just not pinned.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in ac31e8b. Added a unit case for the malformed-Origin catch (Origin: null -> false) and an end-to-end case for a no-Origin POST returning 200, plus parseAllowedOrigins cases.

Comment thread dev/src/server/adk_api_server.ts Outdated
* The hosts of every configured origin, so the DNS-rebinding guard vouches
* for each one. Naming an origin in `--allow_origins` vouches for its host.
*/
private allowOriginHosts(): string[] {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This re-derives what getAllowedRequestHosts already does internally, and since only '*' | undefined now reaches its first parameter, that branch is dead outside its own tests (and its doc comment describes work the caller does). Consider getAllowedRequestHosts(allowedOrigins: string[], extraAllowedHosts?) and dropping this helper.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in ac31e8b. getAllowedRequestHosts now takes the parsed string[] and derives every origin's host itself; allowOriginHosts is gone and the caller passes this.allowedOrigins directly.

Comment thread dev/src/server/adk_api_server.ts Outdated
const allowedRequestHosts = getAllowedRequestHosts(
this.allowOrigins,
this.allowedHosts,
this.allowedOrigins.includes('*') ? '*' : undefined,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--allow_origins 'http://localhost:4200,*' now returns null here and switches the DNS-rebinding guard off entirely; on main that string never equalled '*', so the guard stayed on. Defensible, but make it deliberate with a test.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in ac31e8b. Added a test pinning that getAllowedRequestHosts(['http://localhost:4200', '*']) returns null, so a wildcard anywhere in the list disables the guard deliberately.

- Reject scheme-less/opaque `--allow_origins` entries so a typo like
  `localhost:4200` (whose opaque origin is the string "null") can no longer
  allowlist every `Origin: null` request; warn on each dropped entry.
- Share one bounded, quoted header-logging helper (`formatHeaderForLog`)
  across the Host guard and the Origin gate instead of two conventions.
- Derive the DNS-rebinding host allowlist from the parsed origins list
  (`getAllowedRequestHosts(string[])`) and drop the redundant
  `allowOriginHosts` helper in the server.
- Document `ServerOptions.allowOrigins` (now a request gate, not just CORS).
- Tests: opaque-origin drop and parse behaviour, the malformed-Origin path,
  a no-Origin POST passing, and the wildcard-in-list guard opt-out.
@AmaadMartin

Copy link
Copy Markdown
Collaborator Author

Both items in the re-review with no diff line are addressed in ac31e8b: ServerOptions.allowOrigins now has a doc comment (it is a request gate, not just a CORS header, and comma-separated), and the description is rewritten to drop the stale host-allowlist, buildOriginPolicy, --trust_proxy_headers, Forbidden: host not allowed and 100%-coverage references.

@kalenkevich
kalenkevich merged commit f280eba into google:main Sep 9, 2026
14 checks passed
@kalenkevich kalenkevich mentioned this pull request Sep 9, 2026
prasanna8585 pushed a commit to prasanna8585/adk-js that referenced this pull request Nov 10, 2026
…ense in depth) (google#557)

* feat(dev): add dev-server Origin validation on top of the DNS-rebinding guard

Rebased onto main. PR google#744 shipped the Host-based DNS-rebinding guard, so this
drops the duplicate Host allowlist and keeps only the Origin gate, which has no
equivalent on main. The gate rejects cross-origin state-changing requests and
compares authorities, so a TLS-terminating proxy (Cloud Run, ngrok) still
passes as same-origin.

Also fixes multi-origin --allow_origins parsing: comma-separated origins now
reach cors as a list, and each origin host is vouched for by the guard. The
CORS block is registered before the routes so /, /health and /version carry
CORS headers too.

* fix(dev): address origin-gate review feedback

- Reject scheme-less/opaque `--allow_origins` entries so a typo like
  `localhost:4200` (whose opaque origin is the string "null") can no longer
  allowlist every `Origin: null` request; warn on each dropped entry.
- Share one bounded, quoted header-logging helper (`formatHeaderForLog`)
  across the Host guard and the Origin gate instead of two conventions.
- Derive the DNS-rebinding host allowlist from the parsed origins list
  (`getAllowedRequestHosts(string[])`) and drop the redundant
  `allowOriginHosts` helper in the server.
- Document `ServerOptions.allowOrigins` (now a request gate, not just CORS).
- Tests: opaque-origin drop and parse behaviour, the malformed-Origin path,
  a no-Origin POST passing, and the wildcard-in-list guard opt-out.

---------

Co-authored-by: Amaad Martin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs review [Status] The PR/issue is awaiting review from the maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants