Skip to content

restrict allowed CORS origins#33

Merged
erm156 merged 3 commits into
2.3.2from
ICDC-4155
May 7, 2026
Merged

restrict allowed CORS origins#33
erm156 merged 3 commits into
2.3.2from
ICDC-4155

Conversation

@erm156
Copy link
Copy Markdown

@erm156 erm156 commented Apr 30, 2026

ICDC-4155

  • Resolves a LOW severity CORS configuration (CWE-16) where the /api/files/ endpoint was returning Access-Control-Allow-Origin: *, allowing any website to make cross-origin requests to the API.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR tightens the Express CORS configuration to address a low-severity finding where /api/files/* responses included Access-Control-Allow-Origin: *, allowing any website to read cross-origin responses.

Changes:

  • Replaced the permissive cors() middleware with an origin allowlist function.
  • Added an allowlist regex permitting https://*.cancer.gov and localhost origins for development.
  • Explicitly allows requests without an Origin header (server-to-server).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app.js Outdated
@erm156 erm156 requested review from AustinSMueller May 4, 2026 16:45
@erm156 erm156 merged commit b32f4e9 into 2.3.2 May 7, 2026
5 checks passed
@erm156 erm156 deleted the ICDC-4155 branch May 7, 2026 18:38
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.

3 participants