Skip to content

Remove urlencoded action handling & harden action ID checks#87082

Merged
ztanner merged 3 commits intocanaryfrom
ztanner/backport-next-changes-canary
Dec 11, 2025
Merged

Remove urlencoded action handling & harden action ID checks#87082
ztanner merged 3 commits intocanaryfrom
ztanner/backport-next-changes-canary

Conversation

@ztanner
Copy link
Member

@ztanner ztanner commented Dec 11, 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

ztanner and others added 3 commits December 11, 2025 13:44
* 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>
@ztanner ztanner marked this pull request as ready for review December 11, 2025 21:48
@ztanner ztanner merged commit d43d57a into canary Dec 11, 2025
151 checks passed
@ztanner ztanner deleted the ztanner/backport-next-changes-canary branch December 11, 2025 21:56
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>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 26, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants