Bug 16083 (CVE-2026-6949) - [SECURITY] CVE-2026-6949: TSIG packet with crafted name compression can crash internal DNS server
Summary: [SECURITY] CVE-2026-6949: TSIG packet with crafted name compression can crash...
Status: RESOLVED FIXED
Alias: CVE-2026-6949
Product: Samba 4.1 and newer
Classification: Unclassified
Component: DNS server (internal) (show other bugs)
Version: unspecified
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Samba QA Contact
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks: 16039
  Show dependency treegraph
 
Reported: 2026-05-26 09:47 UTC by Douglas Bagnall
Modified: 2026-08-13 14:31 UTC (History)
2 users (show)

See Also:


Attachments
CVE-2026-6949-master.metze.01.patches.txt (5.79 KB, text/plain)
2026-05-29 11:41 UTC, Stefan Metzmacher
no flags Details
CVE-2026-6949-master.metze.02.patches.txt (6.65 KB, text/plain)
2026-05-29 12:25 UTC, Stefan Metzmacher
dbagnall: review+
metze: ci-passed+
Details
advisory v1 (1.91 KB, text/plain)
2026-06-24 07:40 UTC, Douglas Bagnall
metze: review-
Details
advisory v2 (1.91 KB, text/plain)
2026-07-02 03:54 UTC, Douglas Bagnall
metze: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Douglas Bagnall 2026-05-26 09:47:15 UTC
To verify a TSIG signed packet, the DNS server has to consider the contents of packet up until the TSIG record exactly in the form in which they were transmitted.

This is happening after the initial NDR parsing, and the position of the TSIG record is not known, so we estimate it by forming a fake record using the TSIG data that we expect to have the size of the original record, and subtract the calculated size.

If the TSIG record is using dns name compression, it will be reusing name components from previous records. The size estimate is not able to take account of this, resulting in an overestimate of the TSIG size, and an underestimate of the size of the signed part of the packet. This always results in a rejected packet, but if the name is compressed using nested or overlapping components it will end up  with an underflow of packet_len at source4/dns_server/dns_verify.c:226

	packet_len = in->length - tsig_blob.length;
	buffer_len = packet_len + fake_tsig_blob.length;
	buffer = talloc_zero_array(mem_ctx, uint8_t, buffer_len);
	if (buffer == NULL) {
		return WERR_NOT_ENOUGH_MEMORY;
	}

	memcpy(buffer, in->data, packet_len);
	memcpy(buffer + packet_len, fake_tsig_blob.data, fake_tsig_blob.length);

which should result in a segfault.

This code is only reached if the specially constructed compressed DNS name has already been registered in the TKEY cache, which as far as I know can only be done by an authenticated user.

This was originally reported by Arjun Basnet of Securin. They assigned CVE-2026-6949, but after we expressed some doubt they withdrew the CVE. Further investigations by us revealed it was in fact exploitable.
Comment 1 Douglas Bagnall 2026-05-26 10:11:29 UTC
CVSS3.1 AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H 6.5

