Bug 1139937 - (CVE-2018-20843) VUL-0: CVE-2018-20843: expat: large number of colons in input makes parser consume high amount of resources
(CVE-2018-20843)
VUL-0: CVE-2018-20843: expat: large number of colons in input makes parser co...
Status: RESOLVED FIXED
Classification: Novell Products
Product: SUSE Security Incidents
Classification: Novell Products
Component: Incidents
unspecified
Other Other
: P3 - Medium : Normal
: ---
Assigned To: Security Team bot
Security Team bot
https://smash.suse.de/issue/235643/
CVSSv3:RedHat:CVE-2018-20843:5.3:(AV:...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-07-01 14:18 UTC by Alexandros Toptsoglou
Modified: 2021-09-08 10:35 UTC (History)
2 users (show)

See Also:
Found By: Security Response Team
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
POC (87.75 KB, text/plain)
2019-07-01 14:24 UTC, Alexandros Toptsoglou
Details

Note You need to log in before you can comment on or make changes to this bug.
Comment 1 Alexandros Toptsoglou 2019-07-01 14:23:42 UTC
All codestreams seem affected. Tried to reproduce the issue in Leap 15 and SLE12-sp4 by running: 
 valgrind xmlwf clusterfuzz-testcase-4543406568112128.txt 
==16501== Memcheck, a memory error detector
==16501== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==16501== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==16501== Command: xmlwf clusterfuzz-testcase-4543406568112128.txt
==16501== 
clusterfuzz-testcase-4543406568112128.txt:1:88403: no element found
==16501== 
==16501== HEAP SUMMARY:
==16501==     in use at exit: 0 bytes in 0 blocks
==16501==   total heap usage: 108,147 allocs, 108,147 frees, 3,195,441,732 bytes allocated
==16501== 
==16501== All heap blocks were freed -- no leaks are possible
==16501== 
==16501== For counts of detected and suppressed errors, rerun with: -v
==16501== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

As you can see 3GBs are allocated. 
The POC is attached. 
The version 2.2.7 will contain the fix. The fix is also available at [1]. 

[1] https://github.com/libexpat/libexpat/commit/11f8838bf99ea0a6f0b76f9760c43704d00c4ff6
Comment 2 Alexandros Toptsoglou 2019-07-01 14:24:16 UTC
Created attachment 809039 [details]
POC
Comment 3 Pedro Monreal Gonzalez 2019-07-02 11:39:46 UTC
The patch fixes the issue, see that now allocates much less memory. Tested in SLE-15 and Factory:

# valgrind xmlwf clusterfuzz-testcase-4543406568112128.txt
==3980== Memcheck, a memory error detector
==3980== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==3980== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info
==3980== Command: xmlwf clusterfuzz-testcase-4543406568112128.txt
==3980== 
clusterfuzz-testcase-4543406568112128.txt:1:88403: no element found
==3980== 
==3980== HEAP SUMMARY:
==3980==     in use at exit: 0 bytes in 0 blocks
==3980==   total heap usage: 19 allocs, 19 frees, 398,252 bytes allocated
==3980== 
==3980== All heap blocks were freed -- no leaks are possible
==3980== 
==3980== For counts of detected and suppressed errors, rerun with: -v
==3980== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

I'll submit now.
Comment 4 Pedro Monreal Gonzalez 2019-07-02 12:11:06 UTC
Updated to version 2.2.7 in Factory:
https://build.opensuse.org/request/show/713044
Comment 7 Swamp Workflow Management 2019-07-04 12:50:07 UTC
This is an autogenerated message for OBS integration:
This bug (1139937) was mentioned in
https://build.opensuse.org/request/show/713395 Factory / expat
Comment 8 Swamp Workflow Management 2019-07-12 19:11:36 UTC
SUSE-SU-2019:1835-1: An update that fixes one vulnerability is now available.

Category: security (moderate)
Bug References: 1139937
CVE References: CVE-2018-20843
Sources used:
SUSE Linux Enterprise Module for Open Buildservice Development Tools 15-SP1 (src):    expat-2.2.5-3.3.1
SUSE Linux Enterprise Module for Basesystem 15-SP1 (src):    expat-2.2.5-3.3.1
SUSE Linux Enterprise Module for Basesystem 15 (src):    expat-2.2.5-3.3.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 9 Swamp Workflow Management 2019-07-12 19:13:49 UTC
SUSE-SU-2019:1834-1: An update that fixes one vulnerability is now available.

Category: security (moderate)
Bug References: 1139937
CVE References: CVE-2018-20843
Sources used:
SUSE Linux Enterprise Software Development Kit 12-SP4 (src):    expat-2.1.0-21.6.1
SUSE Linux Enterprise Server 12-SP4 (src):    expat-2.1.0-21.6.1
SUSE Linux Enterprise Desktop 12-SP4 (src):    expat-2.1.0-21.6.1
SUSE CaaS Platform 3.0 (src):    expat-2.1.0-21.6.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 10 Swamp Workflow Management 2019-07-18 12:48:56 UTC
An update workflow for this issue was started.
This issue was rated as moderate.
Please submit fixed packages until 2019-08-01.
When done, reassign the bug to security-team@suse.de.
https://swamp.suse.de/webswamp/wf/64319
Comment 11 Swamp Workflow Management 2019-07-21 10:25:53 UTC
openSUSE-SU-2019:1777-1: An update that fixes one vulnerability is now available.

Category: security (moderate)
Bug References: 1139937
CVE References: CVE-2018-20843
Sources used:
openSUSE Leap 15.1 (src):    expat-2.2.5-lp151.3.3.1
openSUSE Leap 15.0 (src):    expat-2.2.5-lp150.2.3.1
Comment 12 Alexandros Toptsoglou 2020-05-06 13:43:49 UTC
Done