From nobody Mon Aug 14 14:46:04 2023 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RPcf523ppz4qbNS; Mon, 14 Aug 2023 14:46:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RPcf44j0mz3PPD; Mon, 14 Aug 2023 14:46:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692024364; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AbGg5B0ZGhMRKesxeRfm0R0gtsjDq1og8T+xc5zKDlc=; b=UIo1LymfFgKknsWTYliQb/EAoVnHFfQsfy9lfYJqIt/aQloZ6c+Z+mz+MyswZ8DA6ARjoa yymV+ZpBVIl4xCSFB5f578xYzZVX/vwzd4xiiCSPa4tIqPRZbA9MuiWBVxur4UqsC/V6Ct k7la9hYs21UrP9hqeNAry8uStLrWja/Oeuica47YsR5mtakRRe9B1KSSOi+JgcT9RrI0lw EoKlz9SOrxaTEn4M1BW/7n4EhHgXovOHY01ub/RR0GtHJxuhzyIVMLd0ary0dPANh8uca6 kgf4uAL2VPg4OSeUjvT+ZEX5dmC6yGq+HbJTaJfvAzEYHEnbINnC3ZnigoWqRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692024364; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AbGg5B0ZGhMRKesxeRfm0R0gtsjDq1og8T+xc5zKDlc=; b=nPiNQGS6G2PB/NPRMMMC0KxyrsCfhGwxlFqV8fw4yxby5k4qC+F2Zk5HleDUy2KZRmHbzK akbuEgL3VR6S6l0PXG0617tEyg/ayJ0jKrlkQXUhzB49AC8KRTQl/ErlWlZ0/toxH5GsN5 zVBfIdiueEQUKn1coSawSAXNiFzEbghq+Wn7kIPq3EQvGoCAfnnRBEIiztPq3eAJ2dWea3 LRovrGEacZbVf28k2RfKbDn63mHWnEgdW3isQmVJX4u4SCDSSM1cSgTF0MgXLB6bEMdv0r Z2jqGoxPSKF9wXGH2rF0GMCrn+JrdnKbJLH5YVWQMDzmtZ+s/g0ePvfbo3jJ5Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1692024364; a=rsa-sha256; cv=none; b=auHbQlo5fPPuBbLxtsVvdzDqh61HfYomC5RM1obNq9T5EwMreWsb6/Zlp8xu4/B9q4cLgV BR0xKWdzu6nMDGRJjHvGp5wDNl+ajxGPiplXLiUuh6aEtE6d+NtRrkYgSx5uaRZUnETvfZ C/GJihParXsr3jNJkmD+vFL7mXWQ8aHBgg+ISLjRiZvopWB/I+ekahxhVSD+ZphF5jhqbg ztwf+CXeGgLnpe7dKZjy7GZUTkPY2/Q+dTy7BeLYMHkJJCFQ1WFvW8SLs3vlEZeSgTHKwn nALqTfoTeBx9JtTq31xu14rubF8CNiSB5hnzeIafwyQ5Y4cfDRExeZp4aRfleg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4RPcf43lfSzXZ4; Mon, 14 Aug 2023 14:46:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37EEk4XX044590; Mon, 14 Aug 2023 14:46:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37EEk4JV044587; Mon, 14 Aug 2023 14:46:04 GMT (envelope-from git) Date: Mon, 14 Aug 2023 14:46:04 GMT Message-Id: <202308141446.37EEk4JV044587@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Cy Schubert Subject: git: 73ac8e036934 - main - security/krb5-121: Fix double-free in KDC TGS processing List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 73ac8e036934587e606aefad711b19ab9431fe83 Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/ports/commit/?id=73ac8e036934587e606aefad711b19ab9431fe83 commit 73ac8e036934587e606aefad711b19ab9431fe83 Author: Cy Schubert AuthorDate: 2023-08-14 14:43:21 +0000 Commit: Cy Schubert CommitDate: 2023-08-14 14:45:52 +0000 security/krb5-121: Fix double-free in KDC TGS processing Upstream's commit log message: When issuing a ticket for a TGS renew or validate request, copy only the server field from the outer part of the header ticket to the new ticket. Copying the whole structure causes the enc_part pointer to be aliased to the header ticket until krb5_encrypt_tkt_part() is called, resulting in a double-free if handle_authdata() fails. [ghudson@mit.edu: changed the fix to avoid aliasing enc_part rather than check for aliasing before freeing; rewrote commit message] CVE-2023-39975: In MIT krb5 release 1.21, an authenticated attacker can cause a KDC to free the same pointer twice if it can induce a failure in authorization data handling. ticket: 9101 (new) tags: pullup target_version: 1.21-next Obtained from: Upstream git commit 88a1701b4 MFH: 2023Q3 --- security/krb5-121/Makefile | 1 + security/krb5-121/files/patch-kdc_do__tgs__req.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/security/krb5-121/Makefile b/security/krb5-121/Makefile index 4ba2b5aa5cea..fe0251da5e19 100644 --- a/security/krb5-121/Makefile +++ b/security/krb5-121/Makefile @@ -1,5 +1,6 @@ PORTNAME= krb5 PORTVERSION= 1.21.1 +PORTREVISION= 1 CATEGORIES= security MASTER_SITES= http://web.mit.edu/kerberos/dist/${PORTNAME}/${PORTVERSION:C/^[0-9]*\.[0-9]*/&X/:C/X\.[0-9]*$//:C/X//}/ .if !defined(MASTERDIR) diff --git a/security/krb5-121/files/patch-kdc_do__tgs__req.c b/security/krb5-121/files/patch-kdc_do__tgs__req.c new file mode 100644 index 000000000000..b42861d35c02 --- /dev/null +++ b/security/krb5-121/files/patch-kdc_do__tgs__req.c @@ -0,0 +1,14 @@ +--- kdc/do_tgs_req.c.orig 2023-07-10 13:58:20.000000000 -0700 ++++ kdc/do_tgs_req.c 2023-08-14 07:23:14.383349000 -0700 +@@ -1010,8 +1010,9 @@ + } + + if (t->req->kdc_options & (KDC_OPT_VALIDATE | KDC_OPT_RENEW)) { +- /* Copy the whole header ticket except for authorization data. */ +- ticket_reply = *t->header_tkt; ++ /* Copy the header ticket server and all enc-part fields except for ++ * authorization data. */ ++ ticket_reply.server = t->header_tkt->server; + enc_tkt_reply = *t->header_tkt->enc_part2; + enc_tkt_reply.authorization_data = NULL; + } else {