Skip to content

fix(security): reject wildcard origin with credentials in CORS middleware#2053

Merged
bpamiri merged 1 commit intodevelopfrom
peter/fix-cors-wildcard-credentials
Apr 9, 2026
Merged

fix(security): reject wildcard origin with credentials in CORS middleware#2053
bpamiri merged 1 commit intodevelopfrom
peter/fix-cors-wildcard-credentials

Conversation

@bpamiri
Copy link
Copy Markdown
Collaborator

@bpamiri bpamiri commented Apr 9, 2026

Summary

  • Adds init-time validation to Cors.cfc that throws Wheels.Cors.InvalidConfiguration when allowOrigins="*" is combined with allowCredentials=true
  • The CORS spec forbids this combination; browsers silently reject the response, which often leads developers to weaken security further
  • Adds 4 test cases to CorsSpec.cfc verifying the validation and that valid configurations still work

Test plan

  • Verified all 10 CORS tests pass on Lucee 6 (2539 pass, 0 CORS failures)
  • Verified all 10 CORS tests pass on Lucee 7 (2569 pass, 0 CORS failures)
  • CI will run full matrix (all engines x databases)

🤖 Generated with Claude Code

…ware

The CORS spec forbids Access-Control-Allow-Origin: * combined with
Access-Control-Allow-Credentials: true. Browsers silently reject such
responses, which often leads developers to weaken security further.
The Cors middleware now throws Wheels.Cors.InvalidConfiguration at
init() time when this invalid combination is detected.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bpamiri bpamiri merged commit 03cf7a8 into develop Apr 9, 2026
2 of 3 checks passed
@bpamiri bpamiri deleted the peter/fix-cors-wildcard-credentials branch April 9, 2026 19:49
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.

1 participant