GitHub Advisory Database
GHSA-x2rg-q646-7m2v
Koajs vulnerable to Cross-Site Scripting (XSS) at ctx.redirect() function
Details
Summary
In koa < 2.16.1 and < 3.0.0-alpha.5, passing untrusted user input to ctx.redirect() even after sanitizing it, may execute javascript code on the user who use the app.
Patches
This issue is patched in 2.16.1 and 3.0.0-alpha.5.
PoC
Coming soon...
Impact
- Redirect user to another phishing site
- Make request to another endpoint of the application based on user's cookie
- Steal user's cookie
Affected packages
| Ecosystem | Package | Affected versions |
|---|---|---|
| npm | koa | All versions before 2.16.1 (fixed in 2.16.1) |
| npm | koa | From 3.0.0-alpha.1 before 3.0.0-alpha.5 (fixed in 3.0.0-alpha.5) |