All vulnerabilities

npm

CVE-2026-126367

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

Severity
Medium 4.8
Published
12 Nov 2026
Last changed
12 Nov 2026
Added to UpHeron
23 Nov 2026
Fixed in
1.13.2, 1.14.2
Exploit chance
0.2% in the next 30 daysHigher than 8% of CVEs. EPSS by FIRST, 24 Nov 2026
Weakness
CWE-625Incorrect authorization (CWE-863)
Attack
Over the network · Only under certain conditions · No login needed · No user action needed
Attacker can
Read some data · Change some data
CVSS vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N
Also known as
GHSA-r7hq-q2xm-6c5m
Sources
OSV.dev and GitHub

Description

The StringMatcher/PathMatcher for safe_regex builds its RE2 as ^${regex}$ with no surrounding group. Because alternation has the lowest precedence, a pattern "a|b|c" compiles to /^a|b|c$/ -- "starts with a" OR "contains b" OR "ends with c" instead of a full match of the whole value. Configurations with safe_regex matchers that use a regex alternation (a natural way to list methods or service identities) therefore apply partial string matches. This impacts route selection, xDS credentials, and RBAC.

src/matcher.ts: SafeRegexValueMatcher and PathSafeRegexValueMatcher both do

and apply() returns targetRegexImpl.test(value). With a top-level alternation the anchors bind only to the first/last branch.

src/route.ts (getPredicateForStringMatcher / getPredicateForHeaderMatcher) builds these for every safe_regex StringMatcher/HeaderMatcher, and src/rbac.ts uses them for RBAC url_path permissions/principals, authenticated.principal_name (mTLS SAN/CN), requested_server_name and header rules.

From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Affected software

SoftwareAffected versions
@grpc/grpc-js-xdsnpm · osv:npm:@grpc/grpc-js-xds
  • Every version before 1.13.2
  • From 1.14.0 before 1.14.2

About @grpc/grpc-js-xds

Weekly downloads (npm)
6,033npm, 24 Nov 2026

Vulnerabilities in @grpc/grpc-js-xds

In our list
2
Published in the last 12 months
2
Critical, last 12 months
0
High, last 12 months
0
Known exploited
0
Search the list for @grpc/grpc-js-xds

References