# CVE-2026-12725: Dnsmasq heap buffer overflow in log_query function

Source: https://junglewise.ai/threats/cve-2026-12725-dnsmasq-heap-buffer-overflow-in-log-query-function  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-06-22. Updated: 2026-06-22  
License: CC BY 4.0 with a link back

CVE-2026-12725 · Severity: medium · CVSS 5.9 · Published 2026-06-22

Dnsmasq is a widely used tool that provides network infrastructure services like DNS and DHCP to local networks. A flaw was found where the software can crash when it attempts to log specific types of security-related DNS records that it does not recognize. This could allow a remote attacker to disrupt internet connectivity or local network services by causing the dnsmasq process to stop working.

Technologies: [Red Hat Enterprise Linux 10](https://junglewise.ai/threats/technologies/enterprise-linux-10), [Red Hat Enterprise Linux 8](https://junglewise.ai/threats/technologies/enterprise-linux-8), [Red Hat Enterprise Linux 9](https://junglewise.ai/threats/technologies/enterprise-linux-9), [Red Hat OpenShift Container Platform 4](https://junglewise.ai/threats/technologies/openshift-container-platform-4). Vendors: [Red Hat](https://junglewise.ai/threats/vendors/red-hat).

## Quick answers

**Is CVE-2026-12725 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-12725 being exploited in the wild.

**How severe is CVE-2026-12725?** Medium severity, with a CVSS score of 5.9, published 22 June 2026.

**Which products and versions are affected?** thekelleys.org.uk dnsmasq versions prior to 2.92rel2; Red Hat Enterprise Linux 8; Red Hat Enterprise Linux 9; Red Hat Enterprise Linux 10; and 1 more.

**Is there a fix for CVE-2026-12725?** A patch was published on 2026-06-22: Upstream fix identified in version 2.92rel2 Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-12725 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-12725?** Check whether you run Red Hat Enterprise Linux 10, Red Hat Enterprise Linux 8, Red Hat Enterprise Linux 9 or one of the others listed. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Technical details

A heap-based buffer overflow exists in the log_query() function within src/cache.c of dnsmasq. When query logging (--log-queries) and DNSSEC validation are both enabled, the software fails to properly bound the length of strings written to the internal 46-byte 'daemon->addrbuff' heap buffer. Specifically, when logging DS or DNSKEY replies containing IANA-unassigned or unsupported algorithm/digest types, the addition of a "(not supported)" suffix via sprintf() causes a write past the buffer end. While the overflow is bounded (approximately 12 bytes) and the content is not directly attacker-controlled, it can lead to heap corruption and process crashes. The issue is fixed in upstream version 2.92rel2 (commit 36d081e).

## Affected products

- thekelleys.org.uk dnsmasq versions prior to 2.92rel2
- Red Hat Enterprise Linux 8
- Red Hat Enterprise Linux 9
- Red Hat Enterprise Linux 10
- Red Hat OpenShift Container Platform 4

## Timeline

- 2026-06-19: disclosed: Initial report in Red Hat Bugzilla
- 2026-06-22: advisory: NVD publication date
- 2026-06-22: patched: Upstream fix identified in version 2.92rel2

## References

- [https://access.redhat.com/downloads/content/package-browser/](https://access.redhat.com/downloads/content/package-browser/)
- [https://access.redhat.com/security/cve/CVE-2026-12725](https://access.redhat.com/security/cve/CVE-2026-12725)
- [https://bugzilla.redhat.com/show_bug.cgi?id=2490763](https://bugzilla.redhat.com/show_bug.cgi?id=2490763)

## Related threats

- [Red Hat yggdrasil-worker-package-manager argument injection in APT backend](https://junglewise.ai/threats/cve-2026-18157-red-hat-yggdrasil-worker-package-manager-argument-injection-in)
- [Samba AD DC LDAP filter injection and ACL bypass in Compare requests](https://junglewise.ai/threats/cve-2026-58222-samba-ad-dc-ldap-filter-injection-and-acl-bypass-in-compare)
- [Samba KDC out-of-bounds read in kpasswd service](https://junglewise.ai/threats/cve-2026-58216-samba-kdc-out-of-bounds-read-in-kpasswd-service)
- [Samba internal DNS server denial of service via TKEY cache exhaustion](https://junglewise.ai/threats/cve-2026-58218-samba-internal-dns-server-denial-of-service-via-tkey-cache)
- [Red Hat PCP auth bypass in pmproxy /store endpoint](https://junglewise.ai/threats/cve-2026-16527-red-hat-pcp-auth-bypass-in-pmproxy-store-endpoint)
