CVE-2016-5180
Critical · 9.8CVSS
9.8
EPSS
8.6%
Published
Oct 3, 2016
CISA due date
—
Cloudanix analysis
A flaw in a common networking library lets attackers crash programs or take them over by sending specially formatted web addresses, so organizations should update the library right away to stay protected.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Low
- Impact
- Remote Code Execution
- Component
- Library
- Class
- Memory Corruption
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Heap-based buffer overflow in ares_create_query allows out-of-bounds write when processing a hostname containing an escaped trailing dot, enabling denial of service or arbitrary code execution.
Why it matters to the business
Applications relying on vulnerable c-ares versions face risk of remote compromise or service outages; the issue has remained publicly known for years with modest but persistent exploitability signals.
How an attack unfolds
An attacker supplies a crafted hostname containing an escaped trailing dot to any code path that invokes ares_create_query, triggering the overflow during DNS query construction and potentially gaining code execution or crashing the process.
How to fix it
Upgrade c-ares to version 1.12.0 or later; for Node.js, apply the fix present in commit 262dd62a9248d7021966a9d00cd6632ea1f087bc and rebuild or redeploy affected packages.
How to confirm the fix worked
Verify the installed c-ares or Node.js version against the fixed commit, and test resolution of hostnames containing escaped trailing dots to confirm absence of the overflow condition.
Typical attack path
- Identify a network-reachable service that uses c-ares for DNS resolution
- Craft a hostname string containing an escaped trailing dot
- Trigger DNS resolution of the malicious hostname through the vulnerable application
- Exploit the resulting out-of-bounds write for code execution or denial of service
How to detect it
Review application and system logs for crashes or segmentation faults during DNS resolution, inspect network traffic for unusual hostnames with escaped dots, and correlate with process dumps showing buffer overflow symptoms.
What your security team should do
- Immediately update all instances of c-ares and dependent Node.js packages to the fixed versions
- Scan dependency manifests for any remaining references to c-ares before 1.12.0
- Monitor for application crashes or unexpected DNS resolution failures that could indicate attempted exploitation
The record
Heap-based buffer overflow in the ares_create_query function in c-ares 1.x before 1.12.0 allows remote attackers to cause a denial of service (out-of-bounds write) or possibly execute arbitrary code via a hostname with an escaped trailing dot.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Alpine:v3.2 | c-ares | 0 | 1.12.0-r0 |
| Alpine:v3.3 | c-ares | 0 | 1.12.0-r0 |
| Alpine:v3.4 | c-ares | 0 | 1.12.0-r0 |
| Alpine:v3.5 | c-ares | 0 | 1.12.0-r0 |
| Alpine:v3.6 | c-ares | 0 | 1.12.0-r0 |
| Alpine:v3.6 | nodejs | 0 | 6.8.0-r0 |
| Debian:10 | c-ares | 0 | 1.12.0-1 |
| Debian:11 | c-ares | 0 | 1.12.0-1 |
| Debian:12 | c-ares | 0 | 1.12.0-1 |
| Debian:13 | c-ares | 0 | 1.12.0-1 |
| Debian:7 | c-ares | 0 | 1.9.1-3+deb7u1 |
| Debian:8 | c-ares | 0 | 1.10.0-2+deb8u1 |
| Mageia:5 | c-ares | 0 | 1.10.0-5.1.mga5 |
| Red Hat:rhel_software_collections:2::el6 | rh-nodejs4-http-parser | 0 | 0:2.7.0-2.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-nodejs4-http-parser-debuginfo | 0 | 0:2.7.0-2.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-nodejs4-http-parser-devel | 0 | 0:2.7.0-2.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-nodejs4-nodejs | 0 | 0:4.6.2-4.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-nodejs4-nodejs-debuginfo | 0 | 0:4.6.2-4.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-nodejs4-nodejs-devel | 0 | 0:4.6.2-4.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-nodejs4-nodejs-docs | 0 | 0:4.6.2-4.el6 |
| Red Hat:rhel_software_collections:2::el7 | rh-nodejs4-http-parser | 0 | 0:2.7.0-2.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-nodejs4-http-parser-debuginfo | 0 | 0:2.7.0-2.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-nodejs4-http-parser-devel | 0 | 0:2.7.0-2.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-nodejs4-nodejs | 0 | 0:4.6.2-4.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-nodejs4-nodejs-debuginfo | 0 | 0:4.6.2-4.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-nodejs4-nodejs-devel | 0 | 0:4.6.2-4.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-nodejs4-nodejs-docs | 0 | 0:4.6.2-4.el7 |
| SUSE:Linux Enterprise Desktop 12 SP1 | libcares2 | 0 | 1.9.1-5.1 |
| SUSE:Linux Enterprise Desktop 12 SP2 | libcares2 | 0 | 1.9.1-5.1 |
| SUSE:Linux Enterprise Module for Web and Scripting 12 | nodejs4 | 0 | 4.6.1-11.1 |
| SUSE:Linux Enterprise Server 11 SP4 | libcares2 | 0 | 1.7.4-7.9.1 |
| SUSE:Linux Enterprise Server 12 SP1 | libcares2 | 0 | 1.9.1-5.1 |
| SUSE:Linux Enterprise Server 12 SP2 | libcares2 | 0 | 1.9.1-5.1 |
| SUSE:Linux Enterprise Server for Raspberry Pi 12 SP2 | libcares2 | 0 | 1.9.1-5.1 |
| SUSE:Linux Enterprise Server for SAP Applications 11 SP4 | libcares2 | 0 | 1.7.4-7.9.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP1 | libcares2 | 0 | 1.9.1-5.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP2 | libcares2 | 0 | 1.9.1-5.1 |
| SUSE:Linux Enterprise Software Development Kit 11 SP4 | libcares2 | 0 | 1.7.4-7.9.1 |
| SUSE:Linux Enterprise Software Development Kit 12 SP1 | libcares2 | 0 | 1.9.1-5.1 |
| SUSE:Linux Enterprise Software Development Kit 12 SP2 | libcares2 | 0 | 1.9.1-5.1 |
| SUSE:Linux Enterprise Workstation Extension 12 SP1 | libcares2 | 0 | 1.9.1-5.1 |
| SUSE:Linux Enterprise Workstation Extension 12 SP2 | libcares2 | 0 | 1.9.1-5.1 |
| Ubuntu:14.04:LTS | c-ares | 0 | 1.10.0-2ubuntu0.1 |
| Ubuntu:16.04:LTS | c-ares | 0 | 1.10.0-3ubuntu0.1 |
| openSUSE:Tumbleweed | c-ares | 0 | 1.12.0-1.1 |
Related vulnerabilities
- CVE-2017-1000381 The c-ares function `ares_parse_naptr_reply()`, which is used for parsing NAPTR… Also affects c-ares
- CVE-2016-7099 The tls.checkServerIdentity function in Node.js 0.10.x before 0.10.47, 0.12.x before… Also affects rh-nodejs4-http-parser
- CVE-2017-3738 There is an overflow bug in the AVX2 Montgomery multiplication procedure used in… Also affects nodejs4
- CVE-2017-3736 There is a carry propagating bug in the x86_64 Montgomery squaring procedure in OpenSSL… Also affects nodejs4
- CVE-2017-3735 While parsing an IPAddressFamily extension in an X.509 certificate, it is possible to do… Also affects nodejs4
- CVE-2016-7055 There is a carry propagating bug in the Broadwell-specific Montgomery multiplication… Also affects nodejs4
- CVE-2017-3732 There is a carry propagating bug in the x86_64 Montgomery squaring procedure in OpenSSL… Also affects nodejs4
- CVE-2017-3731 If an SSL/TLS server or client is running on a 32-bit host, and a specific cipher is… Also affects nodejs4