]> 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)
committerMichał Kępień <michal@isc.org>
Thu, 7 May 2026 11:09:18 +0000 (13:09 +0200)
commit9bdace3fa3dd92e6b04e8d26fda8795c3b33f810
tree077ccb9848d11494215b9c0810c6b4d13e708e67
parentf6d193147ab58930ba8659bbb53a1ac390812a92
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)
lib/dns/gssapictx.c
lib/dns/include/dst/gssapi.h
lib/dns/tkey.c