Severity by source
AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
Primary rating from GitHub Advisory · only source for this CVE.
CVSS VectorGitHub Advisory
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
Lifecycle Timeline
3DescriptionGitHub Advisory
OAuth State Validation Bypass via error Parameter Causes Local Server DoS in MCP Auth Callback
---
Description
The OpenClaude MCP authentication flow starts a temporary local HTTP server to handle OAuth callbacks. To prevent CSRF attacks, the server validates a state parameter against an internally stored value. However, due to a logic flaw in the order of conditionals, an attacker can completely bypass this check and force the server to shut down - without knowing the state value at all.
The vulnerable code looks like this:
if (!error && state !== oauthState) {
rejectOnce(new Error('OAuth state mismatch - possible CSRF attack'))
return
}
if (error) {
cleanup()
rejectOnce(new Error(errorMessage))
return
}When a request arrives with an error query parameter (e.g., ?error=anything), the first condition becomes false because !error evaluates to false. This means the CSRF check is never reached. Execution falls through to the second block, where cleanup() is called - shutting down the local server and terminating the user's active authentication session.
The attacker does not need to know the state value. Any request containing an error parameter is enough to trigger the shutdown.
---
Impact
- The user's OAuth flow is silently terminated mid-session
- The local callback server is shut down (Denial of Service)
- Can be triggered remotely via a malicious web page using a cross-origin request (CSRF)
- No authentication or prior knowledge of the
statevalue is required
---
Steps to Reproduce
Save the following as poc.js and run with Node.js:
import { createServer } from 'http';
import { parse } from 'url';
const expectedState = "secure_state_abc123";
const server = createServer((req, res) => {
const parsedUrl = parse(req.url || '', true);
const { pathname, query } = parsedUrl;
const { state, error } = query;
if (pathname === '/callback') {
// Vulnerable: error param causes state check to be skipped entirely
if (!error && state !== expectedState) {
res.writeHead(400);
res.end('State mismatch');
console.log('[-] CSRF attempt blocked.');
return;
}
if (error) {
res.writeHead(200);
res.end(`Error: ${error}`);
console.log(`[!] Server shutting down. Triggered by: ${error}`);
server.close();
return;
}
}
});
server.listen(12345, '127.0.0.1', () => {
console.log('Listening on http://127.0.0.1:12345');
});Terminal 1 - start the server:
node poc.jsTerminal 2 - trigger the bypass:
curl "http://127.0.0.1:12345/callback?error=triggered"Expected result: Server shuts down immediately. The state value was never checked.
---
Root Cause
The CSRF protection is conditioned on !error, meaning it is silently disabled whenever an error parameter is present. The two checks need to be decoupled - state validation must happen first, independently of any other parameters.
---
Fix
Move the state check before the error check, and remove the dependency on !error:
// Fixed
if (state !== oauthState) {
cleanup()
rejectOnce(new Error('OAuth state mismatch - possible CSRF attack'))
return
}
if (error) {
cleanup()
rejectOnce(new Error(errorMessage))
return
}With this change, any request - whether it contains an error parameter or not - must first pass the state validation before any further processing occurs.
---
Credit: Xanlar Agamalizade
AnalysisAI
OpenClaude MCP's OAuth callback handler in Node.js can be shut down via CSRF attack by sending a request with any error query parameter, bypassing state validation entirely without knowledge of the CSRF token. The vulnerability allows unauthenticated remote attackers to terminate a user's active authentication session and force server shutdown due to a logic flaw where the error parameter check precedes and disables the state validation check. Vendor-released patch version 0.5.1 available.
Technical ContextAI
OpenClaude MCP implements a temporary local HTTP server (listening on 127.0.0.1:12345 or similar) to handle OAuth 2.0 callback authentication flows. The server validates an opaque state parameter to prevent Cross-Site Request Forgery (CSRF) attacks per RFC 6749. The vulnerability exists in the conditional logic of the callback handler: the first if statement checks !error && state !== oauthState, meaning the state validation is only executed when the error parameter is absent. If an error parameter is present (even with any arbitrary value), the negation !error evaluates false, the entire condition short-circuits, and execution falls through to the second if (error) block, which calls cleanup() to shut down the server without ever validating the state. This is a classic conditional logic error (CWE-352: Cross-Site Request Forgery) where security-critical validation is inadvertently disabled by improper ordering and conditional dependencies.
RemediationAI
Vendor-released patch: upgrade to @gitlawb/openclaude v0.5.1 or later via npm install @gitlawb/openclaude@latest or npm update @gitlawb/openclaude. The fix refactors the OAuth callback validation logic into a separate validateOAuthCallbackParams() function that unconditionally validates the state parameter first (before any error or code checks), ensuring that all requests - regardless of the presence of an error parameter - must pass CSRF state validation before proceeding. The patched code removes the problematic !error condition from the state check, decoupling it from error handling. Until patching is possible, no effective workaround exists because the vulnerability is in the core authentication handler; however, users can mitigate exposure by minimizing the duration of active OAuth authentication sessions and avoiding clicking untrusted links while in the midst of an authentication flow. The GitHub advisory at https://github.com/Gitlawb/openclaude/security/advisories/GHSA-c73c-x77g-854r provides additional context and confirmation of the fix.
FortiOS and FortiProxy contain an authentication bypass via the Node.js websocket module allowing unauthenticated remote
Eval injection vulnerability in the internals.batch function in lib/batch.js in the bassmaster plugin before 1.5.2 for t
Flowise version 3.0.5 contains a remote code execution vulnerability in the CustomMCP node. The mcpServerConfig paramete
Node.js 8.5.0 before 8.6.0 allows remote attackers to access unintended files, because a change to ".." handling was inc
An issue was discovered in the node-serialize package 0.0.4 for Node.js. Rated critical severity (CVSS 9.8), this vulner
Directory traversal vulnerability in the st module before 0.2.5 for Node.js allows remote attackers to read arbitrary fi
Multiple SQL injection vulnerabilities in the Manage Accounts page in the AccountManagement.asmx service in the Solarwin
The JS-YAML module before 2.0.5 for Node.js parses input without properly considering the unsafe !!js/function tag, whic
Directory traversal vulnerability in lib/app/index.js in Geddy before 13.0.8 for Node.js allows remote attackers to read
Credential-harvesting malware compromised 84 versions of 42 TanStack npm packages on 2026-05-11 via chained GitHub Actio
Eval injection vulnerability in index.js in the syntax-error package before 1.1.1 for Node.js 0.10.x, as used in IBM Rat
The HTTP server in Node.js 0.10.x before 0.10.21 and 0.8.x before 0.8.26 allows remote attackers to cause a denial of se
Same weakness CWE-352 – Cross-Site Request Forgery (CSRF)
View allSame technique Denial Of Service
View allShare
External POC / Exploit Code
Leaving vuln.today
EUVD-2026-33973
GHSA-c73c-x77g-854r