Security Vulnerability Report
中文
CVE-2026-5460 CVSS 6.5 MEDIUM

CVE-2026-5460

Published: 2026-04-10 00:16:36
Last Modified: 2026-04-29 14:00:49

Description

A heap use-after-free exists in wolfSSL's TLS 1.3 post-quantum cryptography (PQC) hybrid KeyShare processing. In the error handling path of TLSX_KeyShare_ProcessPqcHybridClient() in src/tls.c, the inner function TLSX_KeyShare_ProcessPqcClient_ex() frees a KyberKey object upon encountering an error. The caller then invokes TLSX_KeyShare_FreeAll(), which attempts to call ForceZero() on the already-freed KyberKey, resulting in writes of zero bytes over freed heap memory.

CVSS Details

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

Configurations (Affected Products)

cpe:2.3:a:wolfssl:wolfssl:*:*:*:*:*:*:*:* - VULNERABLE
wolfSSL < 5.7.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-5460 * This code simulates the UAF condition where a KyberKey object * is freed and then accessed via ForceZero. */ #include <stdio.h> #include <stdlib.h> #include <string.h> typedef struct { int id; char secret_data[64]; } KyberKey; // Simulate the ForceZero function that zeroes out sensitive data void ForceZero(KyberKey* key) { if (key) { printf("[*] Calling ForceZero on pointer: %p\n", (void*)key); memset(key, 0, sizeof(KyberKey)); } } // Simulate the internal processing function that encounters an error void ProcessPqcClient_ex(KyberKey** key_ptr) { printf("[*] Processing PQC Client data...\n"); // Simulate an error condition printf("[!] Error encountered. Freeing KyberKey object.\n"); free(*key_ptr); *key_ptr = NULL; // In the actual bug, this might not be reflected to the caller immediately or logic is flawed } // Simulate the vulnerable caller function void TLSX_KeyShare_ProcessPqcHybridClient() { KyberKey* myKey = (KyberKey*)malloc(sizeof(KyberKey)); if (!myKey) return; myKey->id = 12345; strcpy(myKey->secret_data, "SENSITIVE_PQC_DATA"); // Call internal processing ProcessPqcClient_ex(&myKey); // Vulnerability: Caller assumes myKey might still need cleanup or logic error leads to double free/use-after-free // The bug description says: "caller then invokes TLSX_KeyShare_FreeAll(), which attempts to call ForceZero()" printf("[*] Error path invoked: Calling TLSX_KeyShare_FreeAll() -> ForceZero()\n"); // If the pointer wasn't nulled out properly in the caller's context, this triggers UAF // For simulation, let's assume the pointer value was stale or not updated correctly in the struct context KyberKey* staleKey = myKey; if (staleKey != NULL) { ForceZero(staleKey); // Use-After-Free occurs here } } int main() { printf("=== CVE-2026-5460 PoC Simulation ===\n"); TLSX_KeyShare_ProcessPqcHybridClient(); printf("=== PoC Finished ===\n"); return 0; }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-5460", "sourceIdentifier": "[email protected]", "published": "2026-04-10T00:16:36.033", "lastModified": "2026-04-29T14:00:49.420", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "A heap use-after-free exists in wolfSSL's TLS 1.3 post-quantum cryptography (PQC) hybrid KeyShare processing. In the error handling path of TLSX_KeyShare_ProcessPqcHybridClient() in src/tls.c, the inner function TLSX_KeyShare_ProcessPqcClient_ex() frees a KyberKey object upon encountering an error. The caller then invokes TLSX_KeyShare_FreeAll(), which attempts to call ForceZero() on the already-freed KyberKey, resulting in writes of zero bytes over freed heap memory."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X", "baseScore": 6.3, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "attackRequirements": "PRESENT", "privilegesRequired": "NONE", "userInteraction": "NONE", "vulnConfidentialityImpact": "NONE", "vulnIntegrityImpact": "LOW", "vulnAvailabilityImpact": "LOW", "subConfidentialityImpact": "NONE", "subIntegrityImpact": "NONE", "subAvailabilityImpact": "NONE", "exploitMaturity": "NOT_DEFINED", "confidentialityRequirement": "NOT_DEFINED", "integrityRequirement": "NOT_DEFINED", "availabilityRequirement": "NOT_DEFINED", "modifiedAttackVector": "NOT_DEFINED", "modifiedAttackComplexity": "NOT_DEFINED", "modifiedAttackRequirements": "NOT_DEFINED", "modifiedPrivilegesRequired": "NOT_DEFINED", "modifiedUserInteraction": "NOT_DEFINED", "modifiedVulnConfidentialityImpact": "NOT_DEFINED", "modifiedVulnIntegrityImpact": "NOT_DEFINED", "modifiedVulnAvailabilityImpact": "NOT_DEFINED", "modifiedSubConfidentialityImpact": "NOT_DEFINED", "modifiedSubIntegrityImpact": "NOT_DEFINED", "modifiedSubAvailabilityImpact": "NOT_DEFINED", "Safety": "NOT_DEFINED", "Automatable": "NOT_DEFINED", "Recovery": "NOT_DEFINED", "valueDensity": "NOT_DEFINED", "vulnerabilityResponseEffort": "NOT_DEFINED", "providerUrgency": "NOT_DEFINED"}}], "cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L", "baseScore": 6.5, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "LOW", "availabilityImpact": "LOW"}, "exploitabilityScore": 3.9, "impactScore": 2.5}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-416"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:wolfssl:wolfssl:*:*:*:*:*:*:*:*", "versionEndExcluding": "5.9.1", "matchCriteriaId": "261C41E4-7F04-4C98-AD63-110136730EE9"}]}]}], "references": [{"url": "https://github.com/wolfssl/wolfssl/pull/10092", "source": "[email protected]", "tags": ["Issue Tracking", "Patch"]}]}}