Bug 1671377 (CVE-2018-19827)

Summary: CVE-2018-19827 libsass: Use-after-free in SharedPtr class resulting in a denial of service
Product: [Other] Security Response Reporter: Andrej Nemec <anemec>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED NOTABUG QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: aurelien, fmuellner, rschiron
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
A type confusion flaw was discovered in libsass in Expand::operator() in expand.cpp. An attacker could use this flaw to make an application that uses libsass crash or execute arbitrary code.
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-06-10 10:47:00 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1671395, 1671396, 1677702    
Bug Blocks: 1671393    

Description Andrej Nemec 2019-01-31 14:01:50 UTC
In LibSass 3.5.5, a use-after-free vulnerability exists in the SharedPtr class in SharedPtr.cpp (or SharedPtr.hpp) that may cause a denial of service (application crash) or possibly have unspecified other impact.

Upstream issue:

https://github.com/sass/libsass/issues/2782

Comment 1 Andrej Nemec 2019-01-31 14:16:30 UTC
Created libsass tracking bugs for this issue:

Affects: epel-7 [bug 1671396]
Affects: fedora-all [bug 1671395]

Comment 2 Riccardo Schirone 2019-02-15 14:49:10 UTC
Upstraem patch:
https://github.com/sass/libsass/commit/67a3f4ff9b790ed016197e6da4ef4e1d4c9da09f

Comment 3 Riccardo Schirone 2019-02-15 15:24:08 UTC
The use-after-free reported by ASAN is actually caused by a type confusion. In particular, function Expand::operator() in expand.cpp calls Expand::selector() which returns a Selector_List_Obj object. However, the result is assigned to a variable of type Selector_List_Ptr. This can lead to accessing invalid memory or possibly executing arbitrary code.