Repository navigation
breaking: error on event.url, event.params and event.route access inside queries - #16452
Conversation
|
Install the latest version of pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/ba309d449a1a43d944963d88e46a72870b65e476Open in Note This PR is from a fork. A maintainer must approve approve each commit before it can be built and installed. |
🦋 Changeset detectedLatest commit: ba309d4 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 |
event.url, event.params and event.route.id access inside queriesevent.url, event.params and event.route access inside queries
commented
Jul 21, 2026
|
The last commit changes how the server recognizes query requests. Instead of loading the remote module to check the function's flavor, it checks whether the client sent |
commented
Jul 21, 2026
|
Not sure if that really can be abused but that last commit could have security implications - us not just checking ourselves anymore means an attacker could send along the header to force a different path and consequently break something in a security-relevant way. |
|
I assumed so too, but I couldn't construct an exploit. The header was never verified on any branch. On version-3 every remote request already takes |
Closes #16416 with the error option which seems like the right approach to me. No hard feelings if it goes.
event.url,event.paramsandevent.routenow throw on access insidequery,query.batchandquery.live, during SSR as well, matching how prerendering already treatsurl.search. The router runs on the client-sentx-sveltekit-pathnameheader to produceevent.paramsandevent.route.id, so hiding onlyurlwould leave the same footgun readable throughparams.localsviahandlestill works, but since query requests no longer carry the page URL,handlesees the URL of the remote endpoint, so that context has to come from cookies or headers.commandandformare unchanged when called directly. Remote functions called while a query is running inherit the restriction, since their results feed the same cached response.handleValidationErrorreceives an event it can readurlon, and prerendered data lookups inside queries resolve against the request URL rather thanevent.url.x-sveltekit-pathnameandx-sveltekit-searchheaders, and the server only applies them when they are present, which also fixes the query half of Remote functions fire during hydration with placeholderpage.url, causing wrong server-side route resolution #15749.event.routeandevent.urlto remote functions #14606 asserting queries can read the url is inverted, and the remote-functions docs bullet now documents the error.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