Commit graph

40003 commits

Author SHA1 Message Date
Ondřej Surý
8330b49fb9
Use cryptographically-secure pseudo-random generator everywhere
It was discovered in an upcoming academic paper that a xoshiro128**
internal state can be recovered by an external 3rd party allowing to
predict UDP ports and DNS IDs in the outgoing queries.  This could lead
to an attacker spoofing the DNS answers with great efficiency and
poisoning the DNS cache.

Change the internal random generator to system CSPRNG with buffering to
avoid excessive syscalls.

Thanks Omer Ben Simhon and Amit Klein of Hebrew University of Jerusalem
for responsibly reporting this to us.  Very cool research!

(cherry picked from commit cffcab9d5f)
2025-10-02 13:53:14 +02:00
Michał Kępień
4c99ba5a46 [9.18] [CVE-2025-40778] sec: usr: Address various spoofing attacks
Previously, several issues could be exploited to poison a DNS cache with
spoofed records for zones which were not DNSSEC-signed or if the
resolver was configured to not do DNSSEC validation. These issues were
assigned CVE-2025-40778 and have now been fixed.

As an additional layer of protection, :iscman:`named` no longer accepts
DNAME records or extraneous NS records in the AUTHORITY section unless
these are received via spoofing-resistant transport (TCP, UDP with DNS
cookies, TSIG, or SIG(0)).

ISC would like to thank Yuxiao Wu, Yunyi Zhang, Baojun Liu, and Haixin
Duan from Tsinghua University for bringing this vulnerability to our
attention.

Backport of !838

Closes isc-projects/bind9#5414

Merge branch '5414-security-check-name-vs-qname-again-9.18' into 'v9.18.40-release'

See merge request isc-private/bind9!852
2025-10-02 13:45:32 +02:00
Mark Andrews
4c6d03b0bb
Retry lookups with unsigned DNAME over TCP
To prevent spoofed unsigned DNAME responses being accepted retry
response with unsigned DNAMEs over TCP if the response is not TSIG
signed or there isn't a good DNS CLIENT COOKIE.

To prevent test failures, this required adding TCP support to the
ans3 and ans4 servers in the chain system test.

(cherry picked from commit 2e40705c06)
2025-10-02 13:07:06 +02:00
Mark Andrews
cd17dfe696
Further restrict addresses that are cached when processing referrals
Use the owner name of the NS record as the bailwick apex name
when determining which additional records to cache, rather than
the name of the delegating zone (or a parent thereof).

(cherry picked from commit a41054e9e6)
2025-10-02 13:07:06 +02:00
Mark Andrews
025d61bacd
Tighten restrictions on caching NS RRsets in authority section
To prevent certain spoofing attacks, a new check has been added
to the existing rules for whether NS data can be cached: the owner
name of the NS RRset must be an ancestor of the name being queried.

(cherry picked from commit fa153f791f)
2025-10-02 13:07:06 +02:00
Michał Kępień
85d08e0683 [9.18] [CVE-2025-8677] sec: usr: DNSSEC validation fails if matching but invalid DNSKEY is found
Previously, if a matching but cryptographically invalid key was encountered during
DNSSEC validation, the key was skipped and not counted
towards validation failures. :iscman:`named` now treats such DNSSEC keys
as hard failures and the DNSSEC validation fails immediately, instead of
continuing with the next DNSKEYs in the RRset.

ISC would like to thank Zuyao Xu and Xiang Li from the All-in-One
Security and Privacy Laboratory at Nankai University for bringing this
vulnerability to our attention.

Backport of MR !821

Closes isc-projects/bind9#5343

Merge branch '5343-security-count-invalid-keys-into-validation-fails-9.18' into 'v9.18.40-release'

See merge request isc-private/bind9!843
2025-10-02 12:58:05 +02:00
Ondřej Surý
7c5b8ef055
Fail the DNSSEC validation if matching but invalid DNSKEY is found
If a matching but cryptographically invalid key was encountered during
the DNSSEC validation, the key would be just skipped and not counted
towards validation failures.  Treat such DNSSEC keys as hard failures
and fail the DNSSEC validation immediatelly instead of continuing the
DNSSEC validation with the next DNSKEYs in the RRset.

Co-authored-by: Matthijs Mekking <matthijs@isc.org>

(cherry picked from commit f00117a422)
2025-10-02 12:32:45 +02:00
Michał Kępień
90828f12f7 [9.18] new: ci: Prepare release announcement MR
In the 'release' stage, create an MR automatically with the
corresponding release announcement. The input for this is taken from
metadata.json in bind9-qa.

Backport of MR !11039

Merge branch 'backport-andoni/release-announcement-preparation-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!11041
2025-10-01 20:55:37 +02:00
Andoni Duarte Pintado
e518faf1ae Create release announcement MR
In the 'release' stage, create an MR automatically with the
corresponding release announcement. The input for this is taken from
metadata.json in bind9-qa.

(cherry picked from commit 0f75741341)
2025-10-01 14:21:23 +00:00
Andoni Duarte
69ec7a8fe7 [9.18] new: ci: Merge tag back to its base branch in tag pipeline
Add a CI job to merge tags back to the respective base branch in tag pipelines.

Backport of MR !11001

Merge branch 'backport-andoni/add-merge-tag-to-tag-pipeline-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!11025
2025-09-29 12:55:49 +00:00
Andoni Duarte Pintado
1813a5045b Merge tag back to its base branch in tag pipeline
Merging a tag to its base branch will now be a manual job in its tag
pipeline.

(cherry picked from commit 22bc6a7063)
2025-09-29 12:02:43 +00:00
Michał Kępień
2f91150753 [9.18] fix: nil: Reformat strings broken by successive clang-format runs
Backport of MR !11002

Merge branch 'backport-marka-re-format-strings-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!11007
2025-09-29 13:17:13 +02:00
Mark Andrews
955874f0bc
re-split STATIC_ASSERT message
(cherry picked from commit ccc41c7044)
2025-09-29 13:08:24 +02:00
Mark Andrews
7b4315b7a6
re-split log message text
(cherry picked from commit a64c350523)
2025-09-29 13:08:24 +02:00
Nicki Křížek
b49954e458 [9.18] new: test: Add nsX fixtures to pytest
The nsX are utility fixtures which can be used instead of the servers
fixture, which requires longer syntax(i.e. servers["nsX"]).

---

This MR is basically backporting pytest utility fixtures which were introduced to newer branches in !10717. This is a minimal change which only aims to facilitate easier test backports to ~"v9.18" in the future, without changing any of the existing tests.

Merge branch 'nicki/pytest-nsX-fixtures-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!11015
2025-09-25 17:18:11 +02:00
Nicki Křížek
3cfbf636fe Add nsX fixtures to pytest
The nsX are utility fixtures which can be used instead of the servers
fixture, which requires longer syntax(i.e. servers["nsX"]).
2025-09-25 16:37:35 +02:00
Nicki Křížek
08fe65af25 [9.18] chg: ci: Temporarily disable shotgun jobs
There's currently an issue with the shotgun workflow that's being
investigated. Until it's resolved, there's no point in creating the
shotgun jobs as they'll just fail.

Backport of MR !11005

Merge branch 'backport-nicki/ci-temporarily-disable-shotgun-jobs-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!11009
2025-09-24 15:09:24 +02:00
Nicki Křížek
17c153ecec Temporarily disable shotgun jobs
There's currently an issue with the shotgun workflow that's being
investigated. Until it's resolved, there's no point in creating the
shotgun jobs as they'll just fail.

(cherry picked from commit 2669463b43)
2025-09-24 14:31:13 +02:00
Nicki Křížek
59c7b12158 [9.18] chg: ci: Only run relevant CI jobs based on the changes
Trigger selected CI jobs on MR automatically only if there are related
code changes. Otherwise, offer an option to run the jobs manually in
MRs. For other sources, like schedules, tags etc., execute the jobs as
usual.

Backport of MR !10987

Merge branch 'backport-nicki/ci-restrict-rules-changes-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10993
2025-09-18 16:46:28 +02:00
Nicki Křížek
34c32146bb Run shfmt on util/check-make-install.sh.in
(cherry picked from commit 96974330d5)
2025-09-18 16:09:27 +02:00
Nicki Křížek
2378498eda Only run relevant CI jobs based on the changes
Trigger selected CI jobs on MR automatically only if there are related
code changes. Otherwise, offer an option to run the jobs manually in
MRs. For other sources, like schedules, tags etc., execute the jobs as
usual.

(cherry picked from commit 02c58d9baa)
2025-09-18 16:07:48 +02:00
Nicki Křížek
5e8c0621af Add .sh extension to shell scripts
Use .sh(.in) file extension consistently for shell scripts
to allow more reliable detection of shell scripts based on their file
extension.

(cherry picked from commit 2d690499dd)
2025-09-18 16:07:00 +02:00
Nicki Křížek
0f8aed697b [9.18] fix: test: Increase wait_for_log timeout in kasp shell test
When running with TSAN in CI, the test ocassionally fails on:

exceeded time limit waiting for literal 'keymgr: purgekeys.kasp done' in ns4/named.run

The line is actually present in the logs, but it take slightly longer
than 3 seconds to appear. Increase the wait_for_log timeout of the kasp test to 10
seconds to avoid such issues.

---

Example of failure: https://gitlab.isc.org/isc-projects/bind9/-/jobs/6176192

Merge branch 'nicki/kasp-shell-test-increase-log-timeout' into 'bind-9.18'

See merge request isc-projects/bind9!10976
2025-09-16 16:42:48 +02:00
Nicki Křížek
80a2c09798 Increase wait_for_log timeout in kasp shell test
When running with TSAN in CI, the test ocassionally fails on:

'exceeded time limit waiting for literal 'keymgr: purgekeys.kasp done'
in ns4/named.run'

The line is actually present in the logs, but it take slightly longer
than 3 seconds to appear. Increase the wait_for_log timeout of the kasp
test to 10 seconds to avoid such issues.
2025-09-16 14:06:28 +02:00
Petr Špaček
98603d43dc [9.18] chg: doc: ARM tweaks
Backport of MR !10960

Merge branch 'backport-pspacek/reorder-arm-toc-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10964
2025-09-11 11:56:32 +00:00
Petr Špaček
118736be43 Prevent Sphinx from messing up syntax with "smartquotes" feature
Sphinx's smartquotes feature was rewriting -- to en-dash, "" to proper
English quotes etc. This was messing up syntax at unpredictable places.
Disable this feature instead of attempting to escape all the places in
the manual.

(cherry picked from commit 66e58d3315)
2025-09-11 11:18:47 +00:00
Petr Špaček
2195beca9f Reorder appendices in ARM
The new order hopefully reflects likelihood of someone reading from start
to the end:

DNSSEC Guide
Manual Pages
General DNS Reference Information
Release Notes
Changelog
A Brief History of the DNS and BIND

(cherry picked from commit ed0db245be)
2025-09-11 11:18:47 +00:00
Mark Andrews
990586f049 [9.18] fix: usr: Missing DNSSEC information when CD bit is set in query
The RRSIGs for glue records were not being cached correctly for CD=1 queries.  This has been fixed.

Closes #5502

Backport of MR !10938

Merge branch 'backport-5502-fix-missing-rrsig-with-cd-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10957
2025-09-11 18:48:24 +10:00
Mark Andrews
389e767987 test that rrsigs are returned for glue with +cd
(cherry picked from commit b7e73edd12)
2025-09-11 08:27:50 +10:00
Mark Andrews
f866f7a1e8 Remove dns_rdataset_equals as unneeded
(cherry picked from commit 7d765a3514)
2025-09-11 08:27:50 +10:00
Mark Andrews
018ecbb0c8 Fix missing RRSIGs for "glue" lookups with CD=1
The code to test whether to store the RRSIGs on DNS_R_UNCHANGED
with CD=1 was failing because the comparison methods of the two
rdatatset instances were not compatible.  Move the testing into
dns_db_addrdataset(), and request it by setting the DNS_ADD_EQUALOK
option.  If the option is set and the old and new rrsets compare
as equal, dns_db_addrdataset() returns ISC_R_SUCCESS instead of
DNS_R_UNCHANGED.

(cherry picked from commit b954a1df43)
2025-09-11 08:27:50 +10:00
Ondřej Surý
1162ec2189 [9.18] fix: nil: Replace .reuse/dep5 with REUSE.toml
Update to REUSE Specification 3.2+ that uses REUSE.toml instead of DEP5
based specification.

Backport of MR !10945

Merge branch 'backport-ondrej/cover-reuse-dep5-to-toml-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10950
2025-09-08 12:13:19 +02:00
Ondřej Surý
cec801ea58
Replace .reuse/dep5 with REUSE.toml
Update to REUSE Specification 3.2+ that uses REUSE.toml instead of DEP5
based specification.

(cherry picked from commit 5d03261448)
2025-09-08 11:33:09 +02:00
Petr Špaček
848b4936b1 [9.18] chg: doc: Clarify rrset-order random distribution
The randomized order of the records in the rrset is not uniform across
all permutations.  Clarify this in the documentation.

Closes #5485

Backport of MR !10909

Merge branch 'backport-ondrej/clarify-rrset-order-random-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10936
2025-09-03 12:47:37 +00:00
Ondřej Surý
d7c7407e56 Clarify rrset-order random distribution
The randomized order of the records in the rrset is not uniform across
all permutations.  Clarify this in the documentation.

(cherry picked from commit 369c8dc388)
2025-09-03 06:53:08 +00:00
Mark Andrews
d7d4e94d08 [9.18] new: usr: Support for parsing HHIT and BRID records has been added
Closes #5444

Backport of MR !10795

