Koajs vulnerable to Cross-Site Scripting (XSS) at ctx.redirect() function
Affected releases · koa
- 2.x2.0.0 – 2.16.0Fixed in 2.16.1
- 1.x and older0.0.1 – 1.7.1No fix, no longer updated
On 2.x, the newest line:
npm install koa@2.16.1Every release on a timeline
Not affected
3.0.0 – 3.3.0
10 releases, latest
Affected
2.0.0 – 2.16.0
37 releases
Fixed
2.16.1 – 2.16.4
4 releases
Affected
1.0.0 – 1.7.1
20 releases
Affected
0.0.1 – 0.21.2
42 releases
What happens
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
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.