Bug 1123377 (CVE-2019-3822)

Summary: VUL-0: CVE-2019-3822: curl: NTLMv2 type-3 header stack buffer overflow
Product: [Novell Products] SUSE Security Incidents Reporter: Alexandros Toptsoglou <atoptsoglou>
Component: IncidentsAssignee: Security Team bot <security-team>
Status: RESOLVED FIXED QA Contact: Security Team bot <security-team>
Severity: Normal    
Priority: P3 - Medium CC: meissner, pmonrealgonzalez
Version: unspecified   
Target Milestone: ---   
Hardware: Other   
OS: Other   
URL: https://smash.suse.de/issue/223836/
Whiteboard: CVSSv3:SUSE:CVE-2019-3822:7.5:(AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H) CVSSv3:RedHat:CVE-2019-3822:7.1:(AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:H)
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Comment 4 Marcus Meissner 2019-01-29 06:28:05 UTC
CVE-2019-3822
Comment 7 Marcus Meissner 2019-02-06 07:46:41 UTC
is public now 

NTLMv2 type-3 header stack buffer overflow
==========================================

Project curl Security Advisory, February 6th 2019 -
[Permalink](https://curl.haxx.se/docs/CVE-2019-3822.html)

VULNERABILITY
-------------

libcurl contains a stack based buffer overflow vulnerability.

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.

We are not aware of any exploit of this flaw.

INFO
----

This bug was introduced in [commit
86724581b6c](https://github.com/curl/curl/commit/86724581b6c), January 2014.

The Common Vulnerabilities and Exposures (CVE) project has assigned the name
CVE-2019-3822 to this issue.

CWE-121: Stack-based Buffer Overflow

Severity: 7.3 (High)

AFFECTED VERSIONS
-----------------

- Affected versions: libcurl 7.36.0 to and including 7.63.0
- Not affected versions: libcurl < 7.36.0 and >= 7.64.0

libcurl is used by many applications, but not always advertised as such.

THE SOLUTION
------------

A [patch for CVE-2019-3822](https://github.com/curl/curl/commit/50c9484278c63b958655a717844f0721263939cc)

RECOMMENDATIONS
---------------

We suggest you take one of the following actions immediately, in order of
preference:

  A - Upgrade curl to version 7.64.0

  B - Apply the patch to your version and rebuild

  C - Turn off NTLM authentication

TIME LINE
---------

It was reported to the curl project on December 30, 2018. We contacted
distros@openwall on January 28.

curl 7.64.0 was released on February 6 2019, coordinated with the publication
of this advisory.

CREDITS
-------

Reported by Wenxiang Qian of Tencent Blade Team. Patch by Daniel Stenberg.

Thanks a lot!

-- 

  / daniel.haxx.se
Comment 8 Swamp Workflow Management 2019-02-06 11:11:03 UTC
SUSE-SU-2019:0248-1: An update that fixes three vulnerabilities is now available.

Category: security (important)
Bug References: 1123371,1123377,1123378
CVE References: CVE-2018-16890,CVE-2019-3822,CVE-2019-3823
Sources used:
SUSE Linux Enterprise Module for Open Buildservice Development Tools 15 (src):    curl-mini-7.60.0-3.17.1
SUSE Linux Enterprise Module for Basesystem 15 (src):    curl-7.60.0-3.17.1
Comment 9 Pedro Monreal Gonzalez 2019-02-06 11:28:51 UTC
Updated to 7.64.0 in Factory:
https://build.opensuse.org/request/show/672083
Comment 10 Swamp Workflow Management 2019-02-06 14:54:42 UTC
SUSE-SU-2019:0249-1: An update that fixes three vulnerabilities is now available.

Category: security (important)
Bug References: 1123371,1123377,1123378
CVE References: CVE-2018-16890,CVE-2019-3822,CVE-2019-3823
Sources used:
SUSE OpenStack Cloud 7 (src):    curl-7.37.0-37.34.1
SUSE Linux Enterprise Software Development Kit 12-SP3 (src):    curl-7.37.0-37.34.1
SUSE Linux Enterprise Server for SAP 12-SP2 (src):    curl-7.37.0-37.34.1
SUSE Linux Enterprise Server 12-SP3 (src):    curl-7.37.0-37.34.1
SUSE Linux Enterprise Server 12-SP2-LTSS (src):    curl-7.37.0-37.34.1
SUSE Linux Enterprise Server 12-SP2-BCL (src):    curl-7.37.0-37.34.1
SUSE Linux Enterprise Server 12-SP1-LTSS (src):    curl-7.37.0-37.34.1
SUSE Linux Enterprise Server 12-LTSS (src):    curl-7.37.0-37.34.1
SUSE Linux Enterprise Desktop 12-SP3 (src):    curl-7.37.0-37.34.1
SUSE Enterprise Storage 4 (src):    curl-7.37.0-37.34.1
SUSE CaaS Platform ALL (src):    curl-7.37.0-37.34.1
SUSE CaaS Platform 3.0 (src):    curl-7.37.0-37.34.1
OpenStack Cloud Magnum Orchestration 7 (src):    curl-7.37.0-37.34.1
Comment 11 Pedro Monreal Gonzalez 2019-02-07 12:08:22 UTC
Submitted to SUSE:SLE-12-SP4:Update:
https://build.suse.de/request/show/183785
Comment 14 Swamp Workflow Management 2019-02-13 11:11:53 UTC
SUSE-SU-2019:0339-1: An update that fixes 6 vulnerabilities is now available.

Category: security (important)
Bug References: 1112758,1113029,1113660,1123371,1123377,1123378
CVE References: CVE-2018-16839,CVE-2018-16840,CVE-2018-16842,CVE-2018-16890,CVE-2019-3822,CVE-2019-3823
Sources used:
SUSE Linux Enterprise Software Development Kit 12-SP4 (src):    curl-7.60.0-4.3.1
SUSE Linux Enterprise Server 12-SP4 (src):    curl-7.60.0-4.3.1
SUSE Linux Enterprise Desktop 12-SP4 (src):    curl-7.60.0-4.3.1
Comment 15 Swamp Workflow Management 2019-02-14 14:09:31 UTC
openSUSE-SU-2019:0173-1: An update that fixes three vulnerabilities is now available.

Category: security (important)
Bug References: 1123371,1123377,1123378
CVE References: CVE-2018-16890,CVE-2019-3822,CVE-2019-3823
Sources used:
openSUSE Leap 42.3 (src):    curl-7.37.0-45.1
Comment 16 Swamp Workflow Management 2019-02-14 14:11:23 UTC
openSUSE-SU-2019:0174-1: An update that fixes three vulnerabilities is now available.

Category: security (important)
Bug References: 1123371,1123377,1123378
CVE References: CVE-2018-16890,CVE-2019-3822,CVE-2019-3823
Sources used:
openSUSE Leap 15.0 (src):    curl-7.60.0-lp150.2.18.1, curl-mini-7.60.0-lp150.2.18.1
Comment 17 Marcus Meissner 2019-04-05 15:19:59 UTC
released
Comment 18 Swamp Workflow Management 2019-04-12 10:12:20 UTC
SUSE-SU-2019:0249-2: An update that fixes three vulnerabilities is now available.

Category: security (important)
Bug References: 1123371,1123377,1123378
CVE References: CVE-2018-16890,CVE-2019-3822,CVE-2019-3823
Sources used:
SUSE Linux Enterprise Server for SAP 12-SP1 (src):    curl-7.37.0-37.34.1

*** NOTE: This information is not intended to be used for external
    communication, because this may only be a partial fix.
    If you have questions please reach out to maintenance coordination.