---
title: "GHSA-593f-38f6-jp5m: Inefficient Regular Expression Complexity in koa"
description: "Critical severity. Inefficient Regular Expression Complexity in koa. Affects koa; fixed in 3.0.0-alpha.3."
url: https://inlinr.com/advisories/GHSA-593f-38f6-jp5m
lang: en
---

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

Critical Vulnerability GHSA-593f-38f6-jp5m CVE-2025-25200 Published 12 Feb 2025

# Inefficient Regular Expression Complexity in koa

Your version 

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

- 2.x 2.0.0 – 2.15.3 Fixed in 2.15.4
- 1.x 1.0.0 – 1.7.0 Fixed in 1.7.1
- 0.21.x 0.21.0 – 0.21.1 Fixed in 0.21.2
- 0.20.x and older 0.0.1 – 0.20.0 No fix, no longer updated

On 2.x, the newest line:

```
npm install koa@2.15.4
```

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.15.3  
35 releases
2. Fixed

2.15.4 – 2.16.4  
6 releases

1.x 

1. Affected

1.0.0 – 1.7.0  
19 releases
2. Fixed

1.7.1  
1 release

0.x 

1. Affected

0.0.1 – 0.21.1  
41 releases
2. Fixed

0.21.2  
1 release

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

## What happens

Summary

Koa uses an evil regex to parse the `X-Forwarded-Proto` and `X-Forwarded-Host` HTTP headers. This can be exploited to carry out a Denial-of-Service attack.

PoC

Coming soon.

Impact

This is a Regex Denial-of-Service attack and causes memory exhaustion. The regex should be improved and empty values should not be allowed.

## How it is exploited

Exploitable over the network, with no account and no action from a user.

- **Confidentiality**: none
- **Integrity**: none
- **Availability**: high

CVSS:4.0/​AV:N/​AC:L/​AT:N/​PR:N/​UI:N/​VC:N/​VI:N/​VA:H/​SC:N/​SI:N/​SA:H

## References

- [Reference](https://github.com/koajs/koa/security/advisories/GHSA-593f-38f6-jp5m "https://github.com/koajs/koa/security/advisories/GHSA-593f-38f6-jp5m")  
github.com/koajs/koa/security/advisories/GHSA-5…
- [NVD](https://nvd.nist.gov/vuln/detail/CVE-2025-25200 "https://nvd.nist.gov/vuln/detail/CVE-2025-25200")  
nvd.nist.gov/vuln/detail/CVE-2025-25200
- [Fix commit](https://github.com/koajs/koa/commit/5054af6e31ffd451a4151a1fe144cef6e5d0d83c "https://github.com/koajs/koa/commit/5054af6e31ffd451a4151a1fe144cef6e5d0d83c")  
5054af6
- [Fix commit](https://github.com/koajs/koa/commit/5f294bb1c7c8d9c61904378d250439a321bffd32 "https://github.com/koajs/koa/commit/5f294bb1c7c8d9c61904378d250439a321bffd32")  
5f294bb
- [Fix commit](https://github.com/koajs/koa/commit/93fe903fc966635a991bcf890cfc3427d33a1a08 "https://github.com/koajs/koa/commit/93fe903fc966635a991bcf890cfc3427d33a1a08")  
93fe903
- [Package](https://github.com/koajs/koa "https://github.com/koajs/koa")  
github.com/koajs/koa
- [Reference](https://github.com/koajs/koa/releases/tag/2.15.4 "https://github.com/koajs/koa/releases/tag/2.15.4")  
github.com/koajs/koa/releases/tag/2.15.4

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.
