]> git.ipfire.org Git - thirdparty/bind9.git/commit
Fix GSS-API context leak in TKEY negotiation
authorOndřej Surý <ondrej@isc.org>
Tue, 17 Mar 2026 23:10:35 +0000 (00:10 +0100)
committerOndřej Surý <ondrej@isc.org>
Fri, 1 May 2026 04:54:31 +0000 (06:54 +0200)
commit58c646c4b95efcda759cf194a534290eef38135e
treeb2294d098c59c649838b20c573b1647c7ef5803d
parent42fb4c1b7d7381ec8019f9f668d8ee2157b408a3
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 3883058bf284de2889e4e3676767e58ad91a0ae3)
lib/dns/gssapictx.c
lib/dns/include/dst/gssapi.h
lib/dns/tkey.c