Headline
GHSA-x2rg-q646-7m2v: Koajs vulnerable to Cross-Site Scripting (XSS) at ctx.redirect() function
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
https://gist.github.com/linhnph05/03d677b183636af206ff781bdd19701a
Impact
- Redirect user to another phishing site
- Make request to another endpoint of the application based on user’s cookie
- Steal user’s cookie
Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.