Skip to content

fix: Add ORIGIN environment variable for production CSRF validation #991

@saishmungase

Description

@saishmungase

Problem

When using @sveltejs/adapter-node with NGINX in a self-managed Docker setup, SvelteKit's default CSRF protection checks the origin header of incoming requests against the internal host. If the ORIGIN environment variable is not set to the public domain, valid POST requests, such as product edits or logins, will return a 403 Forbidden error.

Proposed Solution

Context

This issue came from the discussion in #878 at the request of @VaiTon.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions