XSS code injection when change the route #50093
Labels
bug
Issue was opened via the bug report template.
Linking and Navigating
Related to Next.js linking (e.g., <Link>) and navigation.
Verify canary release
Provide environment information
Which area(s) of Next.js are affected? (leave empty if unsure)
Routing (next/router, next/navigation, next/link)
Link to the code that reproduces this issue or a replay of the bug
https://codesandbox.io/p/sandbox/next-router-6ui2e5
To Reproduce
router.push("javascript:(alert)(3)")
Describe the Bug
When I want to route to another page through the query params, if the user changes the existing query params and writes a script instead, that script will be executed through the router.
Expected Behavior
Prevent next-router run and execute scripts.
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
The text was updated successfully, but these errors were encountered: