You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit bf704ae
Browse filesBrowse the repository at this point in the historyBrowse files
fix(actions): authorize server references in fetch action arguments (#3991)
* fix(actions): authorize server references in fetch action arguments
decodeReply() resolves `$h` argument references through the RSC server
manifest, which accepts any export of a server-reference module. A crafted
fetch action body could therefore pass a page's default export or another
route's Server Action into an action as a callable argument, which Next.js
never decodes.
Scan the reply body for server references before decoding, resolving their
metadata the way React does (including async-iterable entries that only
parse inside an iterator result), and reject the request as action-not-found
unless every reference is a Server Action owned by the current route
(production owner manifest) and loads as a registered Server Action (dev).
Apply the same registration check to bound references in progressive
`$ACTION_REF_` submissions.
* fix(actions): scope fetch action argument references to the route's manifest
Replace the raw reply scanner with a route-scoped server manifest passed
to React's decodeReply(), so every server reference React resolves goes
through the action-owner check without vinext mirroring the reply wire
format.
* fix(actions): stop React's module-id fallback after a denied argument reference
0 commit comments