CVE-2025-25200: Koa Inefficient Regular Expression Complexity Vulnerability
CRITICALCVE-2025-25200 is a CRITICAL inefficient regular expression complexity vulnerability (CWE-1333: Inefficient Regular Expression Complexity) affecting Koa libraries in the npm ecosystem. The issue involves inefficient regular expression complexity in koa. Remediation is available by upgrading affected packages to version 2.15.4, 3.0.0-alpha.3, 1.7.1, 0.21.2.
CVE-2025-25200 at a Glance
How to Fix CVE-2025-25200
To remediate this vulnerability, upgrade all affected Koa dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install koa@2.15.4
npm install koa@3.0.0-alpha.3
npm install koa@1.7.1
npm install koa@0.21.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls koa
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2025-25200, inspect your project dependencies using npm:
npm ls koa
Analyze the terminal output to locate any version of Koa in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.15.4), your application is affected.
Note: The npm ls koa command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-1333: Inefficient Regular Expression Complexity, where the product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential. In Koa, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2025-25200 Affected Koa Versions
4 component(s)References
Frequently Asked Questions
What is CVE-2025-25200?
Which Koa versions are affected?
What version fixes CVE-2025-25200?
Is koa affected?
What CWE is associated with CVE-2025-25200?
How can I check npm dependencies for CVE-2025-25200?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-593f-38f6-jp5m",
"modified" : "2025-02-12T19:23:09Z",
"published" : "2025-02-12T19:23:09Z",
"aliases" : [ "CVE-2025-25200" ],
"summary" : "Inefficient Regular Expression Complexity in koa",
"details" : "### Summary\nKoa 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.\n\n### PoC\n\nComing soon.\n\n### Impact\nThis is a Regex Denial-of-Service attack and causes memory exhaustion. The regex should be improved and empty values should not be allowed.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "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"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "koa"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.0.0"
}, {
"fixed" : "2.15.4"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "koa"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.0.0-alpha.0"
}, {
"fixed" : "3.0.0-alpha.3"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "koa"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.0.0"
}, {
"fixed" : "1.7.1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "koa"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.21.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/koajs/koa/security/advisories/GHSA-593f-38f6-jp5m"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-25200"
}, {
"type" : "WEB",
"url" : "https://github.com/koajs/koa/commit/5054af6e31ffd451a4151a1fe144cef6e5d0d83c"
}, {
"type" : "WEB",
"url" : "https://github.com/koajs/koa/commit/5f294bb1c7c8d9c61904378d250439a321bffd32"
}, {
"type" : "WEB",
"url" : "https://github.com/koajs/koa/commit/93fe903fc966635a991bcf890cfc3427d33a1a08"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/koajs/koa"
}, {
"type" : "WEB",
"url" : "https://github.com/koajs/koa/releases/tag/2.15.4"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-1333" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2025-02-12T19:23:09Z",
"nvd_published_at" : "2025-02-12T18:15:28Z"
}
}