From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:203:b4db::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id kFHjNcNoyGF3oQAAgWs5BA (envelope-from ) for ; Sun, 26 Dec 2021 14:06:11 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id kDVNM8NoyGHzsQAA9RJhRA (envelope-from ) for ; Sun, 26 Dec 2021 14:06:11 +0100 Received: from mail.notmuchmail.org (yantan.tethera.net [IPv6:2a01:4f9:c011:7a79::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id B61A41D621 for ; Sun, 26 Dec 2021 14:06:08 +0100 (CET) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id E57915F726; Sun, 26 Dec 2021 13:06:04 +0000 (UTC) Received: from fethera.tethera.net (fethera.tethera.net [IPv6:2607:5300:60:c5::1]) by mail.notmuchmail.org (Postfix) with ESMTP id AD8475F71B for ; Sun, 26 Dec 2021 13:06:01 +0000 (UTC) Received: by fethera.tethera.net (Postfix, from userid 1001) id 8E66F5FC42; Sun, 26 Dec 2021 08:06:00 -0500 (EST) Received: (nullmailer pid 2026512 invoked by uid 1000); Sun, 26 Dec 2021 13:05:59 -0000 From: David Bremner To: Daniel Kahn Gillmor , notmuch mailing list Subject: Re: possible infinite recursion in notmuch-cli In-Reply-To: <874n8ospsy.fsf@alice.fifthhorseman.net> References: <874n8ospsy.fsf@alice.fifthhorseman.net> Date: Sun, 26 Dec 2021 09:05:59 -0400 Message-ID: <87fsqfms7c.fsf@tethera.net> MIME-Version: 1.0 Message-ID-Hash: FPTENNMK5WII336PLXTQNNZG5YOTCSQ7 X-Message-ID-Hash: FPTENNMK5WII336PLXTQNNZG5YOTCSQ7 X-MailFrom: david@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-Country: DE ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1640523968; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post; bh=vOR7jrPaQiB9srhrGe7TCnTjzgqEejc269G0WPLKDVs=; b=ROPK5qmCXf4Ty0vI38AzDvmQQltwy+k9/DaV1R4XTA9xg0F5S0HI+RNXkHiihPGPeWo1CN kQLQEkKdr2dnqn9fVAuGmDr3b133cZs8G/0z9XFb/Oc2n5/EOKr66BIz0OpZxOdU7os3su 56vj3EMGYm+Z9CBLdU/aOQAfUVxoR2QvDzq8gCtheVV1+HrFnOJ3k/Qx1znqodrm90k8SM ROTjKzgtGv2r4iyBJUvzK7aj+0DpFuicbgq92UU3qOd9hQIOGrMjK+ESpNMXS/GjzWVnl6 4W80ikKoZUKbaSGU5mf2EngdI4FwqQer7O2VU960HA/tAGvlksyZk1jYpn6vcQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1640523968; a=rsa-sha256; cv=none; b=KpNv2Op6P1NDSy5v4Kt0evR5Eo3cs+2bhFXyjyqioezR5Dta8RS1NiY/RAg137dMBGkECb zcs5qdGGzWueX03lG3lhhW0At7gaf8MAe2CwUYFm8EARelVyx8H8RKUDRMrWXV5/Yf929G 06I4z6kH7vJA5K8lOEudPktAlvihNt3JQ8nQN2oD8jyHyy+BPkXi64pAWA3FzMTK+bIQDs Idsuu1i3u8csvC34euYsLm9WT4gO8CfC5WHedARV2vwlaaC7rrmNP7vi9L3tytp2/776fN vMHctvPwqjJtK9AVcddLWjZ6Mmdcv7rVOL/MVmHqT6Uase+Ypdoyu6jiZznH+w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -2.18 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: B61A41D621 X-Spam-Score: -2.18 X-Migadu-Scanner: scn1.migadu.com X-TUID: tq4SiiTcWG0F Daniel Kahn Gillmor writes: > After some discussion with amdragon on IRC, i believe that this is only > relevant to notmuch when actively decrypting a message -- OpenPGP's > ability to embed compression makes it possible to write a PGP/MIME > message that is a quine: that is, when decompressed, it would expand to > itself, which would send our parser into an infinite loop. > > Since we're not decrypting during indexing, only notmuch-show and > notmuch-reply are probably affected by this problem. (but if someone > implements indexing of encrypted messages, then we'd have to worry about > this in the indexer as well) This is indeed our current situation. > The simple and generalized solution would be to limit the recursive > depth of our walk of the MIME tree; probably a large limit of something > like 30 or 50 would not trigger any real-world problems, and would halt > a runaway recursion well before most modern machines ran out of > resources. So do I understand correctly that to test this proposed fix, we would not need to generate a MIME-quine (which sounds challenging) but just a very deep MIME tree?