Pentesting Next.js Server Actions — A Burp Extension for Has... #1521
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.
🤖 Automated Content Update
This PR was automatically generated by the HackTricks News Bot based on a technical blog post.
📝 Source Information
🎯 Content Summary
What this post delivers: a practical method and a Burp Suite extension (NextjsServerActionAnalyzer) to deanonymize Next.js Server Actions by mapping the hashed IDs sent in the
Next-Actionheader to their original function names wheneverproductionBrowserSourceMapsis enabled. This turns opaque POSTs into named targets for focused testing.Why Server Actions are hard to test: Unlike REST endpoints (e.g.,
GET /api/user/1), Next.js Serve...🔧 Technical Details
Deanonymize Next.js Server Actions via source maps + regex: When
productionBrowserSourceMapsis enabled, scan minified JS forcreateServerReference(...)and extracthash → functionNamewith regex:Next-Actionheader values into concrete targets (e.g.,deleteUserAccount(),exportUserData()). Tool: NextjsServerActionAnalyzer.Template-based request generation to exercise hidden actions: Take a valid POST containing Next.js headers as a template, replace its
Next-Actionvalue with the discovered hash, and replay in Burp Repeater to probe authZ, input validation, and business logic for otherwise...🤖 Agent Actions
I analyzed the repository and found the best place to incorporate this technique is the existing Next.js page:
There was no prior coverage of Next.js Server Actions deanonymization or workflows based on the Next-Action header and source maps. Related content on source maps existed under Angular and XSS pages, but nothing specific for Next.js Server Actions. Therefore, I updated the Next.js page to include a concise, highly technical section on enumerating and testing Server Actions via source maps and regex, and I added a References section per guidelines.
Summary of changes implemented:
Files modified:
No new files were created since the existing Next.js page was the most relevant and appropriate location for this content.
This PR was automatically created by the HackTricks Feed Bot. Please review the changes carefully before merging.