Bug 1495416 (CVE-2017-14496)

Summary: CVE-2017-14496 dnsmasq: integer underflow leading to buffer over-read in the EDNS0 code
Product: [Other] Security Response Reporter: Fabio Olive Leite <fleite>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: apevec, chrisw, code, gmollett, itamar, jjoyce, jschluet, kbasil, laine, lhh, lpeer, markmc, mburns, p, pemensik, rbryant, sclewis, security-response-team, slinaber, srevivo, tdecacqu, thozza, veillard
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: dnsmasq 2.78 Doc Type: If docs needed, set a value
Doc Text:
An integer underflow flaw leading to a buffer over-read was found in dnsmasq in the EDNS0 code. An attacker could send crafted DNS packets to dnsmasq which would cause it to crash. This issue only affected configurations using one of the options: add-mac, add-cpe-id, or add-subnet.
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-10-02 18:16:17 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: 1495516, 1495517, 1497691    
Bug Blocks: 1495418    
Attachments:
Description Flags
Upstream commit none

Description Fabio Olive Leite 2017-09-26 02:04:33 UTC
Red Hat Product Security has been made aware of a Denial of Service vulnerability affecting the DNS implementation of dnsmasq.

Comment 1 Doran Moppert 2017-09-26 05:12:18 UTC
Acknowledgments:

Name: Felix Wilhelm (Google Security Team), Fermin J. Serna (Google Security Team), Gabriel Campana (Google Security Team), Kevin Hamacher (Google Security Team), Ron Bowes (Google Security Team)

Comment 2 Doran Moppert 2017-09-26 08:39:54 UTC
Versions of dnsmasq shipped with Red Hat Enterprise Linux 6 and 5 do not include the EDNS0 code which includes this flaw.

Comment 3 Tomas Hoger 2017-09-26 08:49:34 UTC
Further details from the 2.78 pre-release CHANGELOG:

    Fix DoS in DNS. Invalid boundary checks in the
    add_pseudoheader function allows a memcpy call with negative
    size An attacker which can send malicious DNS queries
    to dnsmasq can trigger a DoS remotely.
    dnsmasq is vulnerable only if one of the following option is
    specified: --add-mac, --add-cpe-id or --add-subnet.
    CVE-2017-14496 applies.
    Credit to Felix Wilhelm, Fermin J. Serna, Gabriel Campana
    and Kevin Hamacher of the Google Security Team for
    finding this.

Comment 5 Tomas Hoger 2017-09-26 10:48:10 UTC
Created attachment 1330995 [details]
Upstream commit

Comment 6 Tomas Hoger 2017-09-26 20:03:43 UTC
Relevant memcpy call that could be called with negative (type casted to large positive) size was added in this commit:

http://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=commitdiff;h=5bb88f096363e66ac08e31761f850a1d5aa22244

The first upstream version including this change is 2.76.

Comment 9 Adam Mariš 2017-10-02 13:18:46 UTC
Created dnsmasq tracking bugs for this issue:

Affects: fedora-all [bug 1497691]

Comment 11 errata-xmlrpc 2017-10-02 17:21:15 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

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

Comment 12 Garth Mollett 2017-10-03 20:59:16 UTC
Statement:

Red Hat OpenStack Platform includes the dnsmasq-utils RPM which does not contain this flaw's affected code-paths; Red Hat OpenStack Platform is therefore listed as not affected.

However, because all versions of Red Hat OpenStack Platform are based on Red Hat Enterprise Linux, all Red Hat OpenStack Platform users should absolutely upgrade the dnsmasq RPM from Red Hat Enterprise Linux as a matter of urgency using standard update mechanisms (such as 'yum update' or 'openstack overcloud update').