]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
11 days agoTolerate dnspython post-2038 timestamp overflow on 32-bit 12083/head 328202
Michal Nowak [Thu, 21 May 2026 07:31:15 +0000 (07:31 +0000)] 
Tolerate dnspython post-2038 timestamp overflow on 32-bit

dnspython's RRSIG.to_text() converts the signature inception/expiration
fields by calling time.gmtime(), which on 32-bit platforms raises
OverflowError for values past 2038-01-19 (INT32_MAX). Several DNSSEC
test fixtures use far-future expirations: the precomputed RRSIGs in
the dnssec test's rsasha1.example.db.in zone expire in 2093, ans4 of
the chain test hardcodes 2090, and ans10 of the dnssec test uses
2**32-1 (year 2106). Whenever a response carrying such an RRSIG is
formatted with str()/to_text() the overflow propagates out and either
fails the test (when triggered in isctest.query's debug logging) or
kills the asyncserver-based ans* server (when triggered in its
response logger), which in turn cascades into "Failed to stop
servers" teardown errors and SERVFAIL responses for subsequent tests.

Wrap the to_text() calls in isctest/query.py and the str(response)
call in asyncserver's _log_response() with try/except OverflowError,
falling back to a placeholder message. The conversions are only used
for debug logging, so losing the human-readable form there does not
affect what the tests actually validate.

Assisted-by: Claude:claude-opus-4-7
(cherry picked from commit 968ccdeeda3f258d00b01064bbfd84d612079a11)

11 days agoAdd Debian "trixie" (386)
Michal Nowak [Thu, 21 May 2026 04:32:23 +0000 (06:32 +0200)] 
Add Debian "trixie" (386)

(cherry picked from commit b076c43b1c8bb9b32f5c4d049acfa0b859f4c3eb)

12 days ago[9.18] fix: doc: Remove 9.21-only release note from May 2026 release notes
Andoni Duarte [Thu, 21 May 2026 13:55:47 +0000 (13:55 +0000)] 
[9.18] fix: doc: Remove 9.21-only release note from May 2026 release notes

Issue #5826 has two different fixes: one released in April 2026 that
applies to 9.20 and 9.18, and another released in May 2026 that applies
to 9.21. The 9.21 release note was mistakenly included in the release
notes for 9.20 and 9.18. This commit removes it.

Backport of MR !12067

Merge branch 'backport-andoni/fix-doc-duplicate-note-5826-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!12078

12 days agoRemove 9.21-only release note from May 2026 release notes 12078/head
Andoni Duarte Pintado [Thu, 21 May 2026 07:14:51 +0000 (09:14 +0200)] 
Remove 9.21-only release note from May 2026 release notes

Issue #5826 has two different fixes: one released in April 2026 that
applies to 9.20 and 9.18, and another released in May 2026 that applies
to 9.21. The 9.21 release note was mistakenly included in the release
notes for 9.20 and 9.18. This commit removes it.

(cherry picked from commit 931bc821d82dfa259bb6ed82706a891f200a0976)

12 days ago[9.18] fix: usr: Clear REDIRECT flag when it isn't needed
Michał Kępień [Thu, 21 May 2026 13:14:29 +0000 (15:14 +0200)] 
[9.18] fix: usr: Clear REDIRECT flag when it isn't needed

When `nxdomain-redirect` is in use, and a recursive query is used to get the redirected answer, a flag is set to distinguish it from a normal recursive response. Previously, that flag was left set afterward, which could trigger an assertion if a normal recursive query was sent later on behalf of the same client: for example, because the `filter-aaaa` plugin was in use.  This has been fixed.

Closes #5936

Backport of MR !12073

Merge branch 'backport-5936-clear-redirect-flag-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!12077

12 days agoClear REDIRECT flag when it isn't needed 12077/head
Evan Hunt [Tue, 5 May 2026 00:05:11 +0000 (17:05 -0700)] 
Clear REDIRECT flag when it isn't needed

The NS_QUERYATTR_REDIRECT flag is set when processing a recursive
NXDOMAIN redirection lookup, so that if that lookup also returns
NXDOMAIN we don't end up looping.

Previously, the flag was left active after use, but if the
same client triggered a subsequent recursive lookup (for example,
in the filter-aaaa plugin), then the wrong branch could be reached
in query_resume(), potentially leading to an assertion failure.  This
has been fixed.

(cherry picked from commit 3ff00183086f304c71076a069376e37692a7c9ff)

12 days ago[9.18] fix: dev: Validate nsec3hash arguments instead of relying on atoi()
Michal Nowak [Thu, 21 May 2026 12:50:59 +0000 (14:50 +0200)] 
[9.18] fix: dev: Validate nsec3hash arguments instead of relying on atoi()

The nsec3hash tool parsed its algorithm, flags, and iterations
arguments with atoi(), then range-checked the result. For values
that overflow int during digit-by-digit accumulation, atoi() is
undefined; in practice on musl libc the modular wrap leaves
n == 0, which silently passes the "iterations > 0xffffU" check.
On Alpine Linux this made nsec3hash succeed with iterations
treated as 0 for inputs like 4294967296 (2^32).

The latent bug only surfaced when the recent image rebuild pulled
in Hypothesis 6.152.9 (2026-05-19), which unified the distribution
used for bounded and unbounded integers() strategies. The new
smoother distribution explores the 2^32 boundary on unbounded
ranges like integers(min_value=65536); earlier versions did not
reach there, so test_nsec3hash_too_many_iterations only started
failing on Alpine after the image refresh.

Replace the three atoi() calls with isc_parse_uint8 /
isc_parse_uint16, which uniformly reject overflow, trailing
garbage, leading sign, and non-numeric input across libc
implementations. As a side effect, error messages now include
the offending argument and a specific reason ("out of range" vs
"not a valid number").

Assisted-by: Claude:claude-opus-4-7
Closes #6013

Backport of MR !12062

Merge branch 'backport-6013-nsec3hash-iterations-overflow-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!12075

12 days agoValidate nsec3hash arguments instead of relying on atoi() 12075/head
Michal Nowak [Wed, 20 May 2026 17:58:41 +0000 (17:58 +0000)] 
Validate nsec3hash arguments instead of relying on atoi()

The nsec3hash tool parsed its algorithm, flags, and iterations
arguments with atoi(), then range-checked the result. For values
that overflow int during digit-by-digit accumulation, atoi() is
undefined; in practice on musl libc the modular wrap leaves
n == 0, which silently passes the "iterations > 0xffffU" check.
On Alpine Linux this made nsec3hash succeed with iterations
treated as 0 for inputs like 4294967296 (2^32).

The latent bug only surfaced when the recent image rebuild pulled
in Hypothesis 6.152.9 (2026-05-19), which unified the distribution
used for bounded and unbounded integers() strategies. The new
smoother distribution explores the 2^32 boundary on unbounded
ranges like integers(min_value=65536); earlier versions did not
reach there, so test_nsec3hash_too_many_iterations only started
failing on Alpine after the image refresh.

Replace the three atoi() calls with isc_parse_uint8 /
isc_parse_uint16, which uniformly reject overflow, trailing
garbage, leading sign, and non-numeric input across libc
implementations. As a side effect, error messages now include
the offending argument and a specific reason ("out of range" vs
"not a valid number").

Assisted-by: Claude:claude-opus-4-7
(cherry picked from commit e13302a6bc9b196564b5e7afe703fae24311ceeb)

12 days ago[9.18] chg: test: Clean up custom server code in the "resend_loop" system test
Michał Kępień [Thu, 21 May 2026 10:49:10 +0000 (12:49 +0200)] 
[9.18] chg: test: Clean up custom server code in the "resend_loop" system test

Apply assorted cleanups to `bin/tests/system/resend_loop/ans3/ans.py`.

Backport of MR !12063

Merge branch 'backport-michal/resend_loop-test-ans3-cleanup-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!12072

12 days agoFollow common naming and coding conventions 12072/head
Michał Kępień [Thu, 21 May 2026 09:52:56 +0000 (11:52 +0200)] 
Follow common naming and coding conventions

Make the handlers defined in bin/tests/system/resend_loop/ans3/ans.py
follow canonical naming conventions used in other system tests.  Keep
all server initialization code in the main() function.

(cherry picked from commit c5a30a722098f23c1fd3a7cd53de4d5164941dcd)

12 days agoTurn _get_cookie() into a method
Michał Kępień [Thu, 21 May 2026 09:52:56 +0000 (11:52 +0200)] 
Turn _get_cookie() into a method

Since the _get_cookie() function is only used by the CookieHandler
class, make the former a method of the latter to keep related logic
close in the source code.

(cherry picked from commit c3839e830cfa5a8cd3ef4bdd3e5db7c0c0ee01dc)

12 days agoTweak the _get_cookie() method
Michał Kępień [Thu, 21 May 2026 09:52:56 +0000 (11:52 +0200)] 
Tweak the _get_cookie() method

The "len(cookie.server) == 0" condition is superfluous for the
"resend_loop" system test, so remove it.  Add a return type annotation
to the _get_cookie() function.

(cherry picked from commit 5fa2bd7e53e1d6ee6ebcc04b0bf5f303d3e85570)

12 days agoRemove workarounds for dnspython < 2.7.0
Michał Kępień [Thu, 21 May 2026 09:52:56 +0000 (11:52 +0200)] 
Remove workarounds for dnspython < 2.7.0

dnspython 2.7.0 is now required to run the BIND 9 system test suite.
Drop the workarounds for older dnspython versions as they are now
redundant.

(cherry picked from commit c9ceb191e8e45c461b8f03e853bef0d9f0eb403f)

12 days agoFix flawed response logic for COOKIE-less queries
Michał Kępień [Thu, 21 May 2026 09:52:56 +0000 (11:52 +0200)] 
Fix flawed response logic for COOKIE-less queries

The "yield" keyword does not cause a function to return.  By design,
get_responses() may yield multiple DNS responses in a single call.  As
currently implemented, CookieHandler.get_responses() sends two responses
to each client query that does not contain a COOKIE option.  Make the
logic in that method consistent with code comments by only sending one
response to every query - either SERVFAIL or BADCOOKIE, never both.

(cherry picked from commit de42425bbd6f51edf2abc0e57d4d3e3dd2e92159)

12 days agoDrop redundant uses of authoritative=True
Michał Kępień [Thu, 21 May 2026 09:52:56 +0000 (11:52 +0200)] 
Drop redundant uses of authoritative=True

The ans3 custom server instance is created with default_aa=True.  Do not
pass the authoritative=True keyword argument to the DnsResponseSend
constructor in CookieHandler.get_responses() as it is redundant.

(cherry picked from commit c61539279d4ecc04f9816b2ae62d63ed8a143c19)

12 days agoDrop unnecessary qctx.prepare_new_response() call
Michał Kępień [Thu, 21 May 2026 09:52:56 +0000 (11:52 +0200)] 
Drop unnecessary qctx.prepare_new_response() call

The ans3 custom server does not have any zones defined, so the responses
passed to its handlers by core isctest.asyncserver code are guaranteed
to be empty.  Remove a call to qctx.prepare_new_response() from
CookieHandler.get_responses() as it is redundant.

(cherry picked from commit 802c03313f99f622b979aa3bb548e3a4eb4340d3)

12 days agoRemove NoErrorHandler
Michał Kępień [Thu, 21 May 2026 09:52:56 +0000 (11:52 +0200)] 
Remove NoErrorHandler

The NoErrorHandler class does not get matched to any query sent by ns4
in the "resend_loop" test.  Remove it as it is redundant.

(cherry picked from commit a296bcf587eb78b40e15cff0e8f4f4a2bd6e99e1)

12 days agoSimplify match criteria for CookieHandler
Michał Kępień [Thu, 21 May 2026 09:52:56 +0000 (11:52 +0200)] 
Simplify match criteria for CookieHandler

The CookieHandler class handles all traffic for the "example." domain.
Make it a subclass of DomainHandler to simplify its definition.

(cherry picked from commit ba6eee2b80064c459d21bb7a8723bea0a3d208fd)

12 days agoSimplify ./NS query handling
Michał Kępień [Thu, 21 May 2026 10:02:20 +0000 (12:02 +0200)] 
Simplify ./NS query handling

Replace PrimeHandler with a StaticResponseHandler subclass achieving the
same goal.

(cherry picked from commit c0f01b60fdf7c01de84ed28d8942bab28650e27c)

12 days ago[9.18] chg: ci: Various autorebase improvements
Michał Kępień [Thu, 21 May 2026 09:36:49 +0000 (11:36 +0200)] 
[9.18] chg: ci: Various autorebase improvements

  - Rewrite cherry-pick references during autorebases
  - Fix autorebase error reporting
  - Limit post-push pipelines for autorebased branches
  - Only autorebase when there is anything to rebase
  - Conflate missing commit reference notifications
  - Support autorebasing backported security MRs

Backport of MR !12024

Merge branch 'backport-michal/autorebase-improvements-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!12070

12 days agoSupport autorebasing backported security MRs 12070/head
Michał Kępień [Thu, 21 May 2026 09:13:30 +0000 (11:13 +0200)] 
Support autorebasing backported security MRs

Autorebasing a backported security fix enables convenient refreshing of
cherry-pick references, which makes it trivial for developers to satisfy
Danger rules just before the merge request is merged.  Add a manual CI
job that is only created for backported merge requests targeting
security-* branches.

(cherry picked from commit dd723d93cbebff4e10d8837645229fb9497fb197)

12 days agoConflate missing commit reference notifications
Michał Kępień [Thu, 21 May 2026 09:13:30 +0000 (11:13 +0200)] 
Conflate missing commit reference notifications

Instead of creating a separate (potentially lengthy) Danger notification
for every missing commit reference in a backport, produce a single
notification with a list of all unreferenced commit hashes.  This makes
Danger output more concise while retaining all the relevant feedback for
the developer.

(cherry picked from commit 086780dcf08ce1279dee6d30c380e6c0446b17af)

12 days agoOnly autorebase when there is anything to rebase
Michał Kępień [Thu, 21 May 2026 09:13:30 +0000 (11:13 +0200)] 
Only autorebase when there is anything to rebase

In an optimistic future, security-* branches will become empty, at least
intermittently.  When that happens, there will be nothing left to rebase
on those branches, so when something gets merged into their base
branches, an autorebase will effectively be a fast-forward.  While the
existing autorebase logic would handle such a case perfectly fine, it is
prudent to avoid creating a test pipeline after pushing such a
fast-forward update as the code revision getting pushed will have
already been tested by other pipelines.  However, the push should still
happen as non-empty downstream autorebased branches may exist and those
will still need to be rebased.  Achieve both of these objectives by
checking early whether there is anything to rebase and pushing the
fast-forwarded version of the branch without setting the AUTOREBASE CI
variable if there is not.

(cherry picked from commit 497f771ae32c9183d02b66d3eafd53839799d016)

12 days agoLimit post-push pipelines for autorebased branches
Michał Kępień [Thu, 21 May 2026 09:13:30 +0000 (11:13 +0200)] 
Limit post-push pipelines for autorebased branches

Current CI job triggering rules cause a full pipeline to be started
after every push to security-* branches.  In this context, "push" means
"branch update", which covers both "git push" invocations and merging a
merge request.  Meanwhile, running a test pipeline is only desired after
a rebase; if a branch is fast-forwarded, it means that a merge request
has been merged into it and a pipeline should have already been run for
that merge request itself.  Limit resource use by only triggering
pipelines for security-* branches when they are pushed to with a "magic"
CI variable that is only set in autorebase jobs.  Leave all the other
triggering rules (for scheduled/manual pipelines) intact.

(cherry picked from commit 5cd870053ef2df8f45e9f3fd7b203dbd1af2daad)

12 days agoFix autorebase error reporting
Michał Kępień [Thu, 21 May 2026 09:13:30 +0000 (11:13 +0200)] 
Fix autorebase error reporting

The logic used for detecting the commit breaking an autorebase does not
work correctly if the offending commit is not the first one applied
during the "reverse rebase".  Fix by using REBASE_HEAD instead of
processing the output of "git status" in a convoluted way.

Furthermore, the approach used for identifying the first offending merge
request in the case of a successful autorebase followed by a failed
build only works correctly if the base branch is not autorebased itself.
Since a solution that would work correctly for a branch autorebased on
top of a branch that only moves forward does not work correctly for a
branch autorebased on top of another autorebased branch and vice versa,
accurately identifying the most likely culprit after a successful
autorebase is a very complicated and brittle task.  Since reporting no
details at all is arguably better than reporting false details, only
produce a minimal error notification if the build fails after a
successful autorebase.

(cherry picked from commit 4c0e93108e936569c0a2e92bdfd65edff0f82c65)

12 days agoRewrite cherry-pick references during autorebases
Michał Kępień [Thu, 21 May 2026 09:13:30 +0000 (11:13 +0200)] 
Rewrite cherry-pick references during autorebases

Use a custom rebasing script instead of "git rebase" to enable rewriting
cherry-pick references during autorebases.

(cherry picked from commit 98c3f339bf9271b3ef7d79aef30d25a6a26e3c92)

12 days ago[9.18] new: ci: Add Fedora 44
Michal Nowak [Thu, 21 May 2026 06:55:46 +0000 (08:55 +0200)] 
[9.18] new: ci: Add Fedora 44

Backport of MR !12064

Merge branch 'backport-mnowak/fedora-44-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!12066

12 days agoAdd Fedora 44 12066/head
Michal Nowak [Thu, 9 Apr 2026 04:52:40 +0000 (06:52 +0200)] 
Add Fedora 44

(cherry picked from commit 175b4f171185c40569103007146e75f37b527cbb)

13 days agoMerge tag 'v9.18.49' into bind-9.18
Andoni Duarte [Wed, 20 May 2026 10:18:26 +0000 (10:18 +0000)] 
Merge tag 'v9.18.49' into bind-9.18

2 weeks ago[9.18] rem: usr: Remove ineffective TCP fallback after repeated UDP timeouts
Ondřej Surý [Tue, 19 May 2026 11:05:19 +0000 (13:05 +0200)] 
[9.18] rem: usr: Remove ineffective TCP fallback after repeated UDP timeouts

When an authoritative server failed to respond to two consecutive
UDP queries, named marked the next retry as TCP but still sent it
over UDP, producing misleading dnstap records. The ineffective
retry path has been removed; a corrected TCP fallback will be
restored in future BIND 9 versions.

Closes #5529

Backport of MR !12022

Merge branch 'backport-5529-fix-tcp-fallback-after-udp-timeouts-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!12050

2 weeks agoTemporarily remove TCP fallback after UDP timeouts
Ondřej Surý [Thu, 14 May 2026 08:04:20 +0000 (10:04 +0200)] 
Temporarily remove TCP fallback after UDP timeouts

The retry path in resquery_send() that flipped DNS_FETCHOPT_TCP on a
query whose dispatch had already been bound as UDP in fctx_query() had
no effect on the transport actually used, but did leave a stale TCP
bit visible to downstream consumers (dnstap framing, cookie checks,
the AUTHORITY-NS spoofability guard).

The ineffective code has been removed from resquery_send().  The
TCP fallback functionality will be corrected and restored in the next
commit.

Assisted-by: Claude:claude-opus-4-7
(cherry picked from commit 01523a078a848873be90572171124cdd5c1c7b0c)

2 weeks ago[9.18] fix: nil: More changes to PR-Agent CI job
Ondřej Surý [Sun, 17 May 2026 10:22:29 +0000 (12:22 +0200)] 
[9.18] fix: nil: More changes to PR-Agent CI job

Backport of MR !12037

Merge branch 'backport-ondrej/use-claude-opus-4-6-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!12039

2 weeks agoAdd both Claude 4.6 and ChatGPT in two separate job pipelines
Ondřej Surý [Sat, 16 May 2026 16:02:49 +0000 (18:02 +0200)] 
Add both Claude 4.6 and ChatGPT in two separate job pipelines

(cherry picked from commit ee5e933933aeab6ccb41b315f1f6e8e22a8b8cb9)

2 weeks agoAllow failure to not block pipelines for the PR-Agent CI job
Ondřej Surý [Sat, 16 May 2026 15:53:20 +0000 (17:53 +0200)] 
Allow failure to not block pipelines for the PR-Agent CI job

(cherry picked from commit dae0820f804f9dc1d6f35dd193b8659d8286deba)

2 weeks agoChange the PR-Agent configuration to use Claude 4.6
Ondřej Surý [Sat, 16 May 2026 13:59:40 +0000 (15:59 +0200)] 
Change the PR-Agent configuration to use Claude 4.6

(cherry picked from commit 99194aec84d622b2e3318fd53f4bcff4affa3213)

2 weeks ago[9.18] new: dev: Enable PR-Agent reviews on merge requests
Ondřej Surý [Sat, 16 May 2026 13:08:29 +0000 (15:08 +0200)] 
[9.18] new: dev: Enable PR-Agent reviews on merge requests

Adds a CI job that runs PR-Agent against each merge request opened from the canonical repository, posting an automated review and code-improvement suggestions as MR comments. The job is gated to same-project source branches so the OpenAI key and personal access token are not exposed to fork pipelines.

Backport of MR!12032, MR!12033 and MR!12035

Merge branch 'ondrej/add-pr-agent-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!12036

2 weeks agoAdd PR-Agent job to GitLab CI for merge-request review
Ondřej Surý [Sat, 16 May 2026 06:23:50 +0000 (08:23 +0200)] 
Add PR-Agent job to GitLab CI for merge-request review

Run PR-Agent's `review` and `improve` commands against each merge
request from the canonical repository, posting an automated review
and code-improvement suggestions as MR comments. The rule restricts
the job to MRs whose source project matches CI_PROJECT_PATH so the
OpenAI key and GitLab personal access token are never exposed to
fork pipelines.

(cherry picked from commit 07345b25d931eec3342c9c1c57381896fa7de7cb)
(cherry picked from commit 425745426247b24b36d3e6eb36529d6166104140)
(cherry picked from commit 5550fb84ae1f80382c1a4f44edd3888f8391dca9)

2 weeks ago[9.18] fix: test: Fix flaky reclimit test
Ondřej Surý [Fri, 15 May 2026 07:51:18 +0000 (09:51 +0200)] 
[9.18] fix: test: Fix flaky reclimit test

The max-types-per-name cache eviction tests were flaky because two test steps were missing a sleep between queries, causing TTL-based cache verification to fail when both queries completed within the same second.

Backport of MR !11782

Merge branch 'backport-ondrej/fix-flaky-reclimit-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!12028

2 weeks agoFix flaky reclimit test by adding missing sleep
Ondřej Surý [Wed, 1 Apr 2026 17:19:50 +0000 (19:19 +0200)] 
Fix flaky reclimit test by adding missing sleep

The cache verification in steps 11 and 15 checks that the TTL has
decreased from its initial value to confirm the response was served
from cache, but the sleep between the two queries was missing. Both
queries could complete within the same second, leaving the TTL
unchanged and causing the test to incorrectly conclude the entry was
not cached.

(cherry picked from commit 80f04a9ee5cd90e875243a5ea991e28119bd546b)

2 weeks ago[9.18] chg: usr: Fall back to TCP on a UDP response with a mismatched query id
Ondřej Surý [Fri, 15 May 2026 07:50:52 +0000 (09:50 +0200)] 
[9.18] chg: usr: Fall back to TCP on a UDP response with a mismatched query id

BIND used to wait silently for the correct DNS message id on a UDP fetch
even after receiving a response from the expected server with the wrong
id, leaving room for off-path spoofing attempts to keep guessing within
that window.  The resolver now retries the fetch over TCP on the first
such response, and a new MismatchTCP statistics counter tracks how
often the fallback fires.

Closes #5449

Backport of MR !12023

Merge branch 'backport-5449-immediate-tcp-fallback-on-id-mismatch-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!12026

2 weeks agoSwitch UDP fetches to TCP on the first response with a wrong query id
Ondřej Surý [Thu, 14 May 2026 10:20:19 +0000 (12:20 +0200)] 
Switch UDP fetches to TCP on the first response with a wrong query id

Until now, the dispatcher silently dropped UDP responses from the
expected peer that carried the wrong DNS message id and kept listening
for the correct id to arrive within the read timeout.  An off-path
attacker who knows the destination address and source port of an
outgoing fetch could exploit that quiet retry window to flood the
resolver with guessed responses; with a gigabit link the per-query
success probability grows linearly with the number of guesses that
arrive before the legitimate answer or the timeout.

Treat any such mismatch as a possible spoofing attempt and let the
resolver immediately retry the same query over TCP, the same control
path the truncation handler already uses.

Add a resolver statistics counter - exposed as 'queries retried over TCP
after a response with mismatched query id' in rndc stats and
'MismatchTCP' in the statistics channel

Assisted-by: Claude:claude-opus-4-7
(cherry picked from commit 11bca1051f6ef6658b3602c8d72a2f35abdbdd93)

2 weeks ago[9.18] fix: ci: Don't forward parent yaml variables to stress child pipelines
Michal Nowak [Thu, 14 May 2026 05:01:21 +0000 (07:01 +0200)] 
[9.18] fix: ci: Don't forward parent yaml variables to stress child pipelines

The global RUNNER_SCRIPT_TIMEOUT: 55m in the parent pipeline was being
forwarded to the stress and tsan:stress child pipelines, where forwarded
yaml variables outrank job-level variables. That caused stress jobs with
BIND_STRESS_TESTS_RUN_TIME >= 60 to be killed at 55 minutes, regardless
of the per-job RUNNER_SCRIPT_TIMEOUT set in the generated child config.

Set forward:yaml_variables: false on both trigger jobs; the generated
configs already declare every variable they need.

Assisted-by: Claude:claude-opus-4-7
Backport of MR !12012

Merge branch 'backport-mnowak/fix-stress-test-script-timeout-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!12016

2 weeks agoInherit global TSAN_* variables for tsan stress jobs
Michal Nowak [Wed, 13 May 2026 19:06:41 +0000 (21:06 +0200)] 
Inherit global TSAN_* variables for tsan stress jobs

2 weeks agoInherit global CONFIGURE variable for stress tests
Michal Nowak [Wed, 13 May 2026 17:01:44 +0000 (19:01 +0200)] 
Inherit global CONFIGURE variable for stress tests

CONFIGURE is needed to build BIND 9 stress tests of 9.20 and 9.18
branches.

2 weeks agoSelectively inherit yaml vars in stress trigger jobs
Michal Nowak [Wed, 13 May 2026 09:44:26 +0000 (11:44 +0200)] 
Selectively inherit yaml vars in stress trigger jobs

The parent's global RUNNER_SCRIPT_TIMEOUT: 55m was reaching the stress
and tsan:stress child pipelines via inherited yaml variables, where
inherited values outrank the child's job-level variables. That caused
stress jobs with BIND_STRESS_TESTS_RUN_TIME >= 60 to be killed at 55
minutes, regardless of the per-job RUNNER_SCRIPT_TIMEOUT set in the
generated child config.

Use inherit:variables with a positive list on both trigger jobs:
inherit only CI_REGISTRY_IMAGE so the parent's registry override
(needed for image pulls in the child) flows through, while keeping
RUNNER_SCRIPT_TIMEOUT (and other globals) out of the child pipeline's
variable scope. The per-job RUNNER_SCRIPT_TIMEOUT values set by the
generated child config now take effect.

Assisted-by: Claude:claude-opus-4-7
(cherry picked from commit 73915b73d194c371200ea20d129e3412cf2faa6a)

3 weeks ago[9.18] chg: ci: Set RUNNER_SCRIPT_TIMEOUTs
Michal Nowak [Tue, 12 May 2026 17:14:51 +0000 (19:14 +0200)] 
[9.18] chg: ci: Set RUNNER_SCRIPT_TIMEOUTs

Backport of MR !11750

Merge branch 'backport-mnowak/set-script-timeouts-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!12007

3 weeks agoGet some useful data out of respdiff even in case of a failure
Michal Nowak [Mon, 11 May 2026 17:20:23 +0000 (19:20 +0200)] 
Get some useful data out of respdiff even in case of a failure

Assisted-by: Claude:claude-opus-4-7
(cherry picked from commit 7928127d8b143b30001083cd106cf3519cd9626d)

3 weeks agoPass -r option to respdiff.sh
Michal Nowak [Mon, 11 May 2026 17:19:53 +0000 (19:19 +0200)] 
Pass -r option to respdiff.sh

Tell respdiff.sh where to find the respdiff Python tools (msgdiff.py,
diffsum.py, ...) so the in-tree copy from bind9-qa is used.

Assisted-by: Claude:claude-opus-4-7
(cherry picked from commit 4f410ee1e6b7f5a8cceb3331aa5be3dc74680aee)

3 weeks agoSet RUNNER_SCRIPT_TIMEOUTs
Michal Nowak [Wed, 25 Mar 2026 12:31:49 +0000 (13:31 +0100)] 
Set RUNNER_SCRIPT_TIMEOUTs

Sometimes jobs can get stuck and be terminated by GitLab, leaving us
without artefacts that could contain useful information about why the
job got stuck.

Assisted-by: Claude:claude-opus-4-7
(cherry picked from commit e3d2f5ad948f977df67a349601bd4743f6777539)

3 weeks ago[9.18] new: ci: Add Ubuntu 26.04 Resolute Raccoon
Michal Nowak [Tue, 12 May 2026 13:22:25 +0000 (15:22 +0200)] 
[9.18] new: ci: Add Ubuntu 26.04 Resolute Raccoon

Backport of MR !11812

Merge branch 'backport-mnowak/ubuntu-26.04-resolute-raccoon-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!12002

3 weeks agotsiggss: regenerate kerberos credentials
Mark Andrews [Wed, 17 Aug 2022 01:13:41 +0000 (11:13 +1000)] 
tsiggss: regenerate kerberos credentials

The existing set of kerberos credential used deprecated algorithms
which are not supported by some implementations in FIPS mode.
Regenerate the saved credentials using more modern algorithms.

Added tsiggss/krb/setup.sh which sets up a test KDC with the required
principals for the system test to work.  The tsiggss system test
needs to be run once with this active and KRB5_CONFIG appropriately.
set.  See tsiggss/tests.sh for an example of how to do this.

(cherry picked from commit 3da79d408f3dcbe040a29298fbe3f6d5f57b278d)

3 weeks agoDo not run Noble Numbat unit test job in MRs
Michal Nowak [Tue, 7 Apr 2026 15:57:45 +0000 (17:57 +0200)] 
Do not run Noble Numbat unit test job in MRs

(cherry picked from commit 9978393c360bcf06ccd1bcbfc98f522640c1e04d)

3 weeks agoAdd Ubuntu 26.04 Resolute Raccoon
Michal Nowak [Tue, 7 Apr 2026 15:55:31 +0000 (17:55 +0200)] 
Add Ubuntu 26.04 Resolute Raccoon

(cherry picked from commit 14457ec326a6ef4358d5ac82125e1c1d97f92c3e)

3 weeks ago[9.18] chg: ci: Add commit link and diff to RPM build job logs
Michał Kępień [Mon, 11 May 2026 15:46:55 +0000 (17:46 +0200)] 
[9.18] chg: ci: Add commit link and diff to RPM build job logs

The output of update_rpms.py is terse, making it difficult to verify its
actions.  Add a commit link and "git show" output to the log of every CI
job running the update_rpms.py script in "build" mode to facilitate
double-checking its actions.

Backport of MR !11828

Merge branch 'backport-michal/add-commit-link-and-diff-to-rpm-build-job-logs-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!12000

3 weeks agoAdd commit link and diff to RPM build job logs
Michał Kępień [Mon, 11 May 2026 15:41:50 +0000 (17:41 +0200)] 
Add commit link and diff to RPM build job logs

The output of update_rpms.py is terse, making it difficult to verify its
actions.  Add a commit link and "git show" output to the log of every CI
job running the update_rpms.py script in "build" mode to facilitate
double-checking its actions.

(cherry picked from commit 6d51073f22ad54f00e652b48379f746cb5f15bcb)

3 weeks ago[9.18] fix: ci: Increase GIT_DEPTH for the "assign-milestones" job
Michał Kępień [Mon, 11 May 2026 14:27:39 +0000 (16:27 +0200)] 
[9.18] fix: ci: Increase GIT_DEPTH for the "assign-milestones" job

Cloning tags with the default GIT_DEPTH of 1 prevents the milestone
assignment script from identifying any merge requests that are included
in a given release.  Fix by increasing GIT_DEPTH to an arbitrary value
that is high enough for practical purposes.

The GIT_DEPTH CI variable defaults to 1 for all jobs through the
top-level "variables" key.  Explicitly setting it to 1 in job
definitions is unnecessary and may cause confusion.  Remove these
redundant assignments.

Backport of MR !11996

Merge branch 'backport-michal/fix-assign-milestones-job-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!11998

3 weeks agoRemove redundant "GIT_DEPTH: 1" assignments
Michał Kępień [Mon, 11 May 2026 14:07:47 +0000 (16:07 +0200)] 
Remove redundant "GIT_DEPTH: 1" assignments

The GIT_DEPTH CI variable defaults to 1 for all jobs through the
top-level "variables" key.  Explicitly setting it to 1 in job
definitions is unnecessary and may cause confusion.  Remove these
redundant assignments.

(cherry picked from commit 703ad9a6ded2edf68105cac4181a848496341dcb)

3 weeks agoIncrease GIT_DEPTH for the "assign-milestones" job
Michał Kępień [Mon, 11 May 2026 14:07:47 +0000 (16:07 +0200)] 
Increase GIT_DEPTH for the "assign-milestones" job

Cloning tags with the default GIT_DEPTH of 1 prevents the milestone
assignment script from identifying any merge requests that are included
in a given release.  Fix by increasing GIT_DEPTH to an arbitrary value
that is high enough for practical purposes.

(cherry picked from commit bac4a577597fe3c8d38a86c1317472edca39fc5d)

3 weeks ago[9.18] fix: ci: Fix triggering rules for the "publish-cleanup" job
Michał Kępień [Mon, 11 May 2026 08:14:13 +0000 (10:14 +0200)] 
[9.18] fix: ci: Fix triggering rules for the "publish-cleanup" job

The "publish-cleanup" tag pipeline job is currently created for all
security releases, including BIND -S releases, but it depends on the
"publish" job, which is only created for open source releases.  This
breaks CI configuration for BIND -S tags, preventing pipelines from
getting created for such tags altogether.  Fix by only creating the
"publish-cleanup" job in tag pipelines for open source security
releases.

Backport of MR !11992

Merge branch 'backport-michal/fix-triggering-rules-for-the-publish-cleanup-job-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!11994

3 weeks agoFix triggering rules for the "publish-cleanup" job
Michał Kępień [Mon, 11 May 2026 08:07:38 +0000 (10:07 +0200)] 
Fix triggering rules for the "publish-cleanup" job

The "publish-cleanup" tag pipeline job is currently created for all
security releases, including BIND -S releases, but it depends on the
"publish" job, which is only created for open source releases.  This
breaks CI configuration for BIND -S tags, preventing pipelines from
getting created for such tags altogether.  Fix by only creating the
"publish-cleanup" job in tag pipelines for open source security
releases.

(cherry picked from commit bb40c3463831d5520faf3b9bec1703df2e836684)

3 weeks agoUpdate BIND version for release v9.18.49
Andoni Duarte Pintado [Fri, 8 May 2026 14:41:25 +0000 (16:41 +0200)] 
Update BIND version for release

3 weeks agonew: doc: Prepare documentation for BIND 9.18.49
Andoni Duarte [Fri, 8 May 2026 14:36:53 +0000 (14:36 +0000)] 
new: doc: Prepare documentation for BIND 9.18.49

Merge branch 'andoni/prepare-documentation-for-bind-9.18.49' into 'v9.18.49-release'

See merge request isc-private/bind9!1032

3 weeks agoTweak and reword release notes
Andoni Duarte Pintado [Fri, 8 May 2026 09:46:37 +0000 (11:46 +0200)] 
Tweak and reword release notes

3 weeks agoPrepare release notes for BIND 9.18.49
Andoni Duarte Pintado [Fri, 8 May 2026 09:09:38 +0000 (11:09 +0200)] 
Prepare release notes for BIND 9.18.49

3 weeks agoGenerate changelog for BIND 9.18.49
Andoni Duarte Pintado [Fri, 8 May 2026 09:02:49 +0000 (11:02 +0200)] 
Generate changelog for BIND 9.18.49

3 weeks ago[9.18] chg: ci: Mark merged security fixes as "Not released yet"
Michał Kępień [Thu, 7 May 2026 16:08:34 +0000 (18:08 +0200)] 
[9.18] chg: ci: Mark merged security fixes as "Not released yet"

Adjust the triggering rules for the "merged-metadata" CI job so that
merge requests merged into security-* branches are automatically
assigned to the "Not released yet" milestone, just like merge requests
targeting public branches.  This enables merge requests containing
security fixes to be correctly processed by release automation scripts.

Backport of MR !11984

Merge branch 'backport-pspacek/extend-not-released-yet-milestone-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!11988

3 weeks agoMark merged security fixes as "Not released yet"
Petr Špaček [Tue, 5 May 2026 13:04:36 +0000 (15:04 +0200)] 
Mark merged security fixes as "Not released yet"

Adjust the triggering rules for the "merged-metadata" CI job so that
merge requests merged into security-* branches are automatically
assigned to the "Not released yet" milestone, just like merge requests
targeting public branches.  This enables merge requests containing
security fixes to be correctly processed by release automation scripts.

(cherry picked from commit afdf7bed602b5518b23409c1a140a797c4e6de34)

3 weeks ago[9.18] chg: ci: Enable automatic backports for security fixes
Michał Kępień [Thu, 7 May 2026 15:55:32 +0000 (17:55 +0200)] 
[9.18] chg: ci: Enable automatic backports for security fixes

Ensure the "backports" CI job is created when new changes are merged
into security-* branches.  This enables using backport automation for
security fixes.

Backport of MR !11938

Merge branch 'backport-michal/extend-automatic-backports-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!11986

3 weeks agoEnable automatic backports for security fixes
Michał Kępień [Thu, 7 May 2026 15:45:35 +0000 (17:45 +0200)] 
Enable automatic backports for security fixes

Ensure the "backports" CI job is created when new changes are merged
into security-* branches.  This enables using backport automation for
security fixes.

(cherry picked from commit 88b94a2019397e9c85d49c59aac4e2a11db5f779)

3 weeks ago[9.18] fix: dev: Pass empty string instead of NULL to ns_client_dumpmessage()
Ondřej Surý [Wed, 6 May 2026 11:36:48 +0000 (13:36 +0200)] 
[9.18] fix: dev: Pass empty string instead of NULL to ns_client_dumpmessage()

Pass "" instead of NULL to ns_client_dumpmessage() to get the log message printed.

Backport of MR !1022

Merge branch 'backport-ondrej/fix-ns_client_dumpmessage-calls-9.18' into 'security-bind-9.18'

See merge request isc-private/bind9!1024

3 weeks ago[9.18] chg: usr: Fix CPU spikes and slow queries when cache approaches memory limit
Ondřej Surý [Tue, 5 May 2026 13:20:43 +0000 (15:20 +0200)] 
[9.18] chg: usr: Fix CPU spikes and slow queries when cache approaches memory limit

When the cache grew close to the configured max-cache-size, every subsequent
entry triggered all worker threads to run cache cleanup at once, causing CPU
spikes and a drop in query throughput. Cleanup is now spread probabilistically
across inserts as memory approaches the limit, so the work is distributed evenly
instead of piling up at the threshold.

Backport of MR !1002

Merge branch '5891-improve-overmem-cleaning-9.18' into 'security-bind-9.18'

See merge request isc-private/bind9!1008

3 weeks agoPass empty string instead of NULL to ns_client_dumpmessage()
Ondřej Surý [Wed, 6 May 2026 08:12:35 +0000 (10:12 +0200)] 
Pass empty string instead of NULL to ns_client_dumpmessage()

The two new call sites added by the CLASS-validation work passed NULL
as the reason, but ns_client_dumpmessage() bails out early on a NULL
reason — so the message dump never happened. The intent was to dump
the message and let the follow-up ns_client_log() carry the reason
text, so pass "" to suppress the prefix without short-circuiting the
dump.

(cherry picked from commit 3401cbd16f44b4ecb8b57dc9d1951037db6d0e32)

3 weeks ago[9.18] [CVE-2026-5946] sec: usr: Disable recursion, UPDATE, and NOTIFY for non-IN...
Evan Hunt [Mon, 4 May 2026 22:51:22 +0000 (22:51 +0000)] 
[9.18] [CVE-2026-5946] sec: usr: Disable recursion, UPDATE, and NOTIFY for non-IN views

Recursion, dynamic updates (UPDATE), and zone change notifications
(NOTIFY) are now disabled for views with a class other than IN
(such as CHAOS or HESIOD); authoritative service for non-IN zones
(e.g. version.bind in class CHAOS) continues to work as before.
Servers configured with recursion yes in a non-IN view will log a
warning at startup, and named-checkconf flags the same condition.
UPDATE and NOTIFY messages that specify the meta-classes ANY or NONE
in the question section are now rejected with FORMERR.

This addresses a set of closely related security issues collectively
identified as CVE-2026-5946. ISC would like to thank Mcsky23 for
bringing these issues to our attention.

Backport of https://gitlab.isc.org/isc-private/bind9/-/merge_requests/936

Merge branch 'each-security-disable-chaos-recursion-security-bind-9.18' into 'security-bind-9.18'

See merge request isc-private/bind9!1010

3 weeks agoMake isc_mem_isovermem() probabilistic
Ondřej Surý [Sun, 19 Apr 2026 19:36:43 +0000 (21:36 +0200)] 
Make isc_mem_isovermem() probabilistic

Replace the hysteretic hi_water/lo_water switch with a stochastic
check: always false below lo_water, always true at or above hi_water,
linearly ramped probability in between.  This spreads cache cleaning
across many inserts instead of triggering a thundering herd once the
hi_water mark is crossed (which causes every addrdataset to enter the
LRU purge path simultaneously and serializes lookups behind the node
write locks).

The is_overmem atomic and its stores are no longer needed and are
removed.  The existing tests that asserted specific hysteretic state
transitions are simplified to check only the deterministic boundaries.

(cherry picked from commit ee24d2a1c3361dcc1c48fb29bb2e0b91bc3405e8)

3 weeks ago[9.18] [CVE-2026-3039] sec: usr: Fix GSS-API resource leak
Ondřej Surý [Fri, 1 May 2026 06:39:39 +0000 (08:39 +0200)] 
[9.18] [CVE-2026-3039] sec: usr: Fix GSS-API resource leak

Fixed a memory leak where each GSS-API TKEY negotiation leaked a security context inside the GSS library. An unauthenticated attacker could exhaust server memory by sending repeated TKEY queries to a server with tkey-gssapi-keytab configured. The leaked memory was allocated by the GSS library, bypassing BIND's memory accounting.

Multi-round GSS-API negotiation (GSS_S_CONTINUE_NEEDED) is now rejected, as BIND never supported it correctly and Kerberos/SPNEGO completes in a single round.

Also implemented missing RFC 3645 requirement: the client now verifies that mutual authentication and integrity flags are granted by the GSS-API mechanism (Section 3.1.1).

Closes: https://gitlab.isc.org/isc-projects/bind9/-/issues/5752
Backport of !965

Merge branch 'backport-5752-fix-memory-leak-in-TKEY-negotiation-9.18' into 'security-bind-9.18'

See merge request isc-private/bind9!975

3 weeks agoMake the RD flag optional in isctest.query()
Evan Hunt [Tue, 24 Feb 2026 00:27:52 +0000 (16:27 -0800)] 
Make the RD flag optional in isctest.query()

Add an 'rd' parameter (default True) to isctest.query.create() so
that non-recursive queries can be sent with rd=False.

(cherry picked from commit 12e511310024aac38ce223ee47b5108f06caf8f9)

3 weeks ago[9.18] [CVE-2026-3592] sec: usr: Limit resolver server list size
Colin Vidal [Thu, 30 Apr 2026 18:49:35 +0000 (20:49 +0200)] 
[9.18] [CVE-2026-3592] sec: usr: Limit resolver server list size

When resolving a domain with many nameservers that share overlapping IP addresses (e.g., 10 NS records all pointing at the same set of addresses), BIND could previously waste time querying duplicate addresses and build up excessively large server lists. Deduplicate addresses in the resolver's server list so that each unique IP is only queried once per resolution attempt, regardless of how many NS records point to it and cap the number of addresses stored per nameserver name to 6 (combined A and AAAA), preventing memory and CPU overhead from domains with unusually large NS/glue sets.

Closes isc-projects/bind9#5641

Backport of !909

Merge branch 'backport-5641-selfpointedglue-9.18' into 'security-bind-9.18'

See merge request isc-private/bind9!954

3 weeks agoFix output token and GSS context leaks in TKEY/GSS-API error paths
Ondřej Surý [Fri, 10 Apr 2026 10:51:31 +0000 (12:51 +0200)] 
Fix output token and GSS context leaks in TKEY/GSS-API error paths

In dst_gssapi_acceptctx(), rename outtoken to outtokenp (matching BIND
convention for output pointer parameters) and free the allocated output
token buffer on error in the cleanup path.

In process_gsstkey(), route the empty-principal error path through
cleanup via CLEANUP() instead of returning early, so that the output
token, GSS context, and TSIG key are all freed consistently by the
existing cleanup block.

(cherry picked from commit 6c46c85d02849fb659584275313529794039f433)

3 weeks agoTest server behavior when sending various UPDATE requests
Evan Hunt [Mon, 9 Mar 2026 04:50:04 +0000 (15:50 +1100)] 
Test server behavior when sending various UPDATE requests

Send update messages for zones with CLASS0, ANY and NONE.  The class
ANY UPDATE also attempts to delete a KX record in an existing IN
class zone to trigger a REQUIRE.

Test that the server is still running.

(cherry picked from commit 1fa1e84d286d5a6d9d3b72ed1c2c29142f40c81d)

3 weeks ago[9.18] [CVE-2026-5950] sec: usr: Avoid unbounded recursion loop
Colin Vidal [Thu, 30 Apr 2026 15:55:11 +0000 (17:55 +0200)] 
[9.18] [CVE-2026-5950] sec: usr: Avoid unbounded recursion loop

A bug during bad server handling could cause the resolver to enter an infinite loop, continuously sending queries to an upstream server with no exit condition, until the resolver query timeout was hit. This has been fixed.

ISC would like to thank Billy Baraja (BielraX) for bringing this issue to our attention.

Closes isc-projects/bind9#5804

Backport of !985

Merge branch 'backport-5804-incr-query-counters-9.18' into 'security-bind-9.18'

See merge request isc-private/bind9!982

3 weeks agoFix `resend_loop` system test
Colin Vidal [Thu, 30 Apr 2026 18:02:47 +0000 (19:02 +0100)] 
Fix `resend_loop` system test

Commit `c78016ff91ed33221831b4723108d69639430913` backported asyncserver
features to 9.18 branches, but the `resend_loop` test was still using
the previous API to install handlers (passing a list of handlers rather
than a varags). This is now fixed.

3 weeks agoAdd regression test for GSS-API context leak via TKEY CONTINUE
Ondřej Surý [Fri, 20 Mar 2026 07:43:28 +0000 (08:43 +0100)] 
Add regression test for GSS-API context leak via TKEY CONTINUE

Send crafted SPNEGO NegTokenInit tokens that propose the krb5
mechanism without a mechToken.  This causes gss_accept_sec_context()
to return GSS_S_CONTINUE_NEEDED, which on unfixed code leaks the
GSS context handle (~520 bytes per query).

The test verifies that the server rejects the negotiation (TKEY
error != 0, no continuation token) rather than returning a CONTINUE
response (error=0 with output token).

(cherry picked from commit 2f2fb32d737e12c817880d584145cdf85dbc8d06)

3 weeks agoTest UPDATE behavior in CHAOS and other non-IN classes
Evan Hunt [Tue, 17 Mar 2026 20:45:11 +0000 (13:45 -0700)] 
Test UPDATE behavior in CHAOS and other non-IN classes

Send various UPDATE requests that are known to have caused
crashes previously with deliberately misconfigured non-IN
zones; confirm that UPDATE is not processed.

(cherry picked from commit e2f7ba2a4b6e7e5dba2fb1a2c9b2f0323e9a88be)

3 weeks ago[9.18] sec: usr: Fix outgoing zone transfers' quota issue
Arаm Sаrgsyаn [Thu, 30 Apr 2026 12:59:16 +0000 (12:59 +0000)] 
[9.18] sec: usr: Fix outgoing zone transfers' quota issue

Unauthorized clients could consume outgoing zone transfers quota
and block authorized zone transfer clients. This has been fixed.

Backport of MR !971

Fixes isc-projects/bind9#3589

Merge branch 'backport-3859-security-xfrout-quota-fix-9.18' into 'security-bind-9.18'

See merge request isc-private/bind9!997

3 weeks agorctx_resend() increment query counters
Colin Vidal [Tue, 7 Apr 2026 20:18:58 +0000 (22:18 +0200)] 
rctx_resend() increment query counters

Calls to `rctx_resend()` are done internally within the resolver, in
flow which are not supposed to happens more than once. For instance,
if some query fails, and a specific flag "F" wasn't set, then set the
flag and try again. This wouldn't occur more than once because if the
query fails the next attempt, the flag "F" would be set already, so the
resolver would move to the next server (or give up).

However, a subtle bug missing checking a flag, for instance, could lead
to an unbounded loop re-trying to query the same server. This is now
impossible as `rctx_resend()` also increment the query counters (so if
such case occurs, it would stop once the maximum limit is reached).

The dns_resstatscounter_retry are also only incremented if the
`fctx_query()` succeeds, similar to as is done in `fctx_try()`.

(cherry picked from commit f3e74304889a2e8b69c8e88fc9a383589decda32)

3 weeks agoAdd SRTT-based server selection system test
Colin Vidal [Wed, 4 Mar 2026 17:25:32 +0000 (18:25 +0100)] 
Add SRTT-based server selection system test

Verify that the resolver selects authoritative servers in increasing
SRTT order.  Four servers are configured with increasing response
delays.  100 queries are sent, expecting most to go to the fastest
server (ns2).  Then ns2 stops responding, another 100 queries are
sent and should go to ns3 (the next fastest), and so on through
ns4 and ns5.  Each query uses a unique name to avoid cache hits.

(cherry picked from commit a8d11e14f5b4e4d53219ba751d1b741162b0b84b)

3 weeks agoFix GSS-API context leak in TKEY negotiation
Ondřej Surý [Tue, 17 Mar 2026 23:10:35 +0000 (00:10 +0100)] 
Fix GSS-API context leak in TKEY negotiation

Reject multi-round GSS-API negotiation (GSS_S_CONTINUE_NEEDED) in
dst_gssapi_acceptctx().  Each call to gss_accept_sec_context()
allocates a context inside the GSS library; without this fix, the
context handle was passed back to process_gsstkey() which did not
store it persistently, leaking it on every incomplete negotiation.

An unauthenticated attacker could exhaust server memory by sending
repeated TKEY queries with GSSAPI tokens, each leaking one GSS
context.  The leaked memory is allocated by the GSS library via
malloc(), bypassing BIND's memory accounting.

In practice, Kerberos/SPNEGO (the only mechanism used with BIND)
completes in a single round, so rejecting continuation does not
affect real-world deployments.  See RFC 3645 Section 4.1.3.

(cherry picked from commit 3d8e0d068f08694282c5ecd3bd6c332de6c75485)

3 weeks agoTest CHAOS view recursion behavior
Evan Hunt [Tue, 17 Mar 2026 20:45:11 +0000 (13:45 -0700)] 
Test CHAOS view recursion behavior

Check that recursive and forward queries to views of type CHAOS
are REFUSED, but that authoritative queries are answered correctly.

(cherry picked from commit f33927cd3dd1195f3e70f5798ff7c384f265867e)

3 weeks agoApply XFR-out quota after ACL is checked
Aram Sargsyan [Tue, 31 Mar 2026 13:00:00 +0000 (13:00 +0000)] 
Apply XFR-out quota after ACL is checked

Unauthorized clients can consume XFR-out quota and block authorized
XFR clients. Apply the quota after ACL is checked.

(cherry picked from commit 5615e6c47a2cd00d82d48b568cc55a4b89daa330)

3 weeks agoRefactor incrementing query counters
Colin Vidal [Tue, 7 Apr 2026 20:18:10 +0000 (22:18 +0200)] 
Refactor incrementing query counters

Move the logic incrementing the query counter and the global query
counter into a dedicated helper function.

(cherry picked from commit 05d6da2de54c093689e675e81ae898ee41220666)

3 weeks agoSync asyncserver.py with the development branch
Michał Kępień [Fri, 17 Apr 2026 15:57:05 +0000 (17:57 +0200)] 
Sync asyncserver.py with the development branch

Import bin/tests/system/isctest/asyncserver.py as present in commit
ced002c4ab7b920c9528d315a611a477cb4a9409 on the "main" branch.  This
enables using newer asyncserver.py infrastructure code in system tests
that need to be backported to maintenance branches.

3 weeks agoSkip "deny-answer-address" for non-IN addresses
Evan Hunt [Tue, 17 Mar 2026 20:24:43 +0000 (13:24 -0700)] 
Skip "deny-answer-address" for non-IN addresses

Ensure that we don't attempt an ACL match for answer addresses
when handling a class-CHAOS zone. This is an additional line of
defense for YWH-PGM40640-74.

(cherry picked from commit e62673c765b52307c800e86f0185fe52b573c145)

3 weeks agoAdd xfr quota starvation system test
Alessio Podda [Mon, 13 Apr 2026 13:55:38 +0000 (15:55 +0200)] 
Add xfr quota starvation system test

Add a starvation test that tries to starve the XFR quota with
unautorized requests.

(cherry picked from commit 53135592b7ff6c272b6577b2e7747258628442e3)

3 weeks agoAdd reproducer for BADCOOKIE resend loop
Matthijs Mekking [Thu, 9 Apr 2026 09:32:07 +0000 (11:32 +0200)] 
Add reproducer for BADCOOKIE resend loop

Run malicious server: resend_loop/ans3/ans.py

Start BIND: ns4

Send single query to test.example

The resolver will repeatedly resend queries until the fetch timeout
expires, resulting in resulting in thousands of qrysent while the quota
counter remains 0.

(cherry picked from commit 7eeb463bc58cbd71419aaf189d7829f2dfd8d055)

3 weeks agoAdd system test for self-pointed glue deduplication
Colin Vidal [Thu, 5 Feb 2026 10:20:11 +0000 (11:20 +0100)] 
Add system test for self-pointed glue deduplication

Test the resolver's behavior with self-pointed glue where each NS
has the same set of addresses.  Verify that addresses are
deduplicated and each unique IP is only queried once.

Also test the ADB address limit knob (-T adbaddrslimit=).

(cherry picked from commit c21fc6cb95d77312d6fb891f17ce9df41a25af6d)

3 weeks agoReject meta-classes in UPDATE and NOTIFY messages
Mark Andrews [Tue, 3 Mar 2026 23:00:56 +0000 (10:00 +1100)] 
Reject meta-classes in UPDATE and NOTIFY messages

NOTIFY and UPDATE messages must specify a data class in the
QUESTION/ZONE section.  NONE and ANY are meta-classes and not
appropriate here.  Return FORMERR if either is used.

Rejecting messages with a query class of NONE addresses YWH-PGM40640-72,
YWH-PGM40640-82, and YWH-PGM40640-83.  Rejecting messages with a query
class of ANY addresses YWH-PGM40640-87, YWH-PGM40640-88, and
YWH-PGM40640-117.

Fixes: isc-projects/bind9#5778
Fixes: isc-projects/bind9#5782
Fixes: isc-projects/bind9#5783
Fixes: isc-projects/bind9#5797
Fixes: isc-projects/bind9#5798
Fixes: isc-projects/bind9#5853
(cherry picked from commit c66a1b1e1bfd6c79d7b9bc8d4a59e69f4faa1563)

3 weeks agoRemove duplicate addresses from the resolver SLIST
Colin Vidal [Wed, 4 Feb 2026 09:18:42 +0000 (10:18 +0100)] 
Remove duplicate addresses from the resolver SLIST

The SLIST (essentially `fctx->finds`, forwarders and dual-stack
alternatives aside) can have duplicate server addresses when multiple
in-domain nameservers share the same IP addresses:

  sub.example.          NS      ns1.sub.example.
  sub.example.          NS      ns2.sub.example.
  ns1.sub.example.      A       1.2.3.4
  ns1.sub.example.      A       5.6.7.8
  ns2.sub.example.      A       1.2.3.4
  ns2.sub.example.      A       5.6.7.8

If both 1.2.3.4 and 5.6.7.8 fail to return a valid answer, the resolver
would query each address twice.

The problem is fixed by replacing the two-phase server selection (sort
each find list by SRTT, sort finds by head SRTT) with a single linear
scan in nextaddress() that finds the lowest-SRTT unmarked, non-duplicate
address across all find lists.

The old approach had a correctness bug: after sorting, the resolver
picked the next address from the "current" find list rather than
globally.  For example, with find lists [1, 15, 26] and [3, 4, 5], the
second pick would be SRTT 15 instead of the correct SRTT 3.

The new approach is both simpler and correct: each call to nextaddress()
walks all addresses, skips marked and duplicate entries, and returns the
one with the lowest SRTT.  While this walk is repeated for each server
attempt, it operates on a small bounded list and is negligible compared
to the network I/O of querying the server.

(cherry picked from commit b1c5856a3764b4025e93f8baf06c45c8fa029752)

3 weeks agoValidate DNS message CLASS early in request processing
Ondřej Surý [Wed, 4 Mar 2026 09:46:58 +0000 (10:46 +0100)] 
Validate DNS message CLASS early in request processing

Reject requests with unsupported or misused CLASS values before
further processing.  Only IN, CH, HS, RESERVED0 (for DNS Cookies),
ANY (for TKEY negotiation), and NONE (for DNS UPDATE) are accepted;
all other classes return NOTIMP.  Misuse of NONE or ANY outside
their allowed contexts returns FORMERR.

This adds further protection against bugs of the same general class
as YWH-PGM40640-70 and YWH-PGM40640-73.

(cherry picked from commit 0a687451505037e9f9a850c9cb113aed4995b03f)

3 weeks agoLimit the number of addresses returned per ADB find
Colin Vidal [Thu, 5 Feb 2026 08:46:01 +0000 (09:46 +0100)] 
Limit the number of addresses returned per ADB find

Add a hard limit on the number of addresses that ADB returns from a
single NS lookup (dns_adbfind_t).  This mitigates a flood attack
where an attacker controls a zone with many addresses for a
nameserver, each returning an invalid response.  The global
max-query count (default 50) also limits this, but significant harm
can be done before that limit is reached.

The default limit is now 6 (v4 and/or v6) addresses for an ADB find (so,
ADB looking up for A/AAAA addresses of a name server name). It can be
overridden for testing via 'named -T adbaddrslimit=N'.

(cherry picked from commit 3ec37fc69356ee682bee7f67940613ac31d93d7b)

3 weeks agoDisable UPDATE and NOTIFY for non-IN classes
Evan Hunt [Wed, 4 Mar 2026 21:24:52 +0000 (13:24 -0800)] 
Disable UPDATE and NOTIFY for non-IN classes

Return NOTIMP for UPDATE and NOTIFY requests received for views with a
class other than IN.  Only QUERY is now supported for non-IN views such
as CHAOS.

When running dns dns_rdata_tostruct() with types that are only defined
for class IN, ensure that the class is correct before proceeding.

Add an assertion that any zone being updated is of class IN. (Note
that previously, a DLZ zone could have its class value set incorrectly
to NONE; this has been fixed.)

This addresses YWH-PGM40640-70 and YWH-PGM40640-73 (as well as any
similar problems that might have occurred in the future) by minimizing
the code paths that can be reached by rdata classes other than IN, so it
is safe for the implementation to assume that rdatatypes that are only
defined for class IN, such as SVCB or WKS, have been parsed and
validated, and not accepted as unknown/opaque data.

Fixes: isc-projects/bind9#5777
Fixes: isc-projects/bind9#5779
(cherry picked from commit a6d8e330ed6cf0021bff3f00aa1dc7a296f5aec0)