Bug 1430019 (CVE-2017-2640)

Summary: CVE-2017-2640 pidgin: Out-of-bounds write in purple_markup_unescape_entity triggered by invalid XML
Product: [Other] Security Response Reporter: Adam Mariš <amaris>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: anemec, besser82, cschalle, debarshir, ignatenko, itamar, jskarvad, jsynacek, mbarnes, security-response-team, stu
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: pidgin 2.12.0 Doc Type: If docs needed, set a value
Doc Text:
An out-of-bounds write flaw was found in the way Pidgin processed XML content. A malicious remote server could potentially use this flaw to crash Pidgin or execute arbitrary code in the context of the pidgin process.
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-25 11:26:11 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: 1431018, 1431022    
Bug Blocks: 1415638, 1428501, 1430021    
Attachments:
Description Flags
Upstream patch none

Description Adam Mariš 2017-03-07 16:41:12 UTC
An out-of-bounds write vulnerability was found in purple_markup_unescape_entity. It can be triggered by sending invalid XML entities separated by whitespace, eg "&#3000;". In default installation, this can get called only when receiving data from a server.

Upstream patch(es):

https://bitbucket.org/pidgin/main/commits/6745ecd124da91d6711ebab8812247bcd785939a
https://bitbucket.org/pidgin/main/commits/b2fc9e774cb9bf6bffcafa156c14a4c7b3640837

Comment 1 Adam Mariš 2017-03-07 16:41:19 UTC
Acknowledgments:

Name: the Pidgin project

Comment 2 Adam Mariš 2017-03-07 16:53:25 UTC
Created attachment 1260886 [details]
Upstream patch

Comment 3 Dhiru Kholia 2017-03-10 08:24:24 UTC
Created pidgin tracking bugs for this issue:

Affects: fedora-all [bug 1431018]

Comment 4 Dhiru Kholia 2017-03-10 08:25:17 UTC
Public via https://pidgin.im/news/security/ page.

Comment 7 Andrej Nemec 2017-03-10 08:55:00 UTC
*** Bug 1428500 has been marked as a duplicate of this bug. ***

Comment 8 Debarshi Ray 2017-03-28 12:43:38 UTC
Upstream fixes (from the Git mirror):

commit 2f79c62fde05b7e24dfaa421a03529ec593a7190
Author: Eion Robb <eionrobb>
Date:   Mon Feb 20 21:05:32 2017 +0000

    Use the more robust entity processing that @dequisdequis came up with
    
    --HG--
    branch : EionRobb/fix-for-crash-when-sending-invalid-xml-e-1487474010880

commit f2e987f01f58202d8a9b665eb1d8e1152fe399a2
Author: Eion Robb <eionrobb>
Date:   Sun Feb 19 03:13:47 2017 +0000

    Fix for crash when sending invalid xml entities separated by whitespace, eg "&# 3000;"
    
    --HG--
    branch : EionRobb/fix-for-crash-when-sending-invalid-xml-e-1487474010880

Comment 9 errata-xmlrpc 2017-08-01 20:21:11 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2017:1854 https://access.redhat.com/errata/RHSA-2017:1854