
Let’s Go On A Little Adventure
•
Next.js, the most popular React framework, has some weird, poorly documented
URL parsing semantics that does not conform to the widely accepted WHATWG
URL standard
•
This is unexpected behaviour, and often results in wrong URL validation
•
Made a responsible disclosure ≈ 1 year ago, still not fixed
Let’s query open-source GitHub projects to find instances of this bug!
•
Common design pattern: unauthenticated user visits /admin, gets redirected to
/login?next=/admin, logs in, and gets redirected back to /admin
•
Use Next.js URL parsing trickery to turn a “normal” URL into
javascript:sendToAttacker(authToken) at the final step
CodeQL 24 / 34