CVE-2026-4395
Heap Overflow in wolfSSL KCAPI ECC Enables Remote Exploit
Publication date: 2026-03-19
Last updated on: 2026-03-26
Assigner: wolfSSL Inc.
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| wolfssl | wolfssl | to 5.9.0 (exc) |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-122 | A heap overflow condition is a buffer overflow, where the buffer that can be overwritten is allocated in the heap portion of memory, generally meaning that the buffer was allocated using a routine such as malloc(). |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
[{'type': 'paragraph', 'content': "This vulnerability is a heap-based buffer overflow in the wolfSSL library's KCAPI ECC code path, specifically in the function wc_ecc_import_x963_ex(). It occurs because the function copies an EC public key point into a fixed-size buffer (pubkey_raw) without checking if the input size exceeds the buffer's capacity. A remote attacker can exploit this by sending a crafted oversized EC public key during a TLS key exchange, causing data to be written beyond the buffer's bounds."}, {'type': 'paragraph', 'content': 'The issue arises because the WOLFSSL_KCAPI_ECC code path uses XMEMCPY to copy the input directly without validating its length, unlike other code paths that perform length checks. This can lead to memory corruption or security issues.'}, {'type': 'paragraph', 'content': 'The vulnerability was fixed by adding a length check before copying the public key data, ensuring that if the input is larger than the buffer, the function returns an error instead of copying the data.'}] [1]
How can this vulnerability impact me? :
[{'type': 'paragraph', 'content': 'This vulnerability can allow a remote attacker to cause a buffer overflow by sending a specially crafted EC public key during a TLS key exchange. The overflow can lead to memory corruption, which might be exploited to crash the application, cause denial of service, or potentially execute arbitrary code.'}, {'type': 'paragraph', 'content': "Because the vulnerability occurs during TLS key exchange, it affects the security and stability of encrypted communications that rely on wolfSSL's ECC implementation under the KCAPI configuration."}] [1]
How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:
I don't know
How can this vulnerability be detected on my network or system? Can you suggest some commands?
[{'type': 'paragraph', 'content': "This vulnerability occurs during the TLS key exchange when a malicious peer sends a crafted ECPoint in ServerKeyExchange that triggers a heap-based buffer overflow in the wolfSSL library's ECC key import function. Detection involves monitoring TLS handshake messages for unusually large or malformed EC public key points."}, {'type': 'paragraph', 'content': 'Since the vulnerability is triggered by a crafted oversized EC public key point, network detection could involve inspecting TLS ServerKeyExchange messages for ECPoints exceeding expected sizes.'}, {'type': 'paragraph', 'content': 'However, no specific detection commands or tools are provided in the available resources.'}] [1]
What immediate steps should I take to mitigate this vulnerability?
The immediate mitigation step is to update the wolfSSL library to version 5.9.0 or later, which includes the fix for this vulnerability.
The fix introduces a length check before copying the EC public key data, preventing buffer overflow by returning an error if the input exceeds the buffer size.
Until the update is applied, consider restricting or monitoring TLS connections that use the WOLFSSL_KCAPI_ECC configuration to reduce exposure.