Skip to content

Fix/18552 cors wildcard credentials#19020

Open
Bellambharath wants to merge 3 commits intoOrchardCMS:mainfrom
Bellambharath:fix/18552-cors-wildcard-credentials
Open

Fix/18552 cors wildcard credentials#19020
Bellambharath wants to merge 3 commits intoOrchardCMS:mainfrom
Bellambharath:fix/18552-cors-wildcard-credentials

Conversation

@Bellambharath
Copy link
Contributor

Summary

  1. Treat * in AllowedOrigins as “any origin” when validating CORS policies.
  2. Prevent persisting policies that combine AllowCredentials with *.

Testing

  1. CORS Settings: AllowedOrigins = * + AllowCredentials = ON ⇒ warning shown, policy does not persist after refresh.
  2. CORS Settings: AllowedOrigins = * + AllowCredentials = OFF ⇒ policy persists after refresh.

Fixes #18552

@Piedone Piedone requested a review from hishamco March 19, 2026 20:03
@hishamco
Copy link
Member

Could you please share a GIF screenshot, before I test it myself

@gvkries
Copy link
Member

gvkries commented Mar 20, 2026

If I understand this PR correctly, the same check done by the editor UI is now also done by the CorsOptionsConfiguration. Seems reasonable, please confirm this @hishamco

@Bellambharath
Copy link
Contributor Author

Bellambharath commented Mar 20, 2026

Could you please share a GIF screenshot, before I test it myself
Here’s the GIF showing both flows:

  1. Policy “Invalid config test” (AllowedOrigins="*", AllowCredentials=ON) shows warning and disappears after refresh.
  2. Policy “Valid config test” (AllowedOrigins="*", AllowCredentials=OFF) persists after refresh.
    Valid config test
    Invalid config test

@hishamco
Copy link
Member

If I understand this PR correctly, the same check done by the editor UI is now also done by the CorsOptionsConfiguration. Seems reasonable, please confirm this @hishamco

That's what I understand, but I will check the PR

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.

Invalid CORS config can make the site unusable

3 participants