Remove urlencoded action handling & harden action ID checks#87082
Merged
Remove urlencoded action handling & harden action ID checks#87082
Conversation
* remove urlencoded server action handling * urlencoded POSTs should still flow through action handler * bailout early for urlencoded * tweak handling to 404 in feetch action case
* remove custom error * remove dev gate * error when there are no server actions * gate against dev
* Check whether action ids are valid before parsing In an effort to narrow access to parsing methods Next.js now prequalifies MPA form parsing by ensuring there are only valid action IDs as part of the submission. This is not meant to be a strong line of defense against malicious payloads since action IDs are not private and are for many apps relatively easy to acquire. It does however provide some limited narrowing of code paths so that action decoding only happens for plausible actions Additionally all other branches that use next-action header now consistently check the header before proceeding with parsing. This is also a perf improvement. * fix test assertion --------- Co-authored-by: Zack Tanner <1939140+ztanner@users.noreply.github.com>
gnoff
approved these changes
Dec 11, 2025
eps1lon
approved these changes
Dec 11, 2025
icyJoseph
pushed a commit
that referenced
this pull request
Dec 17, 2025
- Removes support for urlencoded actions - Errors when a server action request is received in apps that have no server actions - validate action ID in MPA actions before proceeding --------- Co-authored-by: Josh Story <story@hey.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.