Summary
The default keyGenerator in express-rate-limit applies IPv6 subnet masking (/56 by default) to all addresses that net.isIPv6() returns true for. This includes IPv4-mapped IPv6 addresses (::ffff:x.x.x.x), which Node.js returns as request.ip on dual-stack servers.
Because the first 80 bits of all IPv4-mapped addresses are zero, a /56 (or any /32 to /80) subnet mask produces the same network key (::/56) for every IPv4 client. This collapses all IPv4 traffic into a single rate-limit bucket: one client exhausting the limit causes HTTP 429 for all other IPv4 clients.
Details
Root Cause
In source/ip-key-generator.ts:
export function ipKeyGenerator(ip: string, ipv6Subnet: number | false = 56) {
if (ipv6Subnet && isIPv6(ip)) {
return `${new Address6(`${ip}/${ipv6Subnet}`).startAddress().correctForm()}/${ipv6Subnet}`
}
return ip
}
net.isIPv6('::ffff:192.168.1.1') returns true, so IPv4-mapped addresses enter the subnet masking path. With a /56 prefix, the start address for any ::ffff:x.x.x.x is ::, producing the key ::/56.
Proof of Concept
const { isIPv6 } = require('net');
const { Address6 } = require('ip-address');
function ipKeyGenerator(ip, ipv6Subnet = 56) {
if (ipv6Subnet && isIPv6(ip)) {
return `${new Address6(`${ip}/${ipv6Subnet}`).startAddress().correctForm()}/${ipv6Subnet}`;
}
return ip;
}
console.log(ipKeyGenerator('::ffff:192.168.1.1', 56)); // ::/56
console.log(ipKeyGenerator('::ffff:10.0.0.1', 56)); // ::/56
console.log(ipKeyGenerator('::ffff:8.8.8.8', 56)); // ::/56
// ALL produce '::/56', same bucket
End-to-End Validation
On a dual-stack Express server (app.listen(port, '::')), tested with Express 5.2.1:
request.ipfor IPv4 clients is::ffff:127.0.0.1- Rate limit key resolves to
::/56 - After
limitrequests from any IPv4 client, all other IPv4 clients receive 429
When This Occurs
- Node.js dual-stack servers (default on Linux when listening on
::) - Any environment where
request.ipcontains IPv4-mapped IPv6 addresses - Only affects the default
keyGenerator(custom key generators are not affected)
Affected Versions
All versions of express-rate-limit between v8.0.0 and v8.2.1.
Impact
- Denial of Service: A single client can block all IPv4 traffic by exhausting the shared rate limit
- Affects default configuration: No special options needed to trigger this
The application allocates resources such as memory, threads, or file descriptors based on untrusted input without enforcing a cap. Typical impact: resource exhaustion leading to denial of service.
CVE-2026-30827 has a CVSS score of 7.5 (High). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (8.2.2, 8.1.1, 8.0.2); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Remediation advice
This issue was fixed in commit 14e53888cdfd1b9798faf5b634c4206409e27fc4. This fix has been included in release v8.3.0, and backported to all affected minor versions in the form of releases v8.2.2, v8.1.1, and v8.0.2.
Frequently Asked Questions
- What is CVE-2026-30827? CVE-2026-30827 is a high-severity allocation of resources without limits or throttling vulnerability in express-rate-limit (npm), affecting versions >= 8.2.0, < 8.2.2. It is fixed in 8.2.2, 8.1.1, 8.0.2. The application allocates resources such as memory, threads, or file descriptors based on untrusted input without enforcing a cap.
- How severe is CVE-2026-30827? CVE-2026-30827 has a CVSS score of 7.5 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of express-rate-limit are affected by CVE-2026-30827? express-rate-limit (npm) versions >= 8.2.0, < 8.2.2 is affected.
- Is there a fix for CVE-2026-30827? Yes. CVE-2026-30827 is fixed in 8.2.2, 8.1.1, 8.0.2. Upgrade to this version or later.
- Is CVE-2026-30827 exploitable, and should I be worried? Whether CVE-2026-30827 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2026-30827 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2026-30827?
- Upgrade
express-rate-limitto 8.2.2 or later - Upgrade
express-rate-limitto 8.1.1 or later - Upgrade
express-rate-limitto 8.0.2 or later
- Upgrade