From: Max Nikulin <manikulin@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>, lux <lx@shellcodes.org>
Cc: 66390@debbugs.gnu.org, michael.albinus@gmx.de
Subject: bug#66390: `man' allows to inject arbitrary shell code
Date: Tue, 10 Oct 2023 18:09:43 +0700 [thread overview]
Message-ID: <76847bef-83a5-4bbe-8641-9dd82cf377a2@gmail.com> (raw)
In-Reply-To: <834jizwxm2.fsf@gnu.org>
On 09/10/2023 23:48, Eli Zaretskii wrote:
> And I ask again: what happens with command (man "[") in this case?
"sh" "-c" "man [ 2>/dev/null | sed -e '/^[\1-\32][\1-\32]*$/d' #...
so the code in man.el relies on "[" not interpreted as a special
character when it is alone. It is not escaped!
Perhaps you are confused by the following commit
4ef9cc5a5de 2023-07-26 17:30:21 +0300 Eli Zaretskii: Fix "M-x man RET [ RET"
It affects completion, but not M-x man RET [ RET. (And I am surprised
that "@" is treated specially for some reason.)
> Please believe me: this is not simple. There's more here than meets
> the eye. In addition to all kinds of weird characters in man-page
> names, you also need to consider SEE ALSO links from one man page to
> another, which can cross lines and include dashes and whitespace.
> Etc. etc... I had my share of messing with this code, and one thing I
> know is that nothing is ever as simple as quoting here.
References split across lines should be handled by the code that
creates/opens references, not by `man'. `man' should receive cleaned up
references. (Cross-references is a case when properly implemented roff
parser has advantages over dealing with text formatted for tty.)
If you believe that other packages must not call `man' then this
function should not have an argument since it is a part of public interface.
next prev parent reply other threads:[~2023-10-10 11:09 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-07 12:47 bug#66390: `man' allows to inject arbitrary shell code Maxim Nikulin
2023-10-07 13:04 ` Eli Zaretskii
2023-10-07 14:12 ` Max Nikulin
2023-10-07 14:19 ` Eli Zaretskii
2023-10-07 14:29 ` Max Nikulin
2023-10-07 15:10 ` Eli Zaretskii
2023-10-07 15:37 ` Michael Albinus
2023-10-07 15:58 ` Eli Zaretskii
2023-10-07 16:55 ` Michael Albinus
2023-10-07 17:24 ` Eli Zaretskii
2023-10-07 17:45 ` Michael Albinus
2023-10-07 18:26 ` Eli Zaretskii
2023-10-08 3:37 ` Max Nikulin
2023-10-08 5:28 ` Eli Zaretskii
2023-10-09 15:12 ` Max Nikulin
2023-10-09 15:52 ` Eli Zaretskii
2023-10-09 16:30 ` lux
2023-10-09 16:48 ` Eli Zaretskii
2023-10-09 17:07 ` Ihor Radchenko
2023-10-09 17:20 ` Andreas Schwab
2023-10-10 2:47 ` lux
2023-10-10 7:43 ` Stefan Kangas
2023-10-10 12:11 ` Eli Zaretskii
2023-10-10 12:25 ` Stefan Kangas
2023-10-10 11:09 ` Max Nikulin [this message]
2023-10-10 10:54 ` Max Nikulin
2023-10-10 14:30 ` lux
2023-10-10 16:21 ` Andreas Schwab
2023-10-11 3:08 ` lux
2023-10-11 10:46 ` Max Nikulin
2023-10-20 21:00 ` Stefan Kangas
2023-10-21 7:19 ` Eli Zaretskii
2023-10-21 7:35 ` Andreas Schwab
2023-10-21 7:45 ` Eli Zaretskii
2023-10-21 9:19 ` Stefan Kangas
2024-01-10 21:21 ` Stefan Kangas
2024-01-11 12:07 ` Ihor Radchenko
2024-01-11 14:34 ` Max Nikulin
2024-01-11 15:07 ` Ihor Radchenko
2024-01-11 15:28 ` Eli Zaretskii
2024-01-11 15:37 ` Ihor Radchenko
2023-10-09 2:36 ` Richard Stallman
2023-10-09 11:04 ` Eli Zaretskii
2023-10-10 11:56 ` Richard Stallman
2023-10-11 10:56 ` Max Nikulin
2023-10-08 3:42 ` Maxim Nikulin
2023-10-08 5:20 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=76847bef-83a5-4bbe-8641-9dd82cf377a2@gmail.com \
--to=manikulin@gmail.com \
--cc=66390@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=lx@shellcodes.org \
--cc=michael.albinus@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.