Skip to content

fix(security): change CORS default from wildcard to deny-all#2039

Merged
bpamiri merged 1 commit intodevelopfrom
peter/fix-insecure-cors-default
Apr 9, 2026
Merged

fix(security): change CORS default from wildcard to deny-all#2039
bpamiri merged 1 commit intodevelopfrom
peter/fix-insecure-cors-default

Conversation

@bpamiri
Copy link
Copy Markdown
Collaborator

@bpamiri bpamiri commented Apr 9, 2026

Summary

  • Changes accessControlAllowOrigin default from "*" to "" (deny all)
  • Updates $setCORSHeaders() to skip all CORS headers when no origin is configured
  • Updates CORS documentation to reflect the new secure default
  • Adds test verifying the default doesn't send Access-Control-Allow-Origin: *

Test plan

  • Verify corsSecurityDefaultsSpec passes on Lucee 6 + SQLite
  • Verify existing CORS tests still pass
  • Verify apps that explicitly set accessControlAllowOrigin are unaffected

🤖 Generated with Claude Code

The legacy accessControlAllowOrigin defaulted to "*", meaning if a
developer enabled CORS without configuring origins, all cross-origin
requests would be allowed. Now defaults to empty string (deny all),
requiring explicit origin configuration.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bpamiri bpamiri merged commit f8a7dba into develop Apr 9, 2026
1 of 5 checks passed
@bpamiri bpamiri deleted the peter/fix-insecure-cors-default branch April 9, 2026 08:45
@bpamiri bpamiri mentioned this pull request Apr 16, 2026
7 tasks
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