# CVE-2026-126367: @grpc/grpc-js: safe_regex incorrectly applies partial string matching for patterns with alternation

> Alternated regex matchers in @grpc/grpc-js may accept or broaden access rules, letting requests bypass route, identity or RBAC policies; Node.js gRPC users should care.

- **Severity:** Medium 4.8 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Harmful if only installed:** No
- **Needs a specific call:** Yes (`SafeRegexValueMatcher`, `PathSafeRegexValueMatcher`)
- **Fix available:** Yes
- **Published:** 12 Nov 2026
- **Updated:** 12 Nov 2026
- **Also known as:** GHSA-r7hq-q2xm-6c5m

## What is CVE-2026-126367?

CVE-2026-126367 is a medium-severity security feature bypass vulnerability in grpc-node, published on 12 Nov 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

@grpc/grpc-js implements the core functionality of gRPC purely in JavaScript, without a C++ addon. Before 1.13.2, and from 1.14.0 through 1.14.1, the @grpc/grpc-js-xds SafeRegexValueMatcher and PathSafeRegexValueMatcher add start and end anchors without grouping a supplied top-level alternation. An expression intended to match one of several complete values can therefore match a prefix, substring, or suffix. The affected matchers are used for route selection, xDS credential identity matching, and RBAC URL path, principal name, server name, and header rules. An ALLOW policy using an alternation can consequently accept a method, certificate identity, or header value outside the intended set, while a DENY policy becomes broader rather than permissive. This issue is fixed in versions 1.13.2 and 1.14.2.

Weakness: CWE-863 (Incorrect Authorization), CWE-625 (Permissive Regular Expression)

## Which versions are affected by CVE-2026-126367?

2 open source packages ship an affected version, including @grpc/grpc-js-xds.

An affected version is only exploitable if your software calls SafeRegexValueMatcher or PathSafeRegexValueMatcher. Many projects that include it are not exposed.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `@grpc/grpc-js-xds` | npm | All versions | 1.13.2 |
| `@grpc/grpc-js-xds` | npm | From 1.14.0 | 1.14.2 |

## How do I fix CVE-2026-126367?

Upgrade @grpc/grpc-js-xds to a fixed version for your release line: 1.13.2 or 1.14.2.

## Is CVE-2026-126367 being exploited?

There is no known exploitation of CVE-2026-126367 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-126367 and fix it if it is affected.

What it is: CVE-2026-126367 is a medium-severity security feature bypass vulnerability in grpc-node, published on 12 Nov 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-126367 in the wild and no public exploit code.
Exposure: An affected version is only exploitable if your software calls SafeRegexValueMatcher or PathSafeRegexValueMatcher. Many projects that include it are not exposed.

Affected packages and fixed versions:
- @grpc/grpc-js-xds (npm): affected all versions; fixed in 1.13.2
- @grpc/grpc-js-xds (npm): affected from 1.14.0; fixed in 1.14.2

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
   If an affected version is present, also search the code for calls to SafeRegexValueMatcher or PathSafeRegexValueMatcher and report whether any exist.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-126367/ (Markdown: https://insights.sbomify.com/CVE-2026-126367/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-126367
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-126367
- OSV: https://osv.dev/vulnerability/CVE-2026-126367

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-126367/
Summaries are generated and may contain mistakes; the official description above is the record.
