From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.136; helo=mga12.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 40A982117A29B for ; Wed, 17 Oct 2018 07:58:43 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Oct 2018 07:58:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,392,1534834800"; d="scan'208";a="82196113" Received: from shzintpr03.sh.intel.com (HELO [10.7.209.65]) ([10.239.4.100]) by orsmga008.jf.intel.com with ESMTP; 17 Oct 2018 07:58:41 -0700 To: Laszlo Ersek , Prasad Pandit Cc: Vincent Zimmer , edk2-devel@lists.01.org, Steve McIntyre <93sam@debian.org>, Peter Jones , Jiewen Yao , Michael Kinney , Gary Lin , Chao Zhang , star.zeng@intel.com References: <1539657661-57656-1-git-send-email-star.zeng@intel.com> <75a8ff0b-dac9-dbb4-a792-1085a0b73699@redhat.com> From: "Zeng, Star" Message-ID: <2d9e4a50-be84-e501-b4b6-651367769e91@intel.com> Date: Wed, 17 Oct 2018 22:58:10 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <75a8ff0b-dac9-dbb4-a792-1085a0b73699@redhat.com> Subject: Re: CVE-2018-3613 [was: MdeModulePkg Variable: Fix Timestamp zeroing issue on APPEND_WRITE] X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2018 14:58:44 -0000 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Hi Laszlo, On 2018/10/17 21:10, Laszlo Ersek wrote: > Hi Star, > > On 10/16/18 04:41, Star Zeng wrote: >> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=415 >> >> When SetVariable() to a time based auth variable with APPEND_WRITE >> attribute, and if the EFI_VARIABLE_AUTHENTICATION_2.TimeStamp in >> the input Data is earlier than current value, it will cause timestamp >> zeroing. >> >> This issue may bring time based auth variable downgrade problem. >> For example: >> A vendor released three certs at 2014, 2015, and 2016, and system >> integrated the 2016 cert. User can SetVariable() with 2015 cert and >> APPEND_WRITE attribute to cause timestamp zeroing first, then >> SetVariable() with 2014 cert to downgrade the cert. >> >> This patch fixes this issue. >> >> Cc: Jiewen Yao >> Cc: Chao Zhang >> Cc: Jian J Wang >> Contributed-under: TianoCore Contribution Agreement 1.1 >> Signed-off-by: Star Zeng >> --- >> MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c >> index a2d61c8cd618..8e8db71bd201 100644 >> --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c >> +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c >> @@ -2462,6 +2462,8 @@ UpdateVariable ( >> if (Variable->CurrPtr != NULL) { >> if (VariableCompareTimeStampInternal (&(((AUTHENTICATED_VARIABLE_HEADER *) CacheVariable->CurrPtr)->TimeStamp), TimeStamp)) { >> CopyMem (&AuthVariable->TimeStamp, TimeStamp, sizeof (EFI_TIME)); >> + } else { >> + CopyMem (&AuthVariable->TimeStamp, &(((AUTHENTICATED_VARIABLE_HEADER *) CacheVariable->CurrPtr)->TimeStamp), sizeof (EFI_TIME)); >> } >> } >> } >> > > thank you for the BZ reference in the commit message. > > The commit message is very good, and from it, I suspected this was a > security bug -- it makes "dbx" rollbacks possible, correct? --, and I > was wondering if it should have received a CVE. Yes, your are right. You have known there is a CVE for it. > > Indeed, checking the TianoCore BZ, I can see that this patch mitigates > CVE-2018-3613. > > I have requested earlier [1], and now I'm doing so again, that CVE fixes > please all mention the CVE number in the *subject line*. When people > look at the commit log, or even just patch traffic on this list, CVE > numbers should *jump* at them. Good request. How about we document it as requirement at somewhere (Contributions.txt?)? Then people can easily find the requirement and follow it. > > http://mid.mail-archive.com/e62f7104-e341-6c7f-1af5-2130f161f111@redhat.com Sorry, I could not access it. > > Because you pushed this patch in ~25 hours after posting it to the > public list, and because TianoCore BZ#415 used to be a security bug > (restricted from mirroring to the bugzilla list, and opened up likely > most recently only), I couldn't comment on the subject line (I was on > PTO yesterday), and now we have another patch in the git history that is > a CVE fix, but states that fact nowhere at all. I was unlucky and I am sad that I could not receive your feedback/comment before I pushed the patch. :( From TianoCore BZ#415, we can see the original embargoed data was "10/26/17". For some reason, it was extended to "July 10, 2018". I supposed some coordinator(s) should have coordinated with organizations for this CVE before its disclosure. I was just aware that Security Advisory including this CVE at https://edk2-docs.gitbooks.io/security-advisory/ was released at "Oct 12, 2018" and TianoCore BZ#415 link was just made public before I posted the patch. I thought I should make the patch into the code as quick as possible (after following the community code review process) after this CVE's disclosure. > > To be clear, my complaint is not that the patch was pushed too quickly > (one day should be fine for CVEs after coordinated disclosure); my point > is that the patch was pushed quickly *and* it never mentioned it was a > CVE fix (in the subject line specifically). Got it. I should have done like this if I was aware the request.:( > > In addition, while the bugzilla states: > >> The issue is there since the auth variable driver was created in >> SecurityPkg, and it is inherited to current variable driver in >> MdeModulePkg after the auth variable driver in SecurityPkg was merged >> to variable driver in MdeModulePkg. > > some specific commit references in the fix's commit message would have > helped, so that everyone could evaluate whether they were affected. We can see the attachment for reference in TianoCore BZ#415 link only updates the variable driver in MdeModulePkg and we just synced the patch to UDK2018/UDK2017/UDK2015 which all have SecurityPkg variable driver merged into MdeModulePkg variable driver. SecurityPkg variable driver is just present in very old UDK branches. And people is not hard to know the history of MdeModulePkg and SecurityPkg variable driver by GIT log. So I left the statement in TianoCore BZ#415 link. Yes, I admit it would be better also including some statement/reference in commit log. :) Really thanks very much for the comments. Star > > --*-- > > Process-wise, I'm sad that Red Hat -- and likely many other > organizations shipping edk2-based firmware -- have not been involved in > a coordinated disclosure around this issue. The timeline in > > https://bugzilla.tianocore.org/show_bug.cgi?id=415 > > suggests that there would have been a lot of time for this (and > apperently there was *intent* too). But here we are, caught with our > pants around our ankles. > > Prasad, to my understanding, you are Red Hat's representative on the > TianoCore Bugzilla security group. I've now searched the RH Bugzilla for > "CVE-2018-3613", and there are no hits. Can you please confirm whether > this BZ was made available to us (and we missed it, and/or failed to act > upon it otherwise)? > > Either way, please: > > - Create the appropriate tracker in the Red Hat Bugzilla. (The patch has > been picked to UDK as far back as UDK2015; we obviously need to fix > this yesterday.) > > - Forward the issue to , so that other > organizations that distribute OVMF learn of this. > > (I'm adding a few direct CC's now, but that list shouldn't be limited by > my imagination. I've briefly searched the oss-sec archive as well: also > no hits.) > > Thank you, > Laszlo >