Skip to content

fix: use Host header for server action origin check#95

Merged
southpolesteve merged 1 commit intomainfrom
fix/host-header-origin-check
Feb 26, 2026
Merged

fix: use Host header for server action origin check#95
southpolesteve merged 1 commit intomainfrom
fix/host-header-origin-check

Conversation

@southpolesteve
Copy link
Copy Markdown
Collaborator

Summary

Changes the server action origin validation to prefer the Host header over X-Forwarded-Host, matching the trusted-host logic already used in the production server.

X-Forwarded-Host can be freely set by the client, so using it in the origin comparison allows the check to be bypassed by sending a matching Origin and X-Forwarded-Host pair. The Host header is set by the HTTP stack and is the correct value to compare against.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Feb 26, 2026

Open in StackBlitz

npm i https://pkg.pr.new/cloudflare/vinext@95

commit: 6878aa1

@github-actions
Copy link
Copy Markdown

Example Preview Production Original
app-router-cloudflare preview production
pages-router-cloudflare preview production
app-router-playground preview production original
realworld-api-rest preview production
nextra-docs-template preview production
benchmarks preview production
hackernews preview production original

@southpolesteve southpolesteve enabled auto-merge (squash) February 26, 2026 04:21
@southpolesteve southpolesteve merged commit aca4641 into main Feb 26, 2026
24 checks passed
@southpolesteve southpolesteve deleted the fix/host-header-origin-check branch February 26, 2026 04:22
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.

1 participant