Advisory

GHSA-x2rg-q646-7m2v

Also known as: CVE-2025-32379

Summary

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

  1. Redirect user to another phishing site
  2. Make request to another endpoint of the application based on user's cookie
  3. Steal user's cookie

Severity

Medium Basis: The source's own band: MODERATE

Dates

Published
2025-04-09 13:00 UTC
Modified
2025-04-09 20:29 UTC

Affected packages and fixes

koa

npm · All systems

Affected

  • introduced 0, fixed 2.16.1 (semver)

Fixed versions

2.16.1

Fix

koa

npm · All systems

Affected

  • introduced 3.0.0-alpha.1, fixed 3.0.0-alpha.5 (semver)

Fixed versions

3.0.0-alpha.5

Fix

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences