Skip to content

Commit a33f063

Browse files
committed
- Fix CVE-2025-11411 (possible domain hijacking attack), reported by Yuxiao Wu,
Yunyi Zhang, Baojun Liu and Haixin Duan from Tsinghua University.
1 parent bbeee42 commit a33f063

151 files changed

Lines changed: 571 additions & 1 deletion

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

daemon/remote.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6176,6 +6176,7 @@ fr_atomic_copy_cfg(struct config_file* oldcfg, struct config_file* cfg,
61766176
COPY_VAR_ptr(ipset_name_v6);
61776177
#endif
61786178
COPY_VAR_int(ede);
6179+
COPY_VAR_int(iter_scrub_promiscuous);
61796180
}
61806181
#endif /* ATOMIC_POINTER_LOCK_FREE && HAVE_LINK_ATOMIC_STORE */
61816182

doc/example.conf.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,10 @@ server:
196196
# Limit on upstream queries for an incoming query and its recursion.
197197
# max-global-quota: 200
198198

199+
# Should the scrubber remove promiscuous NS from positive answers,
200+
# protects against poison attempts.
201+
# iter-scrub-promiscuous: yes
202+
199203
# msec for waiting for an unknown server to reply. Increase if you
200204
# are behind a slow satellite link, to eg. 1128.
201205
# unknown-server-time-limit: 376

doc/unbound-control.8.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ ipset,
167167
\fI\%tcp\-reuse\-timeout\fP,
168168
\fI\%tcp\-auth\-query\-timeout\fP,
169169
\fI\%delay\-close\fP\&.
170+
\fI\%iter\-scrub\-promiscuous\fP\&.
170171
.sp
171172
It does not work with
172173
\fI\%interface\fP and

doc/unbound-control.rst

Lines changed: 1 addition & 0 deletions

doc/unbound.conf.5.in

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3656,6 +3656,15 @@ Default: 200
36563656
.UNINDENT
36573657
.INDENT 0.0
36583658
.TP
3659+
.B iter\-scrub\-promiscuous: \fI<yes or no>\fP
3660+
Should the iterator scrubber remove promiscuous NS from positive answers.
3661+
This protects against poisonous contents, that could affect names in the
3662+
same zone as a spoofed packet.
3663+
.sp
3664+
Default: yes
3665+
.UNINDENT
3666+
.INDENT 0.0
3667+
.TP
36593668
.B fast\-server\-permil: \fI<number>\fP
36603669
Specify how many times out of 1000 to pick from the set of fastest servers.
36613670
0 turns the feature off.

doc/unbound.conf.rst

Lines changed: 8 additions & 0 deletions

iterator/iter_scrub.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,22 @@ scrub_normalize(sldns_buffer* pkt, struct msg_parse* msg,
634634
"RRset:", pkt, msg, prev, &rrset);
635635
continue;
636636
}
637+
/* If the NS set is a promiscuous NS set, scrub that
638+
* to remove potential for poisonous contents that
639+
* affects other names in the same zone. Remove
640+
* promiscuous NS sets in positive answers, that
641+
* thus have records in the answer section. Nodata
642+
* and nxdomain promiscuous NS sets have been removed
643+
* already. Since the NS rrset is scrubbed, its
644+
* address records are also not marked to be allowed
645+
* and are removed later. */
646+
if(FLAGS_GET_RCODE(msg->flags) == LDNS_RCODE_NOERROR &&
647+
msg->an_rrsets != 0 &&
648+
env->cfg->iter_scrub_promiscuous) {
649+
remove_rrset("normalize: removing promiscuous "
650+
"RRset:", pkt, msg, prev, &rrset);
651+
continue;
652+
}
637653
if(nsset == NULL) {
638654
nsset = rrset;
639655
} else {

testdata/autotrust_init.rpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ server:
55
fake-sha1: yes
66
trust-anchor-signaling: no
77
minimal-responses: no
8+
iter-scrub-promiscuous: no
89
stub-zone:
910
name: "."
1011
stub-addr: 193.0.14.129 # K.ROOT-SERVERS.NET.

testdata/autotrust_init_ds.rpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ server:
55
fake-sha1: yes
66
trust-anchor-signaling: no
77
minimal-responses: no
8+
iter-scrub-promiscuous: no
89
stub-zone:
910
name: "."
1011
stub-addr: 193.0.14.129 # K.ROOT-SERVERS.NET.

testdata/autotrust_init_sigs.rpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ server:
55
fake-sha1: yes
66
trust-anchor-signaling: no
77
minimal-responses: no
8+
iter-scrub-promiscuous: no
89
stub-zone:
910
name: "."
1011
stub-addr: 193.0.14.129 # K.ROOT-SERVERS.NET.

0 commit comments

Comments
 (0)