security: Restrict CORS Wildcard Origin with Configurable Host Filter #284#288
security: Restrict CORS Wildcard Origin with Configurable Host Filter #284#288krsatyamthakur-droid wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
999e591 to
6fa9a6e
Compare
There was a problem hiding this comment.
Code Review
This pull request updates the CORS configuration to restrict allowed origins using a new AllowedOrigins configuration, enabling credentials support, and reformats the affected files. A review comment suggests improving the robustness of parsing the ALLOWED_ORIGINS environment variable by trimming whitespace and filtering out empty values to prevent potential CORS failures.
6fa9a6e to
a491254
Compare
|
Hi @JesseStutler, |
…ilter Signed-off-by: satyam kumar <krsatyamthakur@gmail.com>
bd89d6b to
8a99b56
Compare
What this PR does 🚀
Hey folks! This PR fixes a security issue where our backend was allowing any origin (
*) to access the dashboard API. This permissive configuration could have exposed us to Cross-Site Request Forgery (CSRF) attacks, especially since we work with sensitive Kubernetes data.How it was fixed 🛠️
I updated the CORS initialization to use a safe, configurable approach:
ALLOWED_ORIGINSenvironment variable inconfigs.ts.http://localhost:3000andhttp://localhost:5173).credentials: trueto ensure standard authenticated requests work seamlessly across allowed domains.Related Issue 🔗
Fixes #284
Testing Done ✅
localhostwithout any changes needed on the frontend.