Merge branch 'backport-5444-add-hhit-and-brid-records-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10933
2025-09-03 12:21:29 +10:00
Mark Andrews
22d6404cff Add tests for BRID and HHIT
(cherry picked from commit 92621e6390)
2025-09-03 11:10:52 +10:00
Mark Andrews
4a076fd0c0 Add support for parsing and displaying BRID rdata type
(cherry picked from commit 6b29da55fc)
2025-09-03 11:10:52 +10:00
Mark Andrews
3df5d60de8 Add support for parsing and displaying HHIT rdata type
(cherry picked from commit 37041c3ec3)
2025-09-03 11:10:51 +10:00
Mark Andrews
3e787e9893 [9.18] fix: usr: RPZ canonical warning displays zone entry incorrectly
When an IPv6 rpz prefix entry is entered incorrectly the log
message was just displaying the prefix rather than the full
entry.  This has been corrected.

Closes #5491

Backport of MR !10890

Merge branch 'backport-5491-rpz-canonical-warning-displays-zone-entry-incorrectly-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10931
2025-09-03 10:21:09 +10:00
Mark Andrews
85840b98b5 Add non canonical form entry to trigger log message
(cherry picked from commit 76db9e276f)
2025-09-02 23:43:46 +00:00
Mark Andrews
823e39a932 RPZ canonical warning displays zone entry incorrectly
Do not insert a NUL into ip_str too early as the full value
is needed later.  Only insert the NUL immediately before
displaying just the prefix string.

(cherry picked from commit 283da99f02)
2025-09-02 23:43:45 +00:00
Michał Kępień
e28c95c116 rem: usr: Deprecate the "tkey-domain" statement
Mark the :any:`tkey-domain` statement as deprecated since it is only
used by code implementing TKEY Mode 2 (Diffie-Hellman), which was
removed from newer BIND 9 branches.

See #4204

Merge branch '4204-deprecate-tkey-domain' into 'bind-9.18'

See merge request isc-projects/bind9!10783
2025-09-01 22:29:29 +02:00
Michał Kępień
6e3203a5b5
Deprecate the "tkey-domain" statement
Mark the "tkey-domain" statement as deprecated since it is only used by
code implementing TKEY Mode 2 (Diffie-Hellman), which was removed from
newer BIND 9 branches.
2025-09-01 22:04:28 +02:00
Michał Kępień
2705307f81 [9.18] rem: usr: Deprecate the "tkey-gssapi-credential" statement
The :any:`tkey-gssapi-keytab` statement allows GSS-TSIG to be set up in
a simpler and more reliable way than using the
:any:`tkey-gssapi-credential` statement and setting environment
variables (e.g. ``KRB5_KTNAME``). Therefore, the
:any:`tkey-gssapi-credential` statement has been deprecated;
:any:`tkey-gssapi-keytab` should be used instead.

For configurations currently using a combination of both
:any:`tkey-gssapi-keytab` *and* :any:`tkey-gssapi-credential`, the
latter should be dropped and the keytab pointed to by
:any:`tkey-gssapi-keytab` should now only contain the credential
previously specified by :any:`tkey-gssapi-credential`.

See #4204

Backport of MR !10782

Merge branch 'backport-4204-deprecate-tkey-gssapi-credential-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10925
2025-09-01 22:01:07 +02:00
Michał Kępień
57271272d1 Deprecate the "tkey-gssapi-credential" statement
The "tkey-gssapi-keytab" statement enables GSS-TSIG to be set up in a
simpler and more reliable way than using the "tkey-gssapi-credential"
statement and setting environment variables (e.g. KRB5_KTNAME).

Mark the "tkey-gssapi-credential" statement as deprecated to eventually
only have one method for setting up GSS-TSIG in named.  Do not mention
"tkey-gssapi-credential" in the section of the ARM on dynamic updates.

(cherry picked from commit 6de435c528)
2025-09-01 19:34:19 +00:00
Michal Nowak
7a33fbbca1 [9.18] new: ci: Add Debian "trixie"
Backport of MR !10827

Merge branch 'backport-mnowak/add-debian-trixie-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10922
2025-09-01 19:40:26 +02:00
Michal Nowak
c71cc5d311
Make "trixie" the base image
(cherry picked from commit bb26409f34)
2025-09-01 17:37:52 +02:00
Michal Nowak
8e2f5c36ee
Add Debian "trixie"
(cherry picked from commit 263810e779)
2025-09-01 17:24:13 +02:00
Ondřej Surý
48c30cfcd0 [9.18] fix: dev: Add and use __attribute__((nonnull)) in dnssec-signzone.c
Clang 20 was spuriously warning about the possibility of passing a NULL file pointer
to `fprintf()`, which uses the 'nonnull' attribute. To silence the warning, the functions
calling `fprintf()` have been marked with the same attribute to assure that NULL can't be
passed to them in the first place.

Close #5487

Backport of MR !10888

Merge branch 'backport-5487-mark-passed-file-pointer-as-nonnull-in-dnssec-signzone-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10914
2025-08-28 17:02:56 +02:00