From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Francesco =?UTF-8?Q?Potort=C3=AC?= Newsgroups: gmane.emacs.bugs Subject: bug#47616: 27.1; hardening mail-envelope-from Date: Thu, 06 May 2021 14:16:29 +0200 Organization: The GNU project Message-ID: <87a6p8ukf6.fsf@tucano.isti.cnr.it> References: <87v98z60u4.fsf@tucano.isti.cnr.it> <87h7jgxite.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20239"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 47616@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu May 06 14:21:42 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1led0g-0005Bu-PM for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 06 May 2021 14:21:42 +0200 Original-Received: from localhost ([::1]:59366 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1led0f-0002Aw-Ql for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 06 May 2021 08:21:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33846) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lecwB-00071t-4a for bug-gnu-emacs@gnu.org; Thu, 06 May 2021 08:17:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54182) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lecwA-0000PS-8z for bug-gnu-emacs@gnu.org; Thu, 06 May 2021 08:17:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lecwA-0005hc-4t for bug-gnu-emacs@gnu.org; Thu, 06 May 2021 08:17:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Francesco =?UTF-8?Q?Potort=C3=AC?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 06 May 2021 12:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47616 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed Original-Received: via spool by 47616-submit@debbugs.gnu.org id=B47616.162030339520688 (code B ref 47616); Thu, 06 May 2021 12:17:02 +0000 Original-Received: (at 47616) by debbugs.gnu.org; 6 May 2021 12:16:35 +0000 Original-Received: from localhost ([127.0.0.1]:37494 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lecvj-0005NL-79 for submit@debbugs.gnu.org; Thu, 06 May 2021 08:16:35 -0400 Original-Received: from plesklin7.if2.ehiweb.it ([79.98.45.17]:60850 helo=plesklin7.if1.ehiweb.it) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lecvg-0005JS-1X for 47616@debbugs.gnu.org; Thu, 06 May 2021 08:16:33 -0400 Original-Received: from tucano.isti.cnr.it (tucano.isti.cnr.it [146.48.81.102]) by plesklin7.if1.ehiweb.it (Postfix) with ESMTPSA id C36001004E7; Thu, 6 May 2021 14:16:29 +0200 (CEST) In-Reply-To: <87h7jgxite.fsf@gnus.org> (larsi@gnus.org) X-fingerprint: 4B02 6187 5C03 D6B1 2E31 7666 09DF 2DC9 BE21 6115 X-PPP-Message-ID: <20210506121629.29219.85691@plesklin7.if1.ehiweb.it> X-PPP-Vhost: potorti.it X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:205826 Archived-At: >Francesco Potortì writes: >> Hardening mail-envelope-from from sendmail.el by narrowing to the >> headers, as the doc says, corrects the problem that I observed. > >Thanks -- I don't think we should change mail-envelope-from itself here, >because it may conceivably be called from other contexts. Instead the >callers in sendmail/smtpmail should be altered to narrow to the headers >before calling it, and I've now done this in Emacs 28. (This uncovered >a similar bug in smtpmail.el, too.) That makes sense, in principle. I would argue for adding a comment to mail-envelope-from stating that since it calls mail-fetch-field it should be called only after narrowing to the headers. Or maybe even adding a note in the doc string, as done in mail-fetch-field.