CVE Feed
4.8 Medium

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

CVE-2026-126367

Summary The StringMatcher/PathMatcher for saferegex 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 saferegex 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. Details src/matcher.ts: SafeRegexValueMatcher and PathSafeRegexValueMatcher both do ts this.targetRegexImpl = new RE2(^${targetRegex}$, 'u'); and apply() returns targetRegexImpl.test(value). With a top-level alternation the anchors bind only to the first/last branch. https://github.com/grpc/grpc-node/blob/e742b11bd8039f3dbea4cd29afdf5d95a8ba6b92/packages/grpc-js-xds/src/matcher.ts#L59 https://github.com/grpc/grpc-node/blob/e742b11bd8039f3dbea4cd29afdf5d95a8ba6b92/packages/grpc-js-xds/src/matcher.ts#L232 src/route.ts (getPredicateForStringMatcher / getPredicateForHeaderMatcher) builds these for every saferegex StringMatcher/HeaderMatcher, and src/rbac.ts uses them for RBAC urlpath…

Assessment

CVSS
4.8 (v3.1)
Severity
Medium
EPSS
0% chance of exploitation in the next 30 days
Known exploited
Not listed in CISA KEV
Exploit availability
Nothing found in Exploit-DB, Metasploit, Nuclei or public PoC repositories
Published
12 November 2026
Last updated
12 November 2026
Weakness
CWE-625, CWE-863
Assigner
GitHub_M

CVSS vectorCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N

At the source

References

Community proofs of concept

No community proof of concept yet. If you have one for a published vulnerability and the right to share it, add it below — it will appear here once reviewed.

Submit a proof of concept
Before you submit *

Query this programmatically

Agents can read this through the MCP endpoint, or over HTTP:

curl https://cve.zerocrew.in/api/cve/CVE-2026-126367