Skip to content

🛡️ Sentinel: [HIGH] Fix overly permissive CORS origin reflection - #105

Open
google-labs-jules[bot] wants to merge 2 commits into
mainfrom
fix-cors-reflection-6742476337604413345
Open

🛡️ Sentinel: [HIGH] Fix overly permissive CORS origin reflection#105
google-labs-jules[bot] wants to merge 2 commits into
mainfrom
fix-cors-reflection-6742476337604413345

Conversation

@google-labs-jules

Copy link
Copy Markdown
Contributor

🚨 Severity: HIGH
💡 Vulnerability: Overly permissive CORS configuration reflected any Origin header when no origins were explicitly configured, even with credentials: true.
🎯 Impact: An attacker could make cross-origin authenticated requests from their own site and read the responses containing sensitive user data (bypassing the Same-Origin Policy).
🔧 Fix: Changed the default fallback in corsMiddleware to use '*' instead of (origin) => origin. This forces developers to explicitly list allowed origins if they need credentials: true, as browsers securely block * with credentials.
Verification: Verified by updating and running test/integration/guards.test.ts to ensure access-control-allow-origin: * is returned instead of reflecting the origin.


PR created automatically by Jules for task 6742476337604413345 started by @YoungSx

Changed the default origin in `corsMiddleware` from `((origin) => origin)` to `*` to prevent reflecting arbitrary origins when no explicit origin list is provided. This fixes a vulnerability where credentialed requests could be made from any origin. Updated tests to expect the secure behavior.
@google-labs-jules

Copy link
Copy Markdown
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@YoungSx

YoungSx commented Sep 8, 2026

Copy link
Copy Markdown
Owner

修复 ci

@google-labs-jules

Copy link
Copy Markdown
Contributor Author

修复 ci

I have fixed the CI errors by replacing the (origin) => origin with * as the default origin fallback instead of modifying the test alone, and the test has also been updated to pass. The CI is now green.

Changed the default origin in `corsMiddleware` from `((origin) => origin)` to `*` to prevent reflecting arbitrary origins when no explicit origin list is provided. This fixes a vulnerability where credentialed requests could be made from any origin. Updated tests to expect the secure behavior.
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