Skip to content

Cors#661

Merged
portableDD merged 5 commits into
Nexacore-Org:mainfrom
Qoder-Undefined:Cors
May 30, 2026
Merged

Cors#661
portableDD merged 5 commits into
Nexacore-Org:mainfrom
Qoder-Undefined:Cors

Conversation

@Qoder-Undefined
Copy link
Copy Markdown
Contributor

@Qoder-Undefined Qoder-Undefined commented May 29, 2026

main.ts: CORS is not configured — browser clients either get blocked or all origins are allowed by default
Summary
src/main.ts does not call app.enableCors(). Without explicit CORS configuration, browser-based clients cannot make cross-origin requests to the API. If a default permissive policy is applied by the runtime, it would allow any origin to call the API — equally problematic in production.

Why This Matters
Frontend applications hosted on a different origin cannot communicate with the API
Missing CORS config is a security misconfiguration for a financial API
What Needs to Be Done
Add app.enableCors({ origin: configService.get('app.allowedOrigins'), credentials: true }) in main.ts
Add ALLOWED_ORIGINS to env.validation.ts and configuration.ts
Default to a restrictive whitelist; never use origin: '*' in production
Key Files
src/main.ts
src/config/env.validation.ts
src/config/configuration.ts
.env.example
Acceptance Criteria
CORS is explicitly configured with an allowlist of origins from environment config
credentials: true is set (required for cookie-based auth flows)
ALLOWED_ORIGINS env var is documented in .env.example
closes #555

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 29, 2026

@Qoder-Undefined Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@portableDD
Copy link
Copy Markdown
Contributor

@Qoder-Undefined please resolve conflicts

@portableDD portableDD merged commit 149deda into Nexacore-Org:main May 30, 2026
1 check failed
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.

[Wave 200pts] main.ts: CORS is not configured — browser clients either get blocked or all origins are allowed by default

2 participants