-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
fix: implement CSRF protection for remote function requests #14795
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix: implement CSRF protection for remote function requests #14795
Conversation
🦋 Changeset detectedLatest commit: 52eac5b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Admission: The tests are LLM written, lemme know if they're complete garbage 🤣😅 |
|
Any update? 😁 |
|
We had a lengthy discussion among the maintainers just now and concluded that Ordinarily, the origin comes from One thing we could do is create a new config option, such as // svelte.config.js
export default {
kit: {
paths: {
origin: process.env.ORIGIN ?? ''
}
}
};The empty string would mean 'auto', i.e. derive the origin from If I understand correctly, this would satisfy your use case, and it could also replace |
|
This would be absolutely fantastic! Thank you |
Closes #14791
As discussed, this makes sure the remote functions respect csrf.trustedOrigins. If
trustedOriginsincludes*, then any origin is allowed.Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm testand lint the project withpnpm lintandpnpm checkChangesets
pnpm changesetand following the prompts. Changesets that add features should beminorand those that fix bugs should bepatch. Please prefix changeset messages withfeat:,fix:, orchore:.Edits