From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#66390: `man' allows to inject arbitrary shell code Date: Sat, 07 Oct 2023 18:55:01 +0200 Message-ID: <87mswugyoq.fsf@gmx.de> References: <83wmvyzir2.fsf@gnu.org> <585dcaf0-358e-4a9d-84d1-6fd9c2c8aec5@gmail.com> <83v8bizf9r.fsf@gnu.org> <1865abb8-16cd-4570-9a8a-87cf9430583d@gmail.com> <875y3iigua.fsf@gmx.de> <83o7hazap7.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18435"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: manikulin@gmail.com, 66390@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 07 18:55:51 2023 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 1qpAak-0004bW-BV for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 07 Oct 2023 18:55:50 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qpAae-0003ut-UE; Sat, 07 Oct 2023 12:55:44 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qpAac-0003th-KQ for bug-gnu-emacs@gnu.org; Sat, 07 Oct 2023 12:55:42 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qpAac-0002sp-CK for bug-gnu-emacs@gnu.org; Sat, 07 Oct 2023 12:55:42 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qpAav-0006se-Rm for bug-gnu-emacs@gnu.org; Sat, 07 Oct 2023 12:56:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 07 Oct 2023 16:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66390 X-GNU-PR-Package: emacs Original-Received: via spool by 66390-submit@debbugs.gnu.org id=B66390.169669773026393 (code B ref 66390); Sat, 07 Oct 2023 16:56:01 +0000 Original-Received: (at 66390) by debbugs.gnu.org; 7 Oct 2023 16:55:30 +0000 Original-Received: from localhost ([127.0.0.1]:55825 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpAaQ-0006rd-81 for submit@debbugs.gnu.org; Sat, 07 Oct 2023 12:55:30 -0400 Original-Received: from mout.gmx.net ([212.227.17.22]:41733) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpAaO-0006rM-Ce for 66390@debbugs.gnu.org; Sat, 07 Oct 2023 12:55:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1696697702; x=1697302502; i=michael.albinus@gmx.de; bh=z/CkIqllwI8AHKTEnwJsgXAn98JCF9Eom5d55E63it4=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=PNngtl/vv3Fdiwx+nUMGvIbVnt1uzvV4aw6edPxxWEpDrf0Phq3GGj6Xs70+nwMvuVBuQReTLhX n5oQXImQLgE4e7ZugOA5wDtfGwdZNPyI8DaFE5OGCrDwuCRxfE7HEt6esjUOUR+4cghMo4J8/8BT0 gCVAVD2NC9gSm1iTaEzSHs5Jq5eGtCnKDcgoMjgeRokfewNeeL16eYF/UMz1SsJXfVYSwDVvJ1ByV FxXDcq581J7Mr837gQ3HN83z3L6NgPHclds+TLHbnjc3lf7M229cXpEb+dWBzdla3F+k6+kGcC8uc iHVwuPF/fN1LRe8ZodlB4Q1LJ+zbg84dMKew== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from gandalf.gmx.de ([185.89.39.30]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MOREc-1rF5pI1uZC-00PusO; Sat, 07 Oct 2023 18:55:02 +0200 In-Reply-To: <83o7hazap7.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 07 Oct 2023 18:58:12 +0300") X-Provags-ID: V03:K1:+fjlMYo2TLT4zWuBnSPg8eEJt9ctdIHRx2URoWxZcaelwYEl0Td p4gBKgqvF3v7sPjEnVa1yU2CFrpW3bC9kWt6pVaSN3lC486rdrzSbkinxW0juzil1krR2Vr 7KtUvmMh6HjTDHkZpnCTytqj2c6AUC5ZURhSIuRG19l0XWynVTKtm1WcoV7jByiCagfWN4R Pd7AdthyROjb01KUx0I+A== UI-OutboundReport: notjunk:1;M01:P0:bgkuVHH4sis=;sWgg8QeNk2KRExQLbNG2a+fwVrI LfckgBXOibMOxuckdbFudh72waSDgIR7V8NRu4yoDy/ho6kisq7Si9GKUUeDzLnUigRYwBcvO uVh96nG4nMu9w6uGAafVbMVHo7AdO1I+IGYkgheQYZFpGTqzC1hXmc65pqCow2psLS9w2iR1p NBadStzqEdjuAB+eLp734zpio/Hv/uNF9LhmBAOHGz8i5wlWka2IyKuWhOYE2PxwtMVwvAKma +iyU9E//zHmk0sU4TLHj8poD2CSn3UYgPZqXRrgjF9otiPWuvVRhd8Yo23tD6usy4IizDpSjJ ec6u4hjWfd8Q/9OIRh0x5X998qwdibGJHCQFeoSxjjYwuzFUJw6GiHPWxgNoJ7emfoP/m36wA rVmqv9Gi5qtfKuiU+lw3OjWbtGcKLrSuMvC3HMv3+aZvAghdXefruecHB33SI4Dz7Z1cobCwR Qhu7v/vFuE6YGzkUWrnFW1Bfa7SwZ6HLuQ1CyNgn863RgHbsben9WVXntH09Ddgy6fouf0Em9 bswGX+wv9mPB2IMOK43AkZRWC923cPtme7whqK5zOlVa4ZUT7gucqQpQUEGW6CK0eDjFxKwEA rIHQzoYL5zZBIzmoFZ/B6/sn5M/bRfqJoJ1pRK2n3PZsTC9DIhPCLchA7DLlSP0rAJQlVa/u4 mg1jmmv5AwPaGpBwvpebvWjIptY4iSqP0KgWAw6ZEHLkJVK9CYBQ0y26S3wBB4QUmk8r31+bP 8fkl0HbVN7j/m9Z6m9PtpPGUAg5VQ/kRiFwxWZm2dbNR0QL8gMT7HUjehwCOblv5fWcxtkxn 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:272026 Archived-At: Eli Zaretskii writes: Hi Eli, >> The function `Man-translate-references' tries to do it. For example, it >> translates the argument "cat(1)" into "1 cat", which doesn't pose a >> problem. The function should check stronger, and it should reject >> arguments like "File:\\:UserDirs(3pm)". > > Based on what would we reject such arguments? On argument syntax for man. It is documented. > And what kind of shell would we assume when rejecting that? It isn't a problem of the shell. Man-translate-references manipulates the arguments such a way that no shell quoting is neded. > Once again, interactive invocations should let the user type whatever > she wants, and if that fails in strange ways, it's on the user, not on > us. Yes, if the user types nonsense it shall fail. The point is where to fail. I believe it shall fail already in Man-translate-references, and not from the man invocation with a shell. The docstring of man explains already, which kind of arguments are expected. Whe should simply follow with the implementation. "File:\\:UserDirs(3pm)" is not a valid argument, and shall be rejected on Lisp level. Best regards, Michael.