CINXE.COM
curl - NTLMv2 type-3 header stack buffer overflow - CVE-2019-3822
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>curl - NTLMv2 type-3 header stack buffer overflow - CVE-2019-3822</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"> <link rel="stylesheet" type="text/css" href="/curl.css"> <link rel="shortcut icon" href="/favicon.ico"> <link rel="icon" href="/logo/curl-symbol.svg" type="image/svg+xml"> <link rel="alternate" type="application/rss+xml" title="cURL Releases" href="https://github.com/curl/curl/releases.atom"> <link rel="stylesheet" type="text/css" href="/manpage.css"> <style> code { padding: 0px 4px 0px 4px; background-color: #f0f0f0; } (prefers-color-scheme: dark) { code { padding: 0px 4px 0px 4px; background-color: #101010; } } </style> </head> <body> <div class="main"> <div class="menu"> <a href="/docs/" class="menuitem" title="Documentation Overview">Docs Overview</a> <div class="dropdown"> <a class="dropbtn" href="/docs/projdocs.html">Project</a> <div class="dropdown-content"> <a href="/docs/bugbounty.html">Bug Bounty</a> <a href="/docs/bugs.html">Bug Report</a> <a href="/docs/code-of-conduct.html">Code of conduct</a> <a href="/docs/libs.html">Dependencies</a> <a href="/donation.html">Donate</a> <a href="/docs/faq.html">FAQ</a> <a href="/docs/features.html">Features</a> <a href="/docs/governance.html">Governance</a> <a href="/docs/history.html">History</a> <a href="/docs/install.html">Install</a> <a href="/docs/knownbugs.html">Known Bugs</a> <a href="/logo/">Logo</a> <a href="/docs/todo.html">TODO</a> <a href="/about.html">website Info</a> </div> </div> <div class="dropdown"> <a class="dropbtn" href="/docs/protdocs.html">Protocols</a> <div class="dropdown-content"> <a href="/docs/caextract.html">CA Extract</a> <a href="/docs/http-cookies.html">HTTP cookies</a> <a href="/docs/http3.html">HTTP/3</a> <a href="/docs/mqtt.html">MQTT</a> <a href="/docs/sslcerts.html">SSL certs</a> <a href="/docs/ssl-compared.html">SSL libs compared</a> <a href="/docs/url-syntax.html">URL syntax</a> <a href="/docs/websocket.html">WebSocket</a> </div> </div> <div class="dropdown"> <a class="dropbtn" href="/docs/reldocs.html">Releases</a> <div class="dropdown-content"> <a href="/ch/">Changelog</a> <a href="/docs/security.html">curl CVEs</a> <a href="/docs/releases.html">Release Table</a> <a href="/docs/versions.html">Version Numbering</a> <a href="/docs/vulnerabilities.html">Vulnerabilities</a> </div> </div> <div class="dropdown"> <a class="dropbtn" href="/docs/tooldocs.html">Tool</a> <div class="dropdown-content"> <a href="/docs/comparison-table.html">Comparison Table</a> <a href="/docs/manpage.html">curl man page</a> <a href="/docs/httpscripting.html">HTTP Scripting</a> <a href="/docs/mk-ca-bundle.html">mk-ca-bundle</a> <a href="/docs/tutorial.html">Tutorial</a> <a href="optionswhen.html">When options were added</a> </div> </div> <div class="dropdown"> <a class="dropbtn" href="/docs/whodocs.html">Who and Why</a> <div class="dropdown-content"> <a href="/docs/companies.html">Companies</a> <a href="/docs/copyright.html">Copyright</a> <a href="/sponsors.html">Sponsors</a> <a href="/docs/thanks.html">Thanks</a> <a href="/docs/thename.html">The name</a> </div> </div> </div> <div class="contents"> <div class="where"><a href="/">curl</a> / <a href="/docs/">Docs</a> / <a href="/docs/security.html">curl CVEs</a> / <b>NTLMv2 type-3 header stack buffer overflow</b></div> <div class="relatedbox"> <b>Related:</b> <br><a href="audits.html">Audits</a> <br><a href="/docs/bugbounty.html">Bug Bounty</a> <br><a href="/ch/">Changelog</a> <br><a href="security.html">curl CVEs</a> <br><a href="CVE-2019-3822.json">JSON metadata</a> <br><a href="/dev/vuln-disclosure.html">Vulnerability Disclosure</a> <br><a href="vulnerabilities.html">Vulnerabilities Table</a> </div> <h2>CVE-2019-3822</h2> <h1 id="ntlmv2-type-3-header-stack-buffer-overflow">NTLMv2 type-3 header stack buffer overflow</h1> <p>Project curl Security Advisory, February 6th 2019 - <a href="https://curl.se/docs/CVE-2019-3822.html">Permalink</a></p> <h2 id="vulnerability">VULNERABILITY</h2> <p>libcurl contains a stack based buffer overflow vulnerability.</p> <p>The function creating an outgoing NTLM type-3 header (<code>lib/vauth/ntlm.c:Curl_auth_create_ntlm_type3_message()</code>), 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.</p> <p>This output data can grow larger than the local buffer if very large response data is extracted from a previous NTLMv2 header provided by the malicious or broken HTTP server.</p> <p>Such large response data 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.</p> <h2 id="info">INFO</h2> <p>The Common Vulnerabilities and Exposures (CVE) project has assigned the name CVE-2019-3822 to this issue.</p> <p>CWE-121: Stack-based Buffer Overflow</p> <p>Severity: High</p> <h2 id="affected-versions">AFFECTED VERSIONS</h2> <p>Not every libcurl build has this code enabled. For example, it is not present when building with OpenSSL with MD4 disabled. See <code>lib/curl_ntlm_core.h</code> for details.</p> <ul> <li>Affected versions: libcurl <a href="vuln-7.36.0.html">7.36.0</a> to and including <a href="vuln-7.63.0.html">7.63.0</a></li> <li>Not affected versions: libcurl < <a href="vuln-7.36.0.html">7.36.0</a> and >= <a href="vuln-7.64.0.html">7.64.0</a></li> <li>Introduced-in: <a href="https://github.com/curl/curl/commit/86724581b6c">https://github.com/curl/curl/commit/86724581b6c</a></li> </ul> <p>libcurl is used by many applications, but not always advertised as such.</p> <h2 id="solution">SOLUTION</h2> <ul> <li>Fixed-in: <a href="https://github.com/curl/curl/commit/50c9484278c63b958655a7">https://github.com/curl/curl/commit/50c9484278c63b958655a7</a></li> </ul> <h2 id="recommendations">RECOMMENDATIONS</h2> <p>We suggest you take one of the following actions immediately, in order of preference:</p> <p>A - Upgrade curl to version <a href="vuln-7.64.0.html">7.64.0</a></p> <p>B - Apply the patch to your version and rebuild</p> <p>C - Turn off NTLM authentication</p> <h2 id="timeline">TIMELINE</h2> <p>It was reported to the curl project on December 30, 2018. We contacted distros@openwall on January 28.</p> <p>curl <a href="vuln-7.64.0.html">7.64.0</a> was released on February 6 2019, coordinated with the publication of this advisory.</p> <h2 id="credits">CREDITS</h2> <ul> <li>Reported-by: Wenxiang Qian of Tencent Blade Team</li> <li>Patched-by: Daniel Stenberg</li> <li>Help-by: Huzaifa Sidhpurwala</li> </ul> <p>Thanks a lot!</p> </div> </div> </body> </html>