CVE-2026-12725: Dnsmasq: dnsmasq: heap buffer overflow in log_query() when logging unsupported ds/dnskey replies

Published Jun 19, 2026
·
Updated

A heap buffer overflow exists in dnsmasq's logquery() function (src/cache.c). When query logging is enabled and dnsmasq logs DS or DNSKEY replies containing unsupported algorithm or digest types, the "(not supported)" suffix causes sprintf() to write past the end of daemon->addrbuff, a 46-byte heap buffer. Trigger example: a DS record with keytag=65535, algorithm=255, digesttype=255 (both algorithm 255 and digesttype 255 are IANA-unassigned), causing the "(not supported)" branch in dnssec.c to fire during logging. Prerequisites: - DNSSEC validation enabled - Query logging enabled (e.g. --log-queries) Impact: bounded heap write overflow (~12 bytes). Upstream maintainer Simon Kelley notes the overwrite is of bounded length, the bytes written are not attacker-controlled, and this is not considered a likely remote-execution vector. Practical impact is denial of service via process crash or heap corruption. Fixed upstream in commit 36d081e37477027fd721fea498f3760f529034ad (dnsmasq 2.92rel2).

Other sources

A heap-based buffer overflow was found in dnsmasq. When DNSSEC validation and query logging are both enabled, logging of DS or DNSKEY replies containing unsupported algorithm or digest types can cause dnsmasq to write past the end of an internal logging buffer. A remote attacker able to supply such a DNS response may crash the dnsmasq process, resulting in denial of service.

MITRE

Dnsmasq: dnsmasq: heap buffer overflow in logquery() when logging unsupported ds/dnskey replies

Microsoft

Affected Software

8 affected componentsFixes available
Dnsmasq Dnsmasq<2.92rel2
Microsoft azl3 dnsmasq 2.92-1<2.93-1
2.93-1
redhat OpenShift Container Platform>=4.0<=4.22.1
redhat Enterprise Linux=8.0
redhat Enterprise Linux=9.0
redhat Enterprise Linux=10.0
thekelleys dnsmasq<2.93
debian/dnsmasq<=2.85-1, <=2.85-1+deb11u2, <=2.90-4~deb12u2, <=2.91-1+deb13u1
2.93-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 2.93-1
  2. Upgrade

    Upgrade debian/dnsmasq to a version that resolves this vulnerability.

    Fixed in 2.93-1
  3. Compensating control

    If you cannot patch immediately, disable query logging (e.g., --log-queries) so that DS/DNSKEY replies with unsupported algorithm=255 and digest_type=255 do not get processed by log_query().

  4. Compensating control

    If you cannot patch immediately, disable DNSSEC validation so that the logging path for unsupported DS/DNSKEY replies is not exercised when DNSSEC validation and query logging are both enabled.

Event History

Jun 19, 2026
Data Sourced
via Red Hat·02:44 PM
DescriptionSeverityAffected Software
Jun 22, 2026
CVE Published
via MITRE·01:55 PM
Data Sourced
via MITRE·01:55 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·04:16 PM
DescriptionSeverityWeaknessAffected Software
Jun 27, 2026
Data Sourced
via Microsoft·08:05 AM
DescriptionSeverityWeaknessAffected Software
Updated
via Microsoft·08:05 AM
DescriptionSeverity
Jul 14, 2026
Data Sourced
via Ubuntu·08:29 PM
RemedyDescriptionSeverityAffected Software
Data Sourced
via Debian·08:30 PM
DescriptionAffected Software
Data Sourced
via Launchpad·08:30 PM
Description
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-12725?

The severity of CVE-2026-12725 is medium with a score of 5.9.

2

How does CVE-2026-12725 affect dnsmasq?

CVE-2026-12725 affects dnsmasq by causing a heap buffer overflow in the log_query() function when logging unsupported DS or DNSKEY replies.

3

What conditions need to be met for CVE-2026-12725 to be exploited?

CVE-2026-12725 requires both DNSSEC validation and query logging to be enabled in dnsmasq.

4

What could a remote attacker achieve by exploiting CVE-2026-12725?

A remote attacker exploiting CVE-2026-12725 could potentially execute code by causing dnsmasq to write past the end of an internal logging buffer.

5

How can one mitigate the risks associated with CVE-2026-12725?

To mitigate the risks associated with CVE-2026-12725, users should disable DNSSEC validation or query logging in dnsmasq until a fix is applied.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203