CVE-2017-13704
In dnsmasq before 2.78, if the DNS packet size does not match the expected size, the size...
In dnsmasq before 2.78, if the DNS packet size does not match the expected size, the size parameter in a memset call gets a negative value. As it is an unsigned value, memset ends up writing up to 0xffffffff zero's (0xffffffffffffffff in 64 bit platforms), making dnsmasq crash.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- None
- Integrity
- None
- Availability
- High
Exploit likelihood
What each source reports
NVD Score used
7.5
In dnsmasq before 2.78, if the DNS packet size does not match the expected size, the size parameter in a memset call gets a negative value. As it is an unsigned value, memset ends up writing up to 0xffffffff zero's (0xffffffffffffffff in 64 bit platforms), making dnsmasq crash.
- Record
CVE-2017-13704- CVSS 3.0
- 7.5 High
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - CVSS 2.0
- 5.0 Medium
AV:N/AC:L/Au:N/C:N/I:N/A:P - Weakness
- CWE-20
- Updated
- 2026-11-02
CVE List No score
In dnsmasq before 2.78, if the DNS packet size does not match the expected size, the size parameter in a memset call gets a negative value. As it is an unsigned value, memset ends up writing up to 0xffffffff zero's (0xffffffffffffffff in 64 bit platforms), making dnsmasq crash.
- Record
CVE-2017-13704- Updated
- 2026-11-02
EUVDEUVD-2017-5221 No score
In dnsmasq before 2.78, if the DNS packet size does not match the expected size, the size parameter in a memset call gets a negative value. As it is an unsigned value, memset ends up writing up to 0xffffffff zero's (0xffffffffffffffff in 64 bit platforms), making dnsmasq crash.
- Record
EUVD-2017-5221- Updated
- 2026-11-03
GitHub AdvisoriesGHSA-mprq-hpvv-8wcc
7.5
In dnsmasq before 2.78, if the DNS packet size does not match the expected size, the size...
In dnsmasq before 2.78, if the DNS packet size does not match the expected size, the size parameter in a memset call gets a negative value. As it is an unsigned value, memset ends up writing up to 0xffffffff zero's (0xffffffffffffffff in 64 bit platforms), making dnsmasq crash.
- Record
GHSA-mprq-hpvv-8wcc- CVSS 3.0
- 7.5 High
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-20
- Updated
- 2026-11-02
OSVALPINE-CVE-2017-13704
7.5
In dnsmasq before 2.78, if the DNS packet size does not match the expected size, the size parameter in a memset call gets a negative value. As it is an unsigned value, memset ends up writing up to 0xffffffff zero's (0xffffffffffffffff in 64 bit platforms), making dnsmasq crash.
- Record
ALPINE-CVE-2017-13704- CVSS 3.0
- 7.5 High
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
OSVBELL-CVE-2017-13704
7.5
CVE-2017-13704 does not affect BellSoft software
- Record
BELL-CVE-2017-13704- CVSS 3.0
- 7.5 High
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
Show 5 moreShow less
OSV
7.5
In dnsmasq before 2.78, if the DNS packet size does not match the expected size, the size parameter in a memset call gets a negative value. As it is an unsigned value, memset ends up writing up to 0xffffffff zero's (0xffffffffffffffff in 64 bit platforms), making dnsmasq crash.
- Record
CVE-2017-13704- CVSS 3.0
- 7.5 High
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
OSVDEBIAN-CVE-2017-13704
7.5
In dnsmasq before 2.78, if the DNS packet size does not match the expected size, the size parameter in a memset call gets a negative value. As it is an unsigned value, memset ends up writing up to 0xffffffff zero's (0xffffffffffffffff in 64 bit platforms), making dnsmasq crash.
- Record
DEBIAN-CVE-2017-13704- CVSS 3.0
- 7.5 High
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
OSVUBUNTU-CVE-2017-13704
7.5
In dnsmasq before 2.78, if the DNS packet size does not match the expected size, the size parameter in a memset call gets a negative value. As it is an unsigned value, memset ends up writing up to 0xffffffff zero's (0xffffffffffffffff in 64 bit platforms), making dnsmasq crash.
- Record
UBUNTU-CVE-2017-13704- CVSS 3.0
- 7.5 High
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
OSVMGASA-2017-0364 No score
Updated dnsmasq packages fix security vulnerabilities
CVE-2017-13704: Dnsmasq could be made to crash on a large DNS query. A DNS query received by UDP which exceeds 512 bytes (or the EDNS0 packet size, if different.) is enough to cause SIGSEGV.
CVE-2017-14491: A heap buffer overflow was found in dnsmasq in the code responsible for building DNS replies. An attacker could send crafted DNS packets to dnsmasq which would cause it to crash or, potentially, execute arbitrary code.
CVE-2017-14492: A heap buffer overflow was discovered in dnsmasq in the IPv6 router advertisement (RA) handling code. An attacker on the local network segment could send crafted RAs to dnsmasq which would cause it to crash or, potentially, execute arbitrary code. This issue only affected configurations using one of these options: enable-ra, ra-only, slaac, ra-names, ra-advrouter, or ra-stateless.
CVE-2017-14493: A stack buffer overflow was found in dnsmasq in the DHCPv6 code. An attacker on the local network could send a crafted DHCPv6 request to dnsmasq which would cause it to a crash or, potentially, execute arbitrary code.
CVE-2017-14494: An information leak was found in dnsmasq in the DHCPv6 relay code. An attacker on the local network could send crafted DHCPv6 packets to dnsmasq causing it to forward the contents of process memory, potentially leaking sensitive data.
CVE-2017-14495: A memory exhaustion flaw was found in dnsmasq in the EDNS0 code. An attacker could send crafted DNS packets which would trigger memory allocations which would never be freed, leading to unbounded memory consumption and eventually a crash. This issue only affected configurations using one of the options: add-mac, add-cpe-id, or add-subnet.
CVE-2017-14496: 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.
- Record
MGASA-2017-0364- Updated
- 2026-11-02
OSVMGASA-2017-0367 No score
Updated dnsmasq packages fix security vulnerabilities
An audit by mozilla security found several vulnerability and potential vulnerability in dnsmasq:
- Uninitialized buffer leads to memory leakage
- Allocated memory is not cleared
- Unchecked return value can lead to NULL pointer dereference
- Hardcoded values in fscanf() format strings with aliased buffers
CVE-2017-13704: Dnsmasq could be made to crash on a large DNS query: A DNS query received by UDP which exceeds 512 bytes (or the EDNS0 packet size, if different.) is enough to cause SIGSEGV. (bug 21793)
CVE-2017-14491: A heap buffer overflow was found in dnsmasq in the code responsible for building DNS replies. An attacker could send crafted DNS packets to dnsmasq which would cause it to crash or, potentially, execute arbitrary code.
CVE-2017-14492: A heap buffer overflow was discovered in dnsmasq in the IPv6 router advertisement (RA) handling code. An attacker on the local network segment could send crafted RAs to dnsmasq which would cause it to crash or, potentially, execute arbitrary code. This issue only affected configurations using one of these options: enable-ra, ra-only, slaac, ra-names, ra-advrouter, or ra-stateless.
CVE-2017-14493: A stack buffer overflow was found in dnsmasq in the DHCPv6 code. An attacker on the local network could send a crafted DHCPv6 request to dnsmasq which would cause it to a crash or, potentially, execute arbitrary code.
CVE-2017-14494: An information leak was found in dnsmasq in the DHCPv6 relay code. An attacker on the local network could send crafted DHCPv6 packets to dnsmasq causing it to forward the contents of process memory, potentially leaking sensitive data.
CVE-2017-14495: A memory exhaustion flaw was found in dnsmasq in the EDNS0 code. An attacker could send crafted DNS packets which would trigger memory allocations which would never be freed, leading to unbounded memory consumption and eventually a crash. This issue only affected configurations using one of the options: add-mac, add-cpe-id, or add-subnet.
CVE-2017-14496: 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.
- Record
MGASA-2017-0367- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
dnsmasqAlpine:v3.10 |
before 2.78-r0 | 2.78-r0 |
dnsmasqAlpine:v3.11 |
before 2.78-r0 | 2.78-r0 |
dnsmasqAlpine:v3.12 |
before 2.78-r0 | 2.78-r0 |
dnsmasqAlpine:v3.13 |
before 2.78-r0 | 2.78-r0 |
dnsmasqAlpine:v3.14 |
before 2.78-r0 | 2.78-r0 |
dnsmasqAlpine:v3.15 |
before 2.78-r0 | 2.78-r0 |
dnsmasqAlpine:v3.16 |
before 2.78-r0 | 2.78-r0 |
dnsmasqAlpine:v3.17 |
before 2.78-r0 | 2.78-r0 |
dnsmasqAlpine:v3.18 |
before 2.78-r0 | 2.78-r0 |
dnsmasqAlpine:v3.19 |
before 2.78-r0 | 2.78-r0 |
Show 13 moreShow less
| Package | Affected | Fixed |
|---|---|---|
dnsmasqAlpine:v3.20 |
before 2.78-r0 | 2.78-r0 |
dnsmasqAlpine:v3.21 |
before 2.78-r0 | 2.78-r0 |
dnsmasqAlpine:v3.22 |
before 2.78-r0 | 2.78-r0 |
dnsmasqAlpine:v3.23 |
before 2.78-r0 | 2.78-r0 |
dnsmasqAlpine:v3.24 |
before 2.78-r0 | 2.78-r0 |
dnsmasqAlpine:v3.7 |
before 2.78-r0 | 2.78-r0 |
dnsmasqAlpine:v3.8 |
before 2.78-r0 | 2.78-r0 |
dnsmasqAlpine:v3.9 |
before 2.78-r0 | 2.78-r0 |
dnsmasqDebian:12 |
before 2.78-1 | 2.78-1 |
dnsmasqDebian:13 |
before 2.78-1 | 2.78-1 |
dnsmasqDebian:14 |
before 2.78-1 | 2.78-1 |
dnsmasqMageia:6 From an advisory covering 7 CVEs |
before 2.77-1.2.mga6 | 2.77-1.2.mga6 |
dnsmasqMageia:5 From an advisory covering 7 CVEs |
before 2.77-1.1.mga5 | 2.77-1.1.mga5 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, facts | ||
| affected | ||
| aliases | EUVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2017-13704 is a high vulnerability (CVSS 7.5) in Thekelleys Dnsmasq, published October 2, 2017. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 65.4%, the 99th percentile. Fixed in dnsmasq 2.78-r0.
References
securitytracker.com/id/1039474
synology.com/support/security/Synology_SA_17_59_Dnsmasq
access.redhat.com/security/vulnerabilities/3199382
securityfocus.com/bid/101085
securityfocus.com/bid/101977
lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/4TK6DWC53WSU6633EVZL7H4PCWBYHMHK
Show 27 moreShow less
mail-archive.com/dnsmasq-discuss%40lists.thekelleys.org.uk/msg11665.html
thekelleys.org.uk/gitweb?p=dnsmasq.git%3Ba=commit%3Bh=63437ffbb58837b214b4b92cb1c54bc5f3279928
thekelleys.org.uk/dnsmasq/CHANGELOG
security.googleblog.com/2017/10/behind-masq-yet-more-dns-and-dhcp.html
mail-archive.com/dnsmasq-discuss%40lists.thekelleys.org.uk/msg11664.html
cert-portal.siemens.com/productcert/pdf/ssa-689071.pdf
nvd.nist.gov/vuln/detail/CVE-2017-13704
mail-archive.com/[email protected]/msg11664.html
mail-archive.com/[email protected]/msg11665.html
thekelleys.org.uk/gitweb?p=dnsmasq.git;a=commit;h=63437ffbb58837b214b4b92cb1c54bc5f3279928
lists.fedoraproject.org/archives/list/[email protected]/message/4TK6DWC53WSU6633EVZL7H4PCWBYHMHK
github.com/advisories/GHSA-mprq-hpvv-8wcc
security.alpinelinux.org/vuln/CVE-2017-13704
docs.bell-sw.com/security/cves/CVE-2017-13704
security-tracker.debian.org/tracker/CVE-2017-13704
advisories.mageia.org/MGASA-2017-0364.html
bugs.mageia.org/show_bug.cgi?id=21793
lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2017q3/011692.html
lists.fedoraproject.org/archives/list/[email protected]/thread/4TK6DWC53WSU6633EVZL7H4PCWBYHMHK
access.redhat.com/errata/RHSA-2017:2836
advisories.mageia.org/MGASA-2017-0367.html
bugs.mageia.org/show_bug.cgi?id=19528
wiki.mozilla.org/images/f/f7/Dnsmasq-report.pdf
docs.google.com/document/d/14y2kiXgB69fLBY0xuMeqc-YiZg4UDCw2xd4-mZspoP8
ubuntu.com/security/CVE-2017-13704
lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2017q3/011729.html
cve.org/CVERecord?id=CVE-2017-13704