Skip to content

fix(api): trust APP_BASE_URL for CSRF origin checks#49

Merged
tobias-gp merged 1 commit intomainfrom
hotfix/app-base-url-csrf
Apr 29, 2026
Merged

fix(api): trust APP_BASE_URL for CSRF origin checks#49
tobias-gp merged 1 commit intomainfrom
hotfix/app-base-url-csrf

Conversation

@tobias-gp
Copy link
Copy Markdown
Contributor

Summary

  • Trust APP_BASE_URL directly during CSRF origin checks, even when CORS_ORIGINS is explicitly configured.
  • Keep CORS_ORIGINS as the explicit additional origin allow-list.
  • Remove the previous proxy-header shortcut so the public application URL remains the single canonical deployment setting.

Test plan

  • pnpm exec vitest run apps/api/src/middleware/csrf.test.ts — 11/11 pass
  • Smoke-test deployed UI mutations with APP_BASE_URL set to the public origin.

Made with Cursor

CSRF origin checks should use APP_BASE_URL as the canonical public URL even when CORS_ORIGINS is explicitly configured. This avoids relying on proxy forwarded headers while preserving the explicit CORS origin allow-list.

Made-with: Cursor
@railway-app
Copy link
Copy Markdown

railway-app Bot commented Apr 29, 2026

🚅 Deployed to the archmax-pr-49 environment in archmax SemLayer

Service Status Web Updated (UTC)
archmax_external_dbs ✅ Success (View Logs) Apr 29, 2026 at 2:40 pm
archmax_standalone ✅ Success (View Logs) Apr 29, 2026 at 2:40 pm
archmax_standalone_with_volume ✅ Success (View Logs) Apr 29, 2026 at 2:39 pm

@railway-app railway-app Bot temporarily deployed to archmax SemLayer / archmax-pr-49 April 29, 2026 14:35 Destroyed
@github-actions
Copy link
Copy Markdown

Docker image ready

docker pull ghcr.io/archmaxai/archmax:pr-49

@tobias-gp tobias-gp merged commit 3e8722c into main Apr 29, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant