From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#19565: Emacs vulnerable to endless-data attack (minor) Date: Mon, 07 Oct 2019 19:13:11 +0300 Message-ID: <831rvo1qlk.fsf@gnu.org> References: <83a7ad3hlf.fsf@gnu.org> <874l0le314.fsf@gnus.org> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="250710"; mail-complaints-to="usenet@blaine.gmane.org" Cc: stefan@marxist.se, 19565@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Oct 07 18:23:05 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iHVmn-0012zw-Tl for geb-bug-gnu-emacs@m.gmane.org; Mon, 07 Oct 2019 18:23:02 +0200 Original-Received: from localhost ([::1]:47350 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iHVmm-0003gm-30 for geb-bug-gnu-emacs@m.gmane.org; Mon, 07 Oct 2019 12:23:00 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56757) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iHVe7-0003Xe-Ek for bug-gnu-emacs@gnu.org; Mon, 07 Oct 2019 12:14:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iHVe6-0002Kt-8V for bug-gnu-emacs@gnu.org; Mon, 07 Oct 2019 12:14:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40144) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iHVe6-0002Kn-5T for bug-gnu-emacs@gnu.org; Mon, 07 Oct 2019 12:14:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iHVe5-0004fQ-M2 for bug-gnu-emacs@gnu.org; Mon, 07 Oct 2019 12:14:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 07 Oct 2019 16:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19565 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: security Original-Received: via spool by 19565-submit@debbugs.gnu.org id=B19565.157046481117898 (code B ref 19565); Mon, 07 Oct 2019 16:14:01 +0000 Original-Received: (at 19565) by debbugs.gnu.org; 7 Oct 2019 16:13:31 +0000 Original-Received: from localhost ([127.0.0.1]:48965 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iHVdb-0004ea-7o for submit@debbugs.gnu.org; Mon, 07 Oct 2019 12:13:31 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:47569) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iHVdY-0004eM-JX for 19565@debbugs.gnu.org; Mon, 07 Oct 2019 12:13:29 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:53100) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iHVdT-0001q4-4x; Mon, 07 Oct 2019 12:13:23 -0400 Original-Received: from [176.228.60.248] (port=4915 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iHVdO-0008M7-6u; Mon, 07 Oct 2019 12:13:20 -0400 In-reply-to: <874l0le314.fsf@gnus.org> (message from Lars Ingebrigtsen on Mon, 07 Oct 2019 03:51:35 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:168549 Archived-At: > From: Lars Ingebrigtsen > Cc: Stefan Kangas , 19565@debbugs.gnu.org > Date: Mon, 07 Oct 2019 03:51:35 +0200 > > I think it would perhaps make some sense to warn (or query) the user if > you get more data than `large-file-warning-threshold'. I think it would > be pretty trivial to implement -- at least in the new with-fetched-url > interface, which I think is where this pretty theoretical problem is > least theoretical, perhaps? > > On the other hand, I could see that in some ways it would be easier to > implement in wait_reading_process_output: We could just maintain a byte > counter in the process objects (if we don't do that already) and have a > callback we call if that counter grows larger than > `large-file-warning-threshold'. I think this must be in terms of bytes/sec, not just bytes. E.g., I have a spell-checker active during my entire Emacs session (which could go on for weeks and months on end), and I don't want to get a prompt just because the number of bytes that went in that pipe becomes above the threshold. We may also need to measure the growth of the Emacs memory footprint during that time, because if Emacs reads bytes and discards them, it isn't going to be a problem, right?