Bug 1223813 (CVE-2015-4041)

Summary: CVE-2015-4041 coreutils: heap buffer overflow in sort(1) keycompare_mb()
Product: [Other] Security Response Reporter: Vasyl Kaigorodov <vkaigoro>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED WONTFIX QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: admiller, jrusnack, kdudka, kzak, ooprala, ovasik, pbrady, p, slukasik, twaugh, vkaigoro
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-06-30 13:48:56 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: 1223821    
Bug Blocks: 1223819    

Description Vasyl Kaigorodov 2015-05-21 13:25:45 UTC
It was reported that a heap overflow can be triggered in sort(1).
This appears to be caused by performing a size calculation without properly considering the number of bytes occupied by multibyte characters.

Initial report: https://bugzilla.suse.com/show_bug.cgi?id=928749
Fix: https://github.com/pixelb/coreutils/commit/bea5e36cc876ed627bb5e0eca36fdfaa6465e940
CVE assignment: http://seclists.org/oss-sec/2015/q2/502

Comment 1 Vasyl Kaigorodov 2015-05-21 13:35:25 UTC
Created coreutils tracking bugs for this issue:

Affects: fedora-all [bug 1223821]

Comment 2 Ondrej Vasik 2015-05-22 08:02:59 UTC
I believe heap buffer overflow affects only older versions of sort i18n patch (IOW only one of CVEs is valid for current Fedora patch, another one is valid only for RHEL 6 and older). LC_ALL=C sort code path is completely unaffected. Do you plan to create RHEL 6/7 bz for this CVE? Actually I think this (and previous similar flaws in i18n patch that got CVE as well) was the primary reason why P.Brady contacted secalert about this issue.

Comment 7 Huzaifa S. Sidhpurwala 2020-02-11 03:34:49 UTC
Mitigation:

This flaw is triggered by using sort on specially crafted malicious data file. When using sort with trusted inputs, this flaw cannot be triggered.