Skip to content

fix: restrict ADK Web cross-origin defaults#1322

Closed
lethanhsang188 wants to merge 1 commit into
google:mainfrom
lethanhsang188:fix-adk-web-origin-policy
Closed

fix: restrict ADK Web cross-origin defaults#1322
lethanhsang188 wants to merge 1 commit into
google:mainfrom
lethanhsang188:fix-adk-web-origin-policy

Conversation

@lethanhsang188

@lethanhsang188 lethanhsang188 commented Jul 3, 2026

Copy link
Copy Markdown

Summary

  • Default ADK Web CORS origins to an empty list instead of allowing every origin.
  • Apply configured CORS origins to the /run_live WebSocket endpoint instead of hard-coding wildcard origins.
  • Add regression coverage for default-deny and explicit-origin behavior.

Tests

  • ./mvnw -pl dev -Dtest=AdkWebCorsConfigTest,WebSocketConfigTest test
  • ./mvnw -pl dev -Dtest=AdkWebServerTest,AdkWebCorsConfigTest,WebSocketConfigTest test
  • ./mvnw -pl dev clean test

@lethanhsang188
lethanhsang188 force-pushed the fix-adk-web-origin-policy branch from 214f794 to dcdd6fc Compare July 3, 2026 11:40
@hemasekhar-p

Copy link
Copy Markdown
Contributor

Hi @lethanhsang188, thank you for your contribution! We appreciate you taking the time to submit this pull request. As per contribution policy, please ensure your PR consists of a single commit. Could you please change your commits accordingly?

@hemasekhar-p hemasekhar-p self-assigned this Jul 10, 2026
@hemasekhar-p hemasekhar-p added the waiting on reporter Waiting for reaction by reporter. Failing that, maintainers will eventually closed it as stale. label Jul 10, 2026
@lethanhsang188
lethanhsang188 force-pushed the fix-adk-web-origin-policy branch from c2a52fd to d67bd77 Compare July 10, 2026 12:41
@lethanhsang188

lethanhsang188 commented Jul 10, 2026

Copy link
Copy Markdown
Author

Thanks for pointing this out. I rebased the branch onto the latest main and squashed the PR to a single commit (d67bd777).

Local verification:

  • ./mvnw -pl dev -Dtest=AdkWebCorsConfigTest,WebSocketConfigTest test
  • ./mvnw -pl dev -Dtest=AdkWebServerTest,AdkWebCorsConfigTest,WebSocketConfigTest test
  • ./mvnw -pl dev clean test

All passed.

@hemasekhar-p

Copy link
Copy Markdown
Contributor

@lethanhsang188, thank you for addressing the pre checks. Currently this PR is under review by our team, we will keep you posted if any additional information is required. thank you.

@hemasekhar-p hemasekhar-p added needs review and removed waiting on reporter Waiting for reaction by reporter. Failing that, maintainers will eventually closed it as stale. labels Jul 14, 2026
@damianmomotgoogle

Copy link
Copy Markdown
Contributor

This was already (partially) addressed in #1222

  • cors support was added for live endpoint
  • warning log is printed if cors defaults to '*'
  • default remains as '*' for backward compatibility - will change behavior in future release

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.

3 participants