From nobody Wed Nov 24 14:35:38 2021 X-Original-To: ports-bugs@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 6C026189C9F8 for ; Wed, 24 Nov 2021 14:35:39 +0000 (UTC) (envelope-from bugzilla-noreply@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 4Hzk7v0cF1z4ddm for ; Wed, 24 Nov 2021 14:35:39 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 E5AD43A8A for ; Wed, 24 Nov 2021 14:35:38 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 1AOEZcgF017342 for ; Wed, 24 Nov 2021 14:35:38 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 1AOEZcoQ017341 for ports-bugs@FreeBSD.org; Wed, 24 Nov 2021 14:35:38 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: ports-bugs@FreeBSD.org Subject: [Bug 260017] security/cyrus-sasl2: Review and skim patch-plugins_gssapi.c Date: Wed, 24 Nov 2021 14:35:38 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: michael.osipov@siemens.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: ume@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter flagtypes.name Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Ports bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-ports-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-ports-bugs@freebsd.org X-BeenThere: freebsd-ports-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637764539; 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=Xv3joYn4szrKm1+uLeZdHG6tHYJITx6eq1TMAjLlF8Y=; b=XqkN17C3PrDAAVf98Us73xVa0ueX1kGUmu8L0caI9bF4vuWJSYcTQYJHedQM7Ae7jvrrOH ehUamh/1SXDQvGbMqS0PRzd6M+UqZyr3HS326y7tJvf53W+D2bPrN0BAg76ozMkTb6bbd1 txMYXSZeQWSOFzUAQTPJ3CrTblusMdXDaP6SOrGJTN5qvdSD3sto4t3JTUUvaje1G+xQB9 dTLkkxRQza0Cbt/afvVfh3Jd2YfnaWck7e4OMGv5DeG97icxUvqUkNyCvc/Uty3RPaOUbu aNjtyA5TZJFpivMUmkZm+VEyo8eR+pMHUVTmfcuNHE79hY8/WEqT80gQ8QtazA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637764539; a=rsa-sha256; cv=none; b=X+hZ617jycOKKvWm/m2y/ZUGL4MFlO2OKKWlmnkFV94Nk59AmfbgC5+/FDztHj1UCRw2ZE t8kr+tuS3BLY9HN93LMNrHqHd6CiQMbqwKSFA6xrZFS6QQ5EAvUY8nYwQUgL9NNoTqPWnH x+znx3tzhvsRsL8zTKJgwA4xr/MslUnuhe1yZJ5UXVqG9TfIHbyeXP7t0r+QWDP1LveIht ylBFSVds7to8ZmqPOfojyN7yDlHOUwhVMG2TzHR42USu+H0kjcoq0pvIUsp4gnu3K5VVyP bMO5n4QD2EqakWUNpJ3EEVIgIOvJ0eBwIBVNEPknioJOjMWTvgwJ4vvzjV8n3A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D260017 Bug ID: 260017 Summary: security/cyrus-sasl2: Review and skim patch-plugins_gssapi.c Product: Ports & Packages Version: Latest Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: Individual Port(s) Assignee: ume@FreeBSD.org Reporter: michael.osipov@siemens.com Assignee: ume@FreeBSD.org Flags: maintainer-feedback?(ume@FreeBSD.org) During an evaluation of a new server we have discovered (severe) issues with that custom patch: > +#if 0 > params->utils->log(params->utils->conn, SASL_LOG_DEBUG, > "GSSAPI client step %d", text->state); > +#endif Why are you taking away this debug output from me? I should have access to = this as a developer. > + /* > + * If caller didn't provide creds already. > + * > + * In the case of Kerberos, a client typically wants to use > + * a credential in either a keytab file or the credentials cache > + * of the current process context. This code path will try to > + * find a credential in the specified keytab file, then the > + * credentials cache. The keytab file can be specified by > + * "keytab" option, and it is configured by using > + * gsskrb5_register_acceptor_identity() API when available. > + */ > + if (client_creds =3D=3D GSS_C_NO_CREDENTIAL) { > + GSS_LOCK_MUTEX_CTX(params->utils, text); > + maj_stat =3D gss_acquire_cred(&min_stat, > + text->server_name, > + GSS_C_INDEFINITE, > + GSS_C_NO_OID_SET, > + GSS_C_INITIATE, > + &text->client_creds,=20 > + NULL,=20 > + NULL); > + GSS_UNLOCK_MUTEX_CTX(params->utils, text); > + > + /* > + * Ignore the error intentionally. The credential was > + * not found in the specified keytab file. > + */ > + if (GSS_ERROR(maj_stat) =3D=3D 0) { > + client_creds =3D text->client_creds; > + } > + } > + > + /* Try the credentials cache. */ This is problematic as a whole. I understand the reason why it was imported, but it is broken: It acquires a client credential (GSS_C_INITIATE), but supplies the server n= ame (text->server_name) for the target cred. That struct is likely memory garba= ge and will lead to a SIGSEGV. It has to be NULL. If you check the log of that file you see that it has been reverted in https://github.com/cyrusimap/cyrus-sasl/commit/26835b156ec9b69f22c3f15da9c3= ab671b2d22dc for the obvious reasons also described in: https://github.com/cyrusimap/cyrus-sasl/pull/593 The next hunks suffer from the same broken logical approach and have been reverted ih the commit from above. Ideally, the entire file is removed. --=20 You are receiving this mail because: You are the assignee for the bug.=