CVE-2026-30827: express-rate-limit IPv4-mapped IPv6 Addresses Bypass Per-client Vulnerability

HIGH
Advisory Identifier: GHSA-46wh-pxpv-q5gq
CVSS 7.5
CWE-770
Published
Advisory Summary

CVE-2026-30827 is a HIGH (CVSS 7.5) ipv4-mapped ipv6 addresses bypass per-client vulnerability (CWE-770: Allocation of Resources Without Limits or Throttling) affecting express-rate-limit libraries in the npm ecosystem. The issue involves ipv4-mapped ipv6 addresses bypass per-client rate limiting on servers with dual-stack network. Remediation is available by upgrading affected packages to version 8.2.2, 8.1.1, 8.0.2.

CVE-2026-30827 at a Glance

CVE Identifier CVE-2026-30827
GHSA Identifier GHSA-46wh-pxpv-q5gq
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-770: Allocation of Resources Without Limits or Throttling
Affected Product express-rate-limit
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2026-30827

To remediate this vulnerability, upgrade all affected express-rate-limit dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

express-rate-limit fixed: 8.2.2
npm install express-rate-limit@8.2.2
express-rate-limit fixed: 8.1.1
npm install express-rate-limit@8.1.1
express-rate-limit fixed: 8.0.2
npm install express-rate-limit@8.0.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls express-rate-limit

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-30827, inspect your project dependencies using npm:

npm ls express-rate-limit

Analyze the terminal output to locate any version of express-rate-limit in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 8.2.2), your application is affected.

Note: The npm ls express-rate-limit 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-770: Allocation of Resources Without Limits or Throttling, where the product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated. In express-rate-limit, 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

## 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`: ```typescript 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 ```javascript 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.ip` for IPv4 clients is `::ffff:127.0.0.1` - Rate limit key resolves to `::/56` - After `limit` requests 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.ip` contains IPv4-mapped IPv6 addresses - Only affects the default `keyGenerator` (custom key generators are not affected) ## 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 ## Affected Versions All versions of express-rate-limit between v8.0.0 and v8.2.1. ## Fix 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.

CVE-2026-30827 Affected express-rate-limit Versions

3 component(s)
Fixed Versions:
8.2.28.1.18.0.2
Product / Package Ecosystem Affected Versions Fixed Version
express-rate-limit
npm
≥ 8.2.0
< 8.2.2
8.2.2
express-rate-limit
npm
≥ 8.1.0
< 8.1.1
All 1 versions
8.1.0
8.1.1
express-rate-limit
npm
≥ 8.0.0
< 8.0.2
8.0.2

References

Frequently Asked Questions

What is CVE-2026-30827?
CVE-2026-30827 is a security vulnerability in express-rate-limit involving IPv4-mapped IPv6 addresses bypass per-client rate limiting on servers with dual-stack network under CWE-770: Allocation of Resources Without Limits or Throttling.
Which express-rate-limit versions are affected?
Affected versions include releases prior to 8.2.2, 8.1.1, 8.0.2 across affected packages: express-rate-limit.
What version fixes CVE-2026-30827?
Upgrading to 8.2.2, 8.1.1, 8.0.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is express-rate-limit affected?
Yes, express-rate-limit is affected in releases prior to 8.2.2, 8.1.1, 8.0.2. Upgrade your dependency to 8.2.2, 8.1.1, 8.0.2 or later.
What is the CVSS score of CVE-2026-30827?
CVE-2026-30827 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2026-30827?
CVE-2026-30827 is classified under CWE-770: Allocation of Resources Without Limits or Throttling (The product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated.).
How can I check npm dependencies for CVE-2026-30827?
Run the dependency tree command: 'npm ls express-rate-limit'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-46wh-pxpv-q5gq",
  "modified" : "2026-03-09T15:58:09Z",
  "published" : "2026-03-06T18:36:56Z",
  "aliases" : [ "CVE-2026-30827" ],
  "summary" : "express-rate-limit: IPv4-mapped IPv6 addresses bypass per-client rate limiting on servers with dual-stack network",
  "details" : "## 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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "express-rate-limit"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.2.0"
      }, {
        "fixed" : "8.2.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "express-rate-limit"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.1.0"
      }, {
        "fixed" : "8.1.1"
      } ]
    } ],
    "versions" : [ "8.1.0" ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "express-rate-limit"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.0.0"
      }, {
        "fixed" : "8.0.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/express-rate-limit/express-rate-limit/security/advisories/GHSA-46wh-pxpv-q5gq"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-30827"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/express-rate-limit/express-rate-limit/commit/14e53888cdfd1b9798faf5b634c4206409e27fc4"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/express-rate-limit/express-rate-limit"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-770" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-06T18:36:56Z",
    "nvd_published_at" : "2026-03-07T06:16:10Z"
  }
}