Skip to content

Commit 5b5bace

Browse files
committed
add support for replace in Next.js router
1 parent 97032f8 commit 5b5bace

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

javascript/ql/src/semmle/javascript/security/dataflow/ClientSideUrlRedirectCustomizations.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@ module ClientSideUrlRedirect {
182182
* A call to change the current url with a Next.js router.
183183
*/
184184
class NextRoutePushUrlSink extends ScriptUrlSink {
185-
NextRoutePushUrlSink() { this = NextJS::nextRouter().getAMemberCall("push").getArgument(0) }
185+
NextRoutePushUrlSink() {
186+
this = NextJS::nextRouter().getAMemberCall(["push", "replace"]).getArgument(0)
187+
}
186188
}
187189
}

0 commit comments

Comments
 (0)