Skip to content

fix(security): restrict credentialed CORS to trusted origins - #520

Open
ARDA7787 wants to merge 5 commits into
onecli:mainfrom
ARDA7787:fix/cors-trusted-origins
Open

fix(security): restrict credentialed CORS to trusted origins#520
ARDA7787 wants to merge 5 commits into
onecli:mainfrom
ARDA7787:fix/cors-trusted-origins

Conversation

@ARDA7787

Copy link
Copy Markdown

I have read the CONTRIBUTING.md file.

YES

What kind of change does this PR introduce?

Bug fix (security hardening), plus tests and a docs/env-comment update.

What is the current behavior?

app.ts configures CORS with credentials: true and, on self-host, an origin callback that echoes the request back:

origin: IS_CLOUD ? [appUrl] : (origin) => origin,

What is the new behavior?

Self-host CORS now uses the auth layer’s trusted-origin set via isTrustedBrowserOrigin, with unlisted origins receiving no Access-Control-Allow-Origin header and no new configuration required.

Add isTrustedBrowserOrigin function for CORS handling
Updated CORS configuration to use isTrustedBrowserOrigin for self-hosted setups.
Clarify description of trusted origins in .env.example
@ARDA7787

Copy link
Copy Markdown
Author

recheck

@github-actions

Copy link
Copy Markdown


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@ARDA7787

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA.

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