CVE-2026-2291: Integer Overflow

Published Feb 11, 2026
·
Updated

CVE-2026-2291

Other sources

dnsmasqs extractname() function can be abused to cause a heap buffer overflow, allowing an attacker to inject false DNS cache entries, which could result in DNS lookups to redirect to an attacker-controlled IP address, or to cause a DoS.

Launchpad

Summary: extractname() tracks name length in wire-format bytes and enforces namelen < MAXDNAME. But three byte values (0x00, 0x2E, 0x01) undergo 2-byte NAMEESCAPE expansion in the presentation format. A wire-format name at the 1024-byte limit can expand to 2031 bytes in presentation format.

The code accounted for this correctly when sizing namebuff -- the comment at option.c:5942 explains the (MAXDNAME 2) + 1 allocation. But union bigname in dnsmasq.h is still sized at MAXDNAME:

c // dnsmasq.h:481 union bigname { char name[MAXDNAME]; // 1025 bytes union bigname next; };

So the strcpy at cache.c:760 can write up to 2031 bytes into a 1025-byte buffer:

c strcpy(cachegetname(new), name); // name comes from daemon->namebuff (2051 bytes)

A DNS response containing 16 labels of 63 NUL bytes (wire length 1024, passes the check) produces a presentation-format string of 2031 bytes -- a 1006-byte overflow.

Trigger A PTR or CNAME response with NUL-byte-filled labels triggers it. NUL bytes in DNS labels are legal per RFC 2181 Section 11, and I confirmed Unbound and BIND forward them without sanitization. No special dnsmasq configuration is needed.

Impact - Crash: A single malicious DNS response corrupts heap metadata. ASAN reports WRITE of size 2032 at cache.c:760. Release builds crash on subsequent operations (malloc(): corrupted top size).

- Cache poisoning: The overflow can overwrite an adjacent bigname.name[] with a target domain string, causing cachefindbyname() to match the target domain against an entry with the attacker's IP. The crec metadata is untouched -- only the name changes. This bypasses TXID/port randomization since the attacker is the legitimate authoritative server for their own zone.

Affected Versions The NAMEESCAPE expansion was introduced in commit cbe379a (2015-04-21, "Handle domain names with '.' or /000 within labels"), first released in v2.73. That same commit upsized namebuff to MAXDNAME 2 with an explicit comment about the 2x expansion -- but union bigname was not updated. From v2.73 through v2.89, the expansion only ran in DNSSEC-enabled builds.

In commit 638c7c4 (2023-03-23, "Add --cache-rr to enable caching of arbitrary RR types"), released in v2.90, the NAMEESCAPE expansion was made unconditional -- it now runs in all builds regardless of DNSSEC configuration. The namebuff allocation was moved to readopts() and unconditionally sized at (MAXDNAME 2) + 1.

- v2.73 -- v2.89: Vulnerable in DNSSEC-enabled builds only. - v2.90 -- v2.92 (current): Vulnerable in all builds, all configurations.

ASAN Output Built v2.92 at d8f66f4 with -fsanitize=address -g -O0. Triggered via a single PTR response containing 16 labels of 63 NUL bytes:

==3387188==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x519000001888 WRITE of size 2032 at 0x519000001888 thread T0 #0 strcpy #1 reallyinsert cache.c:760 #2 cacheinsert cache.c:626 #3 extractaddresses rfc1035.c:770 #4 processreply forward.c:824 #5 returnreply forward.c:1426 #6 replyquery forward.c:1298 #7 checkdnslisteners dnsmasq.c:1905 #8 main dnsmasq.c:1297

0x519000001888 is located 0 bytes after 1032-byte region [0x519000001480,0x519000001888) allocated by thread T0 here: #0 calloc #1 whinemalloc util.c:346 #2 reallyinsert cache.c:731

Patch Tested against v2.92 (d8f66f4): ASAN build survives the same payload that previously triggered the overflow. Applicable with git am:

Red Hat

Affected Software

4 affected componentsFixes available
Dnsmasq Dnsmasq
debian/dnsmasq<=2.85-1, <=2.85-1+deb11u1, <=2.92-4
2.90-4~deb12u22.91-1+deb13u12.92-5
Microsoft azl3 dnsmasq 2.90-1
Microsoft azl3 dnsmasq 2.92-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

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

    Fixed in 2.90-4~deb12u2Fixed in 2.91-1+deb13u1Fixed in 2.92-5
  2. Upgrade

    Upgrade dnsmasq to a version that resolves this vulnerability.

    Fixed in v2.90 -- v2.92

Event History

Feb 11, 2026
Data Sourced
via Red Hat·08:06 PM
DescriptionSeverityAffected Software
May 11, 2026
CVE Published
via MITRE·04:47 PM
Data Sourced
via MITRE·04:47 PM
DescriptionWeakness
Data Sourced
via NVD·06:16 PM
DescriptionSeverity
May 13, 2026
Data Sourced
via Launchpad·03:08 PM
Description
May 15, 2026
Data Sourced
via Microsoft·08:01 AM
DescriptionSeverityWeaknessAffected Software
Updated
via Microsoft·08:01 AM
Affected Software
Updated
via Microsoft·08:01 AM
DescriptionSeverity
Data Sourced
via Ubuntu·03:08 PM
RemedyDescriptionSeverityAffected Software
May 16, 2026
Data Sourced
via Debian·03:10 PM
DescriptionAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2026-2291?

CVE-2026-2291 has a high severity rating due to its potential to cause a heap buffer overflow and enable DNS spoofing.

2

How do I fix CVE-2026-2291?

To fix CVE-2026-2291, update dnsmasq to version 2.90-4~deb12u2, 2.91-1+deb13u1, or 2.92-5.

3

What are the risks associated with CVE-2026-2291?

The risks include possible denial of service and the injection of false DNS cache entries which can redirect traffic to malicious sites.

4

Which versions of dnsmasq are affected by CVE-2026-2291?

CVE-2026-2291 affects dnsmasq versions up to and including 2.85-1, 2.85-1+deb11u1, 2.90-4~deb12u1, 2.91-1, and 2.92-4.

5

Is there a known exploit for CVE-2026-2291?

There are no publicly known exploits for CVE-2026-2291 as of now, but the vulnerability presents serious risks if not addressed.

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