Addressing CORS Vulnerability for OnTrack Application (Documentation)#23
Merged
aNebula merged 2 commits intoDec 21, 2024
Merged
Addressing CORS Vulnerability for OnTrack Application (Documentation)#23aNebula merged 2 commits into
aNebula merged 2 commits into
Conversation
✅ Deploy Preview for ontrackdocumentation ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Contributor
Author
|
@washyking , could you please review this PR? Thanks a lot! |
washyking
approved these changes
Dec 12, 2024
nodogx
approved these changes
Dec 12, 2024
nodogx
left a comment
There was a problem hiding this comment.
This pull request documentation addresses the CORS vulnerability. This is done by implementing a flexible and restrictive CORS using the DF_ALLOWED_ORIGINS env variable which makes sure security while managing the configurability. I have also tried the CORS to ensure if this works, which does
The code logic looks really good. I have tried to get the CORS headers as well for an unauthorised website, which it doesn't give. Which shows it works as intended :)
Unauthorised Website
Authorised Website
Headers:
aNebula
approved these changes
Dec 21, 2024
aNebula
approved these changes
Dec 21, 2024
aNebula
approved these changes
Dec 21, 2024
Roeenk27
pushed a commit
to Roeenk27/doubtfire-astro
that referenced
this pull request
Mar 17, 2026
fix: force npm install in the vscode task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Title: "Remediation: Addressing CORS Vulnerability for OnTrack Application"
Summary:
This PR addresses a Cross-Origin Resource Sharing (CORS) vulnerability in the OnTrack application caused by the use of the
Access-Control-Allow-Origin: *header. The current configuration poses significant security risks by allowing unrestricted cross-origin access.Impacts:
Any website can interact with the API, potentially leading to data leakage or abuse.
Vulnerable to cross-origin attacks and other malicious activities.
Violates security and privacy standards.
Remediation:
Access-Control-Allow-Origin:DF_ALLOWED_ORIGINSenvironment variable for flexibility./doubtfire-api/docker-compose.yml/doubtfire-api/config/application.rbConfiguration Updates:
Docker:
DF_ALLOWED_ORIGINSvariable must reflect the exact URLs where the OnTrack app will be accessed (e.g., production, staging, or development environments).Rails:
application.rb:Testing Plan:
http://localhost:4200).Originheaders.Postman Validation Steps:
GET,POST) and endpoint.Originhttp://localhost:4200Expected Outcome:
DF_ALLOWED_ORIGINS.Reviewer Notes:
DF_ALLOWED_ORIGINSenvironment variable is updated appropriately in all environments before deployment.