-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Security: allowed origins should not be * by default #1359
Comments
@dosu Where do we have to look in the settings/code to set this to a sensible/safe default value? |
To set the allowed origins for CORS headers to a sensible/safe default value, you need to look at the # Authorized origins
allow_origins = ["*"] You should replace # Authorized origins
allow_origins = ["https://example.com", "https://anotherdomain.com"] This setting can be found in multiple
Additionally, the |
@dosu Maybe we could make the default in the settings file 127.0.0.1 and localhost, then document users to change it for production to whatever website/domain they use? |
Yes, you can set the default allowed origins in the settings file to [project]
# Authorized origins
allow_origins = ["127.0.0.1", "localhost"] This change can be made in the
Additionally, you should document this change and instruct users to update the |
This improves Socket.IO configuration and CORS handling for cross-origin use cases, particularly focusing on scenarios where Chainlit is embedded in other websites (copilot, closes Chainlit#1279) or deployed behind load balancers: - Make Socket.IO client transports configurable via `project.transports` setting - Move connection parameters from headers to Socket.IO auth object for better websocket compatibility - Update CORS handling to properly support authenticated cross-origin requests. Closes Chainlit#1359. - Remove unnecessary task start/end events from window_message handler BREAKING CHANGE: For cross-origin deployments, wildcard "*" is no longer supported in allow_origins when using authenticated connections. Specific origins must be listed in the project config. Possibly resolves Chainlit#719, Chainlit#1339, Chainlit#1369, Chainlit#1407, Chainlit#1492, Chainlit#1507.
CORS headers should be restricted to the current domain at least, by default.
The text was updated successfully, but these errors were encountered: