CVE-2026-107162: Express Gateway OAuth 2.0 Refresh Token Validation Bypass and Identity Impersonation
HERMES THREAT SCORE & GATEWAY SECURITY EVALUATION
Target:Express Gateway โ OAuth 2.0 Server Policy & Token Service (oauth2-server.js & token.service.js) Traditional CVSS v3.1 rates this vulnerability at 8.8 (High) on the basis that the attacker must supply valid client credentials to invoke the OAuth token endpoint. The Hermes Threat Score assesses it at 89 (HIGH) with an Agentic Security Score (HASS) of 68 (MODERATE). Express Gateway functions as the edge ingress proxy and centralized policy enforcement point for microservice architectures. When handling refresh_token grant exchanges, the gateway validates that the requesting client is authenticated, but fails to check that the refresh token was originally granted to that specific client ID, and fails to verify the token secret. In multi-tenant environments or platforms allowing partner/developer client registration, any low-privilege client application can exchange the stolen or discovered refresh token ID of any user or administrator for a newly minted access token with all original scopes, achieving complete identity takeover across downstream backend APIs.
CVE-2026-107162: Express Gateway OAuth 2.0 Refresh Token Validation Bypass and Identity ImpersonationVULNERABILITY
Software platform affected by security vulnerabilities and agentic attack patterns.
๐ Why is this related? (Evidence & Provenance)
“Confirmed security vulnerability in Express Gateway API Proxy documented in Hermes dossier.”
- [vulnerability_report]
- [government_confirmation]CISA verified active exploitation in the wild and mandated federal remediation deadline in KEV entry. — Source: Cybersecurity & Infrastructure Security Agency (CISA): CISA Adds CVE-2026-59822 to Known Exploited Vulnerabilities Catalog (Reliability: VERY_HIGH)
1. Technical Context & Affected Architecture Matrix
Section titled โ1. Technical Context & Affected Architecture MatrixโExpress Gateway sits at the network boundary, routing incoming client traffic to upstream microservices based on declarative YAML pipelines. In an OAuth 2.0 setup, it issues JWT access tokens and long-lived refresh tokens stored in Redis.
| Parameter | Technical Specification | Operational Details |
|---|---|---|
| CVE Identifier | CVE-2026-107162 | International security tracking identifier |
| Software Platform | Express Gateway | Enterprise microservices API gateway built on Express.js |
| Vulnerable Components | lib/policies/oauth2/oauth2-server.js & lib/services/tokens/token.service.js | OAuth 2.0 refresh token handler and token validation logic |
| Vulnerability Class | CWE-287 / CWE-303 | Improper Authentication / Cross-Client Token Exchange |
| Attack Vector | Network (Port 8080/tcp / OAuth Token Endpoint) | Authenticated HTTP POST to /oauth/token with grant_type=refresh_token |
| Remediation Release | Express Gateway v1.16.12 | Strict client binding validation and cryptographic token secret matching |
[ Attacker App (Client A) ] [ Legitimate User (Client B) ] | | Possesses valid credentials Issued valid refresh_token client_id: "attacker-app" token_id: "rt-uuid-victim-99" \ / \ / POST /oauth/token / grant_type=refresh_token / client_id="attacker-app" / refresh_token="rt-uuid-victim-99" / \ / v v +----------------------------------------------------+ | Express Gateway Perimeter Proxy | | oauth2-server.js | +----------------------------------------------------+ | Step 1: Authenticate Client A? (PASS) Step 2: Look up Token "rt-uuid-victim-99"? (FOUND) Step 3: Validate Token.clientId == Client A? (OMITTED!) Step 4: Verify Token Secret against Client? (OMITTED!) | v +----------------------------------------------------+ | Mint New Access Token for VICTIM User | | Issuer: Express Gateway | | Subject: victim-admin@corp.internal | | Scopes: [ "admin", "billing", "write" ] | +----------------------------------------------------+ | v +----------------------------------------------------+ | Downstream Microservices | | Attacker accesses private APIs as VICTIM | +----------------------------------------------------+2. Root Cause Analysis & Vulnerable Code Anatomy
Section titled โ2. Root Cause Analysis & Vulnerable Code AnatomyโThe root cause resides in lib/policies/oauth2/oauth2-server.js inside the exchangeRefreshToken handler.
When a client exchanges a refresh token for an access token, OAuth 2.0 (RFC 6749 Section 6) requires the authorization server to authenticate the client AND ensure that the refresh token was issued to that authenticated client:
// Vulnerable excerpt from lib/policies/oauth2/oauth2-server.jsserver.exchange(oauth2orize.exchange.refreshToken((client, refreshToken, scope, done) => { // Client is successfully authenticated (Client A) tokenService.get(refreshToken) .then(token => { if (!token) { return done(null, false); }
// CRITICAL FLAW: The code checks expiration, but fails to check: // token.clientId === client.id ! if (tokenService.isExpired(token)) { return done(null, false); }
// Token secret is not matched against client credentials // The gateway generates an access token for token.userId without verifying ownership! return tokenService.findOrSaveAccessToken({ userId: token.userId, clientId: client.id, // Rebinds access token to requesting client! scopes: token.scopes }); }) .then(accessToken => done(null, accessToken.id)) .catch(err => done(err));}));Why this enables cross-tenant account takeover
Section titled โWhy this enables cross-tenant account takeoverโBecause token.clientId === client.id is not verified, any client entity registered on the gateway can redeem any other userโs refresh token. Refresh token identifiers (often UUIDs or predictable tokens) frequently appear in log aggregators, proxy access logs, referer headers, or client-side storage where other users or apps can discover them.
3. Weaponization Chain & Attack Vectors
Section titled โ3. Weaponization Chain & Attack VectorsโThe attack sequence follows four discrete phases:
[Token Identifier Recon] โโ> [Client Authentication] โโ> [Refresh Grant Request] โโ> [Perimeter Takeover]Obtain victim refresh ID Use attacker client creds POST /oauth/token Receive valid access tokenFrom logs/telemetry/leaks client_id & client_secret grant_type=refresh_token Impersonate victim identityExploit Demonstration
Section titled โExploit DemonstrationโAn attacker with a standard registered client application issues a refresh token grant specifying the victim userโs refresh token:
POST /oauth/token HTTP/1.1Host: api.enterprise.internal:8080Authorization: Basic YXR0YWNrZXItYXBwOmF0dGFja2VyLXNlY3JldA==Content-Type: application/x-www-form-urlencoded
grant_type=refresh_token&refresh_token=9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4dBecause the attackerโs client credentials (attacker-app:attacker-secret) are valid, Express Gateway accepts the request, retrieves the refresh token metadata for victim-user, and responds:
{ "token_type": "Bearer", "access_token": "eg-acc-4f9e8d7c6b5a43210fedcba987654321", "expires_in": 3600, "scope": "admin billing read write"}The attacker now possesses a valid Bearer token for the victim user, allowing complete bypass of downstream microservice authentication.
4. Forensic Triage & Threat Hunting
Section titled โ4. Forensic Triage & Threat HuntingโDFIR teams investigating potential abuse of CVE-2026-107162 should compare client identifiers associated with token issuance against the client identifiers presenting refresh requests in token logs.
title: Express Gateway Discrepant Client OAuth Token Refreshid: 1a8c3d90-77f2-4b61-9c88-e87f3b610162status: experimentaldescription: Detects OAuth 2.0 refresh token exchanges where the requesting client does not match the original issuing client.author: Hermes Codex Cyber Threat Intelligencedate: 2026-10-08logsource: category: application product: express_gateway / api_gatewaydetection: selection: event_type: 'oauth.token_refresh' status: 'success' condition: selection and (requesting_client_id != token_issuing_client_id)fields: - requesting_client_id - token_issuing_client_id - user_id - src_iplevel: hightags: - attack.credential_access - attack.t1550.001 - cve.cve-2026-107162// Microsoft Sentinel Query: Detect mismatched client IDs in API Gateway OAuth exchange logsAppEvents| where ActionType == "OAuthTokenRefresh"| extend RequestingClient = tostring(parse_json(CustomDimensions).client_id), OriginalClient = tostring(parse_json(CustomDimensions).token_client_id), UserId = tostring(parse_json(CustomDimensions).user_id)| where isnotempty(OriginalClient) and RequestingClient != OriginalClient| project TimeGenerated, IPAddress, RequestingClient, OriginalClient, UserId| order by TimeGenerated descindex=gateway sourcetype=express_gateway grant_type="refresh_token"| eval mismatch = if(client_id != original_token_client_id, 1, 0)| where mismatch == 1| table _time, src_ip, client_id, original_token_client_id, user_id#!/usr/bin/env bash# Inspect Redis token records for Express Gateway to identify active tokensecho "[*] Auditing Express Gateway OAuth tokens in Redis..."redis-cli KEYS "eg:token:*" | while read key; do TYPE=$(redis-cli HGET "$key" "type") if [ "$TYPE" = "refresh_token" ]; then CLIENT=$(redis-cli HGET "$key" "clientId") USER=$(redis-cli HGET "$key" "userId") echo "Token: $key | Client: $CLIENT | User: $USER" fidone5. Remediation & Hardening Strategy
Section titled โ5. Remediation & Hardening Strategyโ-
Upgrade Express Gateway: Upgrade to version
1.16.12or higher across all gateway instances:Terminal window npm install -g express-gateway@latest# or within your gateway projectnpm install express-gateway@1.16.12 -
Revoke Active Refresh Tokens: Because vulnerable versions allowed cross-client token redemption, flush or expire outstanding refresh tokens to terminate potentially hijacked sessions:
Terminal window # Flush gateway token namespace in Redisredis-cli --eval "return redis.call('del', unpack(redis.call('keys', 'eg:token:*')))" -
Enforce Refresh Token Rotation (RTR): Configure your gateway OAuth2 policy to invalidate the submitted refresh token upon every refresh exchange and issue a brand-new token pair, preventing token replay attacks.
-
Restrict Client Registration: Disable public client self-registration in production environments (
system.config.yml), ensuring only authenticated administrators can provision OAuth2 client credentials.