From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#19565: Emacs vulnerable to endless-data attack (minor) Date: Mon, 7 Oct 2019 14:50:41 +0200 Message-ID: References: <83a7ad3hlf.fsf@gnu.org> <874l0le314.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="101120"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 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 14:52:15 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 1iHSUl-000Q6t-Ll for geb-bug-gnu-emacs@m.gmane.org; Mon, 07 Oct 2019 14:52:11 +0200 Original-Received: from localhost ([::1]:44292 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iHSUk-0007PU-EN for geb-bug-gnu-emacs@m.gmane.org; Mon, 07 Oct 2019 08:52:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53233) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iHSUd-0007P9-37 for bug-gnu-emacs@gnu.org; Mon, 07 Oct 2019 08:52:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iHSUb-0002FI-S7 for bug-gnu-emacs@gnu.org; Mon, 07 Oct 2019 08:52:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38634) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iHSUb-0002FC-P4 for bug-gnu-emacs@gnu.org; Mon, 07 Oct 2019 08:52:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iHSUb-0007zw-LR for bug-gnu-emacs@gnu.org; Mon, 07 Oct 2019 08:52:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 07 Oct 2019 12:52: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.157045266130678 (code B ref 19565); Mon, 07 Oct 2019 12:52:01 +0000 Original-Received: (at 19565) by debbugs.gnu.org; 7 Oct 2019 12:51:01 +0000 Original-Received: from localhost ([127.0.0.1]:47455 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iHSTd-0007yY-Du for submit@debbugs.gnu.org; Mon, 07 Oct 2019 08:51:01 -0400 Original-Received: from mail-pl1-f172.google.com ([209.85.214.172]:44944) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iHSTa-0007yF-QN for 19565@debbugs.gnu.org; Mon, 07 Oct 2019 08:50:59 -0400 Original-Received: by mail-pl1-f172.google.com with SMTP id q15so6807443pll.11 for <19565@debbugs.gnu.org>; Mon, 07 Oct 2019 05:50:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=B/99XR5MTyBZGSZPFZ2DXiEoRXS2qCqMMGm/XtgyHFQ=; b=IxDjsyGoUz+JKfphVpooZ0tmLPd4Wfg2VW4BPhHmFPDvDG7azq5WyGZ4yHAN0ySeaL W8qSbfEj5HULS0ZSMs4rrKtD5/dCP7DK4XrZjfuGipcYRIRRHATh6PMTGny1W67JgFOn Q1yK3EuaBuxgGbk8+eQYcQa0Xu2qlKGTxjGLEmINAvsy2PPSWof6ZD81o9JHmbW3+cOF 0/LdtKegyH6ikggCXa4KnNZRjMVazTefun6uJlB9v9rMpNVCS081R/+jnhxv6wSOYLp3 T7n1y6OO6kJzRCuHI3jimH+eoY0Xc5OBINgpOsFj9ZS8UiZuNpXVC+RMB30t9YubZB21 ZtOg== X-Gm-Message-State: APjAAAUVjIYHyXwqeuczHDPh6nUZNQRJShUr6z2ift8VmrZSFOu+gCNx GC1jH6Epzv+9d3KpOaHsYtx+ivbJBm/do8yBJs8= X-Google-Smtp-Source: APXvYqz7ZDi+h8MjZNW1387veNdrhwA1LjENbGkM7O8jrwCMxX58UGk+72Tlv23+LmjCfbBecOI40MpXLh+h4WjCqTM= X-Received: by 2002:a17:902:326:: with SMTP id 35mr30189600pld.128.1570452652980; Mon, 07 Oct 2019 05:50:52 -0700 (PDT) In-Reply-To: <874l0le314.fsf@gnus.org> 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:168532 Archived-At: Lars Ingebrigtsen writes: > It's not something we have to do, but it would be nice to have some > protection against this. This is my view, too. And don't we usually treat a potential crash as a bug to be fixed? > 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? Not sure if it's practical, but perhaps we could initialize the threshold depending on the available memory. > 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'. > > That way Emacs wouldn't be open to flooding from, say, rogue SMTP > servers, either. If we can have a more general protection, that would be even better, in my view. Are there any drawbacks to such a solution? Best regards, Stefan Kangas