CVE-2019-11873 in wolfSSLinfo

Summary

by MITRE

wolfSSL 4.0.0 has a Buffer Overflow in DoPreSharedKeys in tls13.c when a current identity size is greater than a client identity size. An attacker sends a crafted hello client packet over the network to a TLSv1.3 wolfSSL server. The length fields of the packet: record length, client hello length, total extensions length, PSK extension length, total identity length, and identity length contain their maximum value which is 2^16. The identity data field of the PSK extension of the packet contains the attack data, to be stored in the undefined memory (RAM) of the server. The size of the data is about 65 kB. Possibly the attacker can perform a remote code execution attack.

Once again VulDB remains the best source for vulnerability data.

Analysis

by VulDB Data Team • 09/24/2023

The vulnerability CVE-2019-11873 represents a critical buffer overflow flaw in wolfSSL version 4.0.0 that specifically affects TLSv1.3 implementations. This vulnerability resides within the DoPreSharedKeys function in the tls13.c file, where improper bounds checking occurs during the processing of pre-shared key extensions in TLS handshake messages. The flaw manifests when the server encounters a client hello packet containing a pre-shared key extension where the current identity size exceeds the client identity size, creating a condition that allows arbitrary memory corruption. This type of vulnerability falls under CWE-121, heap-based buffer overflow, and can be categorized as a memory safety issue within cryptographic protocol implementations.

The attack vector requires an unauthenticated network connection to a vulnerable wolfSSL server running TLSv1.3, making it particularly dangerous in network-facing applications. The exploit technique involves crafting a malicious client hello packet with carefully manipulated length fields set to maximum values of 2^16, including record length, client hello length, total extensions length, PSK extension length, total identity length, and identity length fields. The malicious packet contains approximately 65 kilobytes of attack data within the PSK extension's identity data field, which gets copied into server memory without proper bounds validation. This specific implementation flaw allows attackers to overwrite adjacent memory regions, potentially leading to arbitrary code execution, as the overflow can corrupt critical program data structures or return addresses.

The operational impact of this vulnerability extends beyond simple denial of service, as it can enable complete system compromise when successful. Attackers can leverage this buffer overflow to execute arbitrary code on the targeted server, potentially gaining full administrative control over the affected system. The vulnerability affects any application using wolfSSL 4.0.0 with TLSv1.3 enabled, including web servers, database servers, and other network services that rely on this cryptographic library. The memory corruption can lead to unpredictable behavior, application crashes, or more seriously, remote code execution that could be exploited for data exfiltration, privilege escalation, or establishing persistent backdoors. This vulnerability aligns with ATT&CK technique T1059.007 for command and scripting interpreter, where remote code execution could enable attackers to deploy malicious payloads.

Mitigation strategies for CVE-2019-11873 should prioritize immediate patching of wolfSSL installations to versions that address this buffer overflow vulnerability. Organizations should implement network segmentation and access controls to limit exposure of vulnerable services to untrusted networks. Additional defensive measures include monitoring network traffic for anomalous client hello packets with maximum length fields, implementing intrusion detection systems that can identify crafted malicious TLS handshakes, and conducting regular vulnerability assessments of cryptographic libraries in use. The fix typically involves adding proper bounds checking in the DoPreSharedKeys function to validate that identity data lengths do not exceed allocated buffer sizes before copying data into memory. Security teams should also consider implementing application firewalls and rate limiting to prevent exploitation attempts, while maintaining comprehensive logging of TLS handshake activities to detect potential attack attempts.

Reservation

05/10/2019

Moderation

accepted

CPE

ready

EPSS

0.08777

KEV

no

Activities

very low

Sources

Interested in the pricing of exploits?

See the underground prices here!