---
title: "GHSA-x2rg-q646-7m2v: Koajs vulnerable to Cross-Site Scripting (XSS) at ctx.redirect() function"
description: "Moderate severity. Koajs vulnerable to Cross-Site Scripting (XSS) at ctx.redirect() function. Affects koa; fixed in 3.0.0-alpha.5."
url: https://inlinr.com/advisories/GHSA-x2rg-q646-7m2v
lang: en
---

[Packages](https://inlinr.com/packages) / [koa](https://inlinr.com/packages/koa) / [Security](https://inlinr.com/packages/koa/security)

Moderate Vulnerability GHSA-x2rg-q646-7m2v CVE-2025-32379 Published 9 Apr 2025

# Koajs vulnerable to Cross-Site Scripting (XSS) at ctx.redirect() function

Your version 

Affected releases · [koa](https://inlinr.com/packages/koa)

- 2.x 2.0.0 – 2.16.0 Fixed in 2.16.1
- 1.x and older 0.0.1 – 1.7.1 No fix, no longer updated

On 2.x, the newest line:

```
npm install koa@2.16.1
```

Every release on a timeline

3.x 

1. Not affected

3.0.0 – 3.3.0  
10 releases, latest

2.x 

1. Affected

2.0.0 – 2.16.0  
37 releases
2. Fixed

2.16.1 – 2.16.4  
4 releases

1.x 

1. Affected

1.0.0 – 1.7.1  
20 releases

0.x 

1. Affected

0.0.1 – 0.21.2  
42 releases

113 stable releases of koa, oldest to newest, one row per major.

## 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

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

## How it is exploited

Exploitable over the network, with no account and a user to do something.

- **Confidentiality**: low
- **Integrity**: low
- **Availability**: low

CVSS:3.1/​AV:N/​AC:H/​PR:N/​UI:R/​S:U/​C:L/​I:L/​A:L

## References

- [Reference](https://github.com/koajs/koa/security/advisories/GHSA-x2rg-q646-7m2v "https://github.com/koajs/koa/security/advisories/GHSA-x2rg-q646-7m2v")  
github.com/koajs/koa/security/advisories/GHSA-x…
- [NVD](https://nvd.nist.gov/vuln/detail/CVE-2025-32379 "https://nvd.nist.gov/vuln/detail/CVE-2025-32379")  
nvd.nist.gov/vuln/detail/CVE-2025-32379
- [Fix commit](https://github.com/koajs/koa/commit/ff25eb4a7f2392df46481fe86355161067687312 "https://github.com/koajs/koa/commit/ff25eb4a7f2392df46481fe86355161067687312")  
ff25eb4
- [Package](https://github.com/koajs/koa "https://github.com/koajs/koa")  
github.com/koajs/koa

A whole project to check? Paste its package.json in the [dependency check](https://inlinr.com/tools/dependency-check): every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.