Denial of service by an unprivileged user.
Comment 2 Stefan Metzmacher 2026-05-28 15:48:23 UTC
We should still use CVE-2026-6949.
Comment 3 Stefan Metzmacher 2026-05-29 11:41:26 UTC
Created attachment 19002 [details]
CVE-2026-6949-master.metze.01.patches.txt
Comment 4 Stefan Metzmacher 2026-05-29 12:25:23 UTC
Created attachment 19003 [details]
CVE-2026-6949-master.metze.02.patches.txt
Comment 5 Douglas Bagnall 2026-06-13 00:14:26 UTC
Also reported by Andrew Tridgell, as "DNS TSIG verification subtracts expanded reserialized record length from original packet length"
Comment 6 Douglas Bagnall 2026-06-17 23:32:13 UTC
(In reply to Douglas Bagnall from comment #1)

> CVSS3.1 AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H 6.5
> 
> Denial of service by an unprivileged user.

Actually, it is DoS by anonymous user (see bug 16115). So

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N 7.5
Comment 7 Douglas Bagnall 2026-06-17 23:35:15 UTC
(In reply to Douglas Bagnall from comment #6)
> CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N 7.5

I mean

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H 7.5

("I:N/A:H" not "I:H/A:N", same score).
Comment 8 Douglas Bagnall 2026-06-24 07:40:05 UTC
Created attachment 19032 [details]
advisory v1
Comment 9 Stefan Metzmacher 2026-06-24 17:11:10 UTC
Comment on attachment 19032 [details]
advisory v1

CVE-2025-6949 => CVE-2026-6949
Comment 10 Douglas Bagnall 2026-07-02 03:54:37 UTC
Created attachment 19068 [details]
advisory v2
Comment 11 Douglas Bagnall 2026-07-08 23:22:49 UTC
master patch applies as far back as 4.19.
Comment 12 Björn Jacke 2026-07-17 13:42:15 UTC
adding vendors here.

scheduled release 2026-07-28 10:00 UTC.
Comment 13 Samba QA Contact 2026-07-28 10:23:56 UTC
This bug was referenced in samba v4-24-stable (Release samba-4.24.5):

a808c4eca63dc9af38cea84773431aa81ac25307
761796579873fab2909190a8f474a1d6d6f0caee
Comment 14 Samba QA Contact 2026-07-28 10:24:17 UTC
This bug was referenced in samba v4-23-stable (Release samba-4.23.10):

d2ef0ce02c39fe11443692eb1fcbc63aaaa69e82
20798d41b7c3abc70a9f2652d96cb77809a10a01
Comment 15 Samba QA Contact 2026-07-28 10:25:23 UTC
This bug was referenced in samba v4-22-stable (Release samba-4.22.11):

f754381c0b118a26295b466dd299a1ffaa88337c
323da8297ba1a6ffb1ad7cb609ac98d63cb622e0
Comment 16 Samba QA Contact 2026-07-28 10:49:36 UTC
This bug was referenced in samba v4-22-test:

f754381c0b118a26295b466dd299a1ffaa88337c
323da8297ba1a6ffb1ad7cb609ac98d63cb622e0
Comment 17 Samba QA Contact 2026-07-28 12:15:12 UTC
This bug was referenced in samba v4-24-test:

36108895dde75514eddbea03f28b68eed3d9856e
d003e6f3f873b420af0fc9e1eedde9841bb27a4d
Comment 18 Samba QA Contact 2026-07-28 12:27:12 UTC
This bug was referenced in samba v4-23-test:

58efc46783050b84e304e214529545f1de437d30
9c64d3675b4678807576d1e1e25e60f87885a86a
Comment 19 Samba QA Contact 2026-07-28 14:41:09 UTC
This bug was referenced in samba v4-24-test:

a808c4eca63dc9af38cea84773431aa81ac25307
761796579873fab2909190a8f474a1d6d6f0caee
Comment 20 Samba QA Contact 2026-07-28 14:43:53 UTC
This bug was referenced in samba v4-23-test:

d2ef0ce02c39fe11443692eb1fcbc63aaaa69e82
20798d41b7c3abc70a9f2652d96cb77809a10a01
Comment 21 Samba QA Contact 2026-07-28 17:03:20 UTC
This bug was referenced in samba master:

b8751dc477c3c81b526a2a6c934b79b3b0cd2d50
61d8fe93c0167e6e9eb91a3f4bdffb242fa081c6
Comment 22 Samba QA Contact 2026-08-03 19:36:21 UTC
This bug was referenced in samba v4-23-stable (Release samba-4.23.11):

58efc46783050b84e304e214529545f1de437d30
9c64d3675b4678807576d1e1e25e60f87885a86a
Comment 23 Samba QA Contact 2026-08-13 14:31:50 UTC
This bug was referenced in samba v4-24-stable (Release samba-4.24.6):

36108895dde75514eddbea03f28b68eed3d9856e
d003e6f3f873b420af0fc9e1eedde9841bb27a4d