Security Vulnerability Report
中文
CVE-2026-34877 CVSS 9.8 CRITICAL

CVE-2026-34877

Published: 2026-04-02 17:16:27
Last Modified: 2026-04-06 21:06:00

Description

An issue was discovered in Mbed TLS versions from 2.19.0 up to 3.6.5, Mbed TLS 4.0.0. Insufficient protection of serialized SSL context or session structures allows an attacker who can modify the serialized structures to induce memory corruption, leading to arbitrary code execution. This is caused by Incorrect Use of Privileged APIs.

CVSS Details

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

Configurations (Affected Products)

cpe:2.3:a:arm:mbed_tls:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:arm:mbed_tls:4.0.0:*:*:*:*:*:*:* - VULNERABLE
Mbed TLS >= 2.19.0, <= 3.6.5
Mbed TLS 4.0.0

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
/* * Conceptual PoC for CVE-2026-34877 * This demonstrates the serialization and deserialization flow * where memory corruption occurs if the serialized data is modified. */ #include <stdio.h> #include <string.h> #include "mbedtls/ssl.h" // Simulated vulnerable function int trigger_vulnerability(unsigned char *malicious_data, size_t len) { mbedtls_ssl_context ssl; mbedtls_ssl_session session; mbedtls_ssl_init(&ssl); mbedtls_ssl_session_init(&session); // Vulnerability: Insufficient protection when deserializing // The library assumes the data is valid and trusted. // If 'malicious_data' is crafted to overflow buffers, // memory corruption occurs here. int ret = mbedtls_ssl_session_load(&session, malicious_data, len); if (ret != 0) { printf("Error loading session: -0x%04X\n", -ret); return -1; } // Further processing leading to potential code execution // ... mbedtls_ssl_session_free(&session); mbedtls_ssl_free(&ssl); return 0; } int main() { // Placeholder for actual malicious payload // Real exploit would involve specific byte offsets to corrupt // function pointers or heap metadata. unsigned char evil_data[] = { 0x00, 0x01, 0x02 /* Injected payload */ }; printf("Attempting to trigger CVE-2026-34877...\n"); trigger_vulnerability(evil_data, sizeof(evil_data)); return 0; }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-34877", "sourceIdentifier": "[email protected]", "published": "2026-04-02T17:16:26.927", "lastModified": "2026-04-06T21:06:00.037", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "An issue was discovered in Mbed TLS versions from 2.19.0 up to 3.6.5, Mbed TLS 4.0.0. Insufficient protection of serialized SSL context or session structures allows an attacker who can modify the serialized structures to induce memory corruption, leading to arbitrary code execution. This is caused by Incorrect Use of Privileged APIs."}], "metrics": {"cvssMetricV31": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "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": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-250"}, {"lang": "en", "value": "CWE-502"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:arm:mbed_tls:*:*:*:*:*:*:*:*", "versionStartIncluding": "2.19.0", "versionEndExcluding": "3.6.6", "matchCriteriaId": "60B71009-7D02-4B21-AB91-F0B821214B20"}, {"vulnerable": true, "criteria": "cpe:2.3:a:arm:mbed_tls:4.0.0:*:*:*:*:*:*:*", "matchCriteriaId": "8EF688FA-732F-4EAF-BAC6-AC3CDAF19588"}]}]}], "references": [{"url": "https://mbed-tls.readthedocs.io/en/latest/security-advisories/", "source": "[email protected]", "tags": ["Vendor Advisory"]}, {"url": "https://mbed-tls.readthedocs.io/en/latest/security-advisories/mbedtls-security-advisory-2026-03-serialized-data/", "source": "[email protected]", "tags": ["Vendor Advisory"]}]}}