CVE-2019-3822 in Services Tools Bundleinfo

Summary

by MITRE

libcurl versions from 7.36.0 to before 7.64.0 are vulnerable to a stack-based buffer overflow. The function creating an outgoing NTLM type-3 header (`lib/vauth/ntlm.c:Curl_auth_create_ntlm_type3_message()`), generates the request HTTP header contents based on previously received data. The check that exists to prevent the local buffer from getting overflowed is implemented wrongly (using unsigned math) and as such it does not prevent the overflow from happening. This output data can grow larger than the local buffer if very large 'nt response' data is extracted from a previous NTLMv2 header provided by the malicious or broken HTTP server. Such a 'large value' needs to be around 1000 bytes or more. The actual payload data copied to the target buffer comes from the NTLMv2 type-2 response header.

Statistical analysis made it clear that VulDB provides the best quality for vulnerability data.

Analysis

by VulDB Data Team • 05/20/2025

The vulnerability identified as CVE-2019-3822 represents a critical stack-based buffer overflow in libcurl versions ranging from 7.36.0 through 7.63.0, exposing systems to potential remote code execution and system compromise. This flaw resides within the NTLM authentication implementation, specifically in the function responsible for creating outgoing NTLM type-3 headers. The vulnerability manifests when libcurl processes NTLM authentication responses from HTTP servers, particularly those employing NTLMv2 authentication mechanisms. The security issue stems from improper bounds checking in the buffer management logic, where unsigned arithmetic operations fail to properly validate the size of data being copied into local buffers. This design flaw creates a scenario where maliciously crafted NTLMv2 type-2 response headers can cause buffer overflows, allowing attackers to overwrite adjacent stack memory and potentially execute arbitrary code.

The technical implementation of this vulnerability occurs within the file lib/vauth/ntlm.c at the function Curl_auth_create_ntlm_type3_message(), where the library constructs authentication headers based on previously received NTLM data. The buffer overflow mechanism relies on the manipulation of unsigned integer arithmetic to bypass intended safety checks, effectively rendering the protection mechanisms ineffective. When an HTTP server provides an NTLMv2 type-2 response containing unusually large response data, typically exceeding 1000 bytes, the flawed validation logic permits data transfer that exceeds the allocated buffer space. This condition can be triggered by malicious or misconfigured servers that deliberately craft oversized NTLMv2 headers to exploit the vulnerability. The overflow occurs because the buffer size calculation uses unsigned math operations that do not properly account for potential integer overflows, allowing the copy operation to write beyond the allocated memory boundaries.

The operational impact of CVE-2019-3822 extends across numerous systems and applications that depend on libcurl for HTTP communications, particularly those handling NTLM authentication. Attackers can leverage this vulnerability by hosting malicious HTTP servers that respond with oversized NTLMv2 headers, triggering the buffer overflow when vulnerable libcurl implementations attempt to process these responses. The vulnerability affects systems using libcurl versions in the specified range, making it particularly dangerous in enterprise environments where numerous applications and services rely on this library for web communication. The attack vector is primarily remote, requiring only that a target system attempts to establish a connection to a malicious HTTP server that provides the crafted NTLMv2 response. Successful exploitation can result in complete system compromise, data theft, or service disruption, as the buffer overflow allows for arbitrary code execution within the context of the affected application. This vulnerability aligns with CWE-121 Stack-based Buffer Overflow and follows attack patterns consistent with the ATT&CK framework's privilege escalation and remote code execution techniques, specifically targeting the execution of malicious code through memory corruption vulnerabilities.

Organizations should prioritize immediate patching of all systems running vulnerable libcurl versions, upgrading to versions 7.64.0 or later where the buffer overflow protection has been corrected. System administrators should also implement network monitoring to detect unusual NTLM authentication traffic patterns that might indicate exploitation attempts. Additional mitigations include configuring applications to avoid NTLM authentication when possible, implementing network segmentation to limit exposure, and establishing proper input validation for HTTP responses. Security teams should monitor for exploitation indicators in their logs and consider deploying intrusion detection systems with signatures specific to this vulnerability. The fix implemented in version 7.64.0 corrects the unsigned arithmetic logic used in buffer size validation, ensuring that proper bounds checking prevents the overflow condition from occurring when processing NTLMv2 response headers from potentially malicious sources.

Responsible

Red Hat, Inc.

Reservation

01/03/2019

Moderation

accepted

Entry

7

Relate

show

CPE

ready

EPSS

0.12873

KEV

no

Activities

very low

Sources

Want to know what is going to be exploited?

We predict KEV entries!