{"id":"CVE-2026-30827","aliases":["CVE-2026-30827","GHSA-46wh-pxpv-q5gq"],"related":[],"kind":"vulnerability","state":"published","title":"express-rate-limit: IPv4-mapped IPv6 addresses bypass per-client rate limiting (all IPv4 clients share one bucket on dual-stack servers)","summary":"express-rate-limit is a basic rate-limiting middleware for Express. In versions starting from 8.0.0 and prior to versions 8.0.2, 8.1.1, 8.2.2, and 8.3.0, 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. This issue has been patched in versions 8.0.2, 8.1.1, 8.2.2, and 8.3.0.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"express-rate-limit is a basic rate-limiting middleware for Express. In versions starting from 8.0.0 and prior to versions 8.0.2, 8.1.1, 8.2.2, and 8.3.0, 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. This issue has been patched in versions 8.0.2, 8.1.1, 8.2.2, and 8.3.0.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nThe 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.\n\nBecause 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.\n\n## Details\n\n### Root Cause\n\nIn `source/ip-key-generator.ts`:\n\n```typescript\nexport function ipKeyGenerator(ip: string, ipv6Subnet: number | false = 56) {\n  if (ipv6Subnet && isIPv6(ip)) {\n    return `${new Address6(`${ip}/${ipv6Subnet}`).startAddress().correctForm()}/${ipv6Subnet}`\n  }\n  return ip\n}\n```\n\n`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`.\n\n### Proof of Concept\n\n```javascript\nconst { isIPv6 } = require('net');\nconst { Address6 } = require('ip-address');\n\nfunction ipKeyGenerator(ip, ipv6Subnet = 56) {\n  if (ipv6Subnet && isIPv6(ip)) {\n    return `${new Address6(`${ip}/${ipv6Subnet}`).startAddress().correctForm()}/${ipv6Subnet}`;\n  }\n  return ip;\n}\n\nconsole.log(ipKeyGenerator('::ffff:192.168.1.1', 56)); // ::/56\nconsole.log(ipKeyGenerator('::ffff:10.0.0.1', 56));    // ::/56\nconsole.log(ipKeyGenerator('::ffff:8.8.8.8', 56));     // ::/56\n// ALL produce '::/56' — same bucket\n```\n\n### End-to-End Validation\n\nOn a dual-stack Express server (`app.listen(port, '::')`), tested with Express 5.2.1:\n- `request.ip` for IPv4 clients is `::ffff:127.0.0.1`\n- Rate limit key resolves to `::/56`\n- After `limit` requests from any IPv4 client, all other IPv4 clients receive 429\n\n### When This Occurs\n\n- Node.js dual-stack servers (default on Linux when listening on `::`)\n- Any environment where `request.ip` contains IPv4-mapped IPv6 addresses\n- Only affects the default `keyGenerator` (custom key generators are not affected)\n\n## Impact\n\n- **Denial of Service**: A single client can block all IPv4 traffic by exhausting the shared rate limit\n- **Affects default configuration**: No special options needed to trigger this\n\n## Affected Versions\n\nAll versions of express-rate-limit between v8.0.0 and v8.2.1.\n\n## Fix\n\nThis 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.","format":"markdown","source":"ghsa"},{"lang":"es","text":"express-rate-limit es un middleware básico de limitación de tasa para Express. En versiones a partir de la 8.0.0 y anteriores a las versiones 8.0.2, 8.1.1, 8.2.2 y 8.3.0, el keyGenerator predeterminado en express-rate-limit aplica enmascaramiento de subred IPv6 (/56 por defecto) a todas las direcciones para las que net.isIPv6() devuelve verdadero. Esto incluye direcciones IPv6 mapeadas a IPv4 (::ffff:x.x.x.x), que Node.js devuelve como request.ip en servidores de doble pila. Debido a que los primeros 80 bits de todas las direcciones mapeadas a IPv4 son cero, una máscara de subred /56 (o cualquier /32 a /80) produce la misma clave de red (::/56) para cada cliente IPv4. Esto colapsa todo el tráfico IPv4 en un único cubo de limitación de tasa: un cliente que agota el límite causa HTTP 429 para todos los demás clientes IPv4. Este problema ha sido parcheado en las versiones 8.0.2, 8.1.1, 8.2.2 y 8.3.0.","source":"nvd"}],"published":"2026-03-06T18:36:56.000Z","modified":"2026-09-10T03:50:36.934Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"}],"cwes":["CWE-770"],"affected":[{"ranges":[{"version":">= 8.0.0, < 8.0.2","status":"affected"},{"version":">= 8.1.0, < 8.1.1","status":"affected"},{"version":">= 8.2.0, < 8.2.2","status":"affected"}],"vendor":"express-rate-limit","product":"express-rate-limit","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"8.2.0","status":"affected","fixed":"8.2.2"}],"ecosystem":"npm","package":"express-rate-limit","purl":"pkg:npm/express-rate-limit","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"8.1.0","status":"affected","fixed":"8.1.1"}],"ecosystem":"npm","package":"express-rate-limit","purl":"pkg:npm/express-rate-limit","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"8.0.0","status":"affected","fixed":"8.0.2"}],"ecosystem":"npm","package":"express-rate-limit","purl":"pkg:npm/express-rate-limit","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"8.0.0","fixed":"8.0.2"},{"status":"affected","introduced":"8.2.0","fixed":"8.2.2"},{"status":"affected","version":"8.1.0"}],"vendor":"express-rate-limit_project","product":"express-rate-limit","cpe":"cpe:2.3:a:express-rate-limit_project:express-rate-limit:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/express-rate-limit/express-rate-limit/security/advisories/GHSA-46wh-pxpv-q5gq","tags":["exploit","patch","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/express-rate-limit/express-rate-limit/commit/14e53888cdfd1b9798faf5b634c4206409e27fc4","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-30827","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/express-rate-limit/express-rate-limit","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2026-03-09T20:40:59.712Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-30827","url":"https://www.cve.org/CVERecord?id=CVE-2026-30827","licence":"CVE Terms of Use","modified":"2026-03-09T20:44:25.979Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-46wh-pxpv-q5gq","url":"https://github.com/advisories/GHSA-46wh-pxpv-q5gq","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:36.934Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-30827","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-30827","licence":"Public domain","modified":"2026-06-17T10:32:59.050Z"}],"updatedAt":"2026-11-25T22:59:15.456Z","epss":{"score":0.00509,"percentile":0.44951,"date":"2026-12-01T12:00:22.000Z"}}