Описание
Koa Open Redirect via Referrer Header (User-Controlled)
Summary
In the latest version of Koa, the back method used for redirect operations adopts an insecure implementation, which uses the user-controllable referrer header as the redirect target.
Details
on the API document https://www.koajs.net/api/response#responseredirecturl-alt, we can see:
response.redirect(url, [alt])
however, the "back" method is insecure:
Referrer Header is User-Controlled.
PoC
there is a demo for POC:
Proof Of Concept
Impact
Ссылки
- https://github.com/koajs/koa/security/advisories/GHSA-jgmv-j7ww-jx2x
- https://nvd.nist.gov/vuln/detail/CVE-2025-54420
- https://github.com/koajs/koa/issues/1892
- https://github.com/koajs/koa/issues/1892#issue-3213028583
- https://github.com/koajs/koa/commit/422c551c63d00f24e2bbbdf492f262a5935bb1f0
- https://vuldb.com/?ctiid.317514
- https://vuldb.com/?id.317514
- https://vuldb.com/?submit.619741
Пакеты
koa
>= 2.0.0, < 2.16.2
2.16.2
koa
>= 3.0.0-alpha.0, < 3.0.1
3.0.1
Связанные уязвимости
A vulnerability, which was classified as problematic, was found in KoaJS Koa up to 3.0.0. Affected is the function back in the library lib/response.js of the component HTTP Header Handler. The manipulation of the argument Referrer leads to open redirect. It is possible to launch the attack remotely. The exploit has been disclosed to the public and may be used.
A vulnerability, which was classified as problematic, was found in Koa ...