From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#66390: `man' allows to inject arbitrary shell code Date: Sat, 07 Oct 2023 17:19:28 +0300 Message-ID: <83v8bizf9r.fsf@gnu.org> References: <83wmvyzir2.fsf@gnu.org> <585dcaf0-358e-4a9d-84d1-6fd9c2c8aec5@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21172"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 66390@debbugs.gnu.org To: Max Nikulin Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 07 16:20:07 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 1qp8A3-0005KR-33 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 07 Oct 2023 16:20:07 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qp89m-0000eN-KB; Sat, 07 Oct 2023 10:19:50 -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 1qp89f-0000dx-GX for bug-gnu-emacs@gnu.org; Sat, 07 Oct 2023 10:19:44 -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 1qp89e-0000Nl-TF for bug-gnu-emacs@gnu.org; Sat, 07 Oct 2023 10:19:43 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qp89y-0004kb-42 for bug-gnu-emacs@gnu.org; Sat, 07 Oct 2023 10:20:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 07 Oct 2023 14:20:02 +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.169668838318226 (code B ref 66390); Sat, 07 Oct 2023 14:20:02 +0000 Original-Received: (at 66390) by debbugs.gnu.org; 7 Oct 2023 14:19:43 +0000 Original-Received: from localhost ([127.0.0.1]:55586 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qp89e-0004ju-Qq for submit@debbugs.gnu.org; Sat, 07 Oct 2023 10:19:43 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46676) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qp89c-0004jg-LP for 66390@debbugs.gnu.org; Sat, 07 Oct 2023 10:19:41 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qp89D-0000Lh-Nd; Sat, 07 Oct 2023 10:19:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=9vydu0Kr3EhqU0vWxlgSXyAtUoFpRPe/nlfyZfqpAXQ=; b=Edvck+A+H655 w3GRTg4aA1GGiK9XLMQJVaRIq9KwiwlLVt7sAAD5p5ERJ9EldKzWa+WtmUky/QsGzlfhNGeFpK5SF Z9FWroK8a5zJfxYU7hm42rUb98tkbAW1L34pxJtY51ZBiqnDdLwkqWNUTelV66w3rpC32RHpavkfW LMGkrUzmiJjhLXGzMX5i4Qtt/SRR8SaH0kJXwb2lv3RM/183b7vCe035OYUeZV62xN/PYK1TpCSKI QtDldvs4PsbHlG30nQR/AW52IRG9gf7e7PflJ9YdTva+YqI2y49MooCgIhbA1pb4JKXWGqMl3OAI+ NTuqxMLbYx8WYOus81D26Q==; In-Reply-To: <585dcaf0-358e-4a9d-84d1-6fd9c2c8aec5@gmail.com> (message from Max Nikulin on Sat, 7 Oct 2023 21:12:54 +0700) 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:272004 Archived-At: > Date: Sat, 7 Oct 2023 21:12:54 +0700 > Cc: 66390@debbugs.gnu.org > From: Max Nikulin > > On 07/10/2023 20:04, Eli Zaretskii wrote: > >> From: Maxim Nikulin > >> Date: Sat, 7 Oct 2023 19:47:04 +0700 > > > >> man.el should prevent substitution of shell specials literally from > >> `man' arguments into shell commands. > > > > I think callers of 'man' should prevent that instead. > > If it is fixed in man.el then it is fixed for all callers. Otherwise > every caller must have notion of structure of references to man pages > instead of just treating them as opaque sequence of characters. Sorry, I disagree. 'man' is an interactive command, so it should not second-guess the user who invokes it. Commands that call 'man' non-interactively should make sure they call 'man' with a valid argument, especially when the argument comes from some file.