emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: emacs-29 3c1693d08b0: Fix Elisp code injection vulnerability in emac


From: Robert Pluim
Subject: Re: emacs-29 3c1693d08b0: Fix Elisp code injection vulnerability in emacsclient-mail.desktop
Date: Wed, 08 Mar 2023 12:47:19 +0100

>>>>> On Wed, 08 Mar 2023 12:29:13 +0100, Ulrich Mueller <ulm@gentoo.org> said:

>>>>> On Wed, 08 Mar 2023, Ulrich Mueller wrote:
    >> Sure, something like this (not yet tested):

    >> -Exec=bash -c "u=\\${1//\\\\\\\\/\\\\\\\\\\\\\\\\}; 
u=\\${u//\\\\\\"/\\\\\\\\\\\\\\"}; exec emacsclient --alternate-editor= 
--display=\\"\\$DISPLAY\\" --eval \\"(message-mailto \\\\\\"\\$u\\\\\\")\\"" 
bash %u
    >> +Exec=sh -c "u=\\$\\(echo \\"\\$1\\" | sed 
\\'s/[\\\\\\"]/\\\\\\\\\\&/g\\'\\); exec emacsclient --alternate-editor= 
--display=\\"\\$DISPLAY\\" --eval \\"(message-mailto \\\\\\"\\$u\\\\\\")\\"" sh 
%u

    >> Sorry, but it doesn't get less ugly. :) Also, it will now call _two_
    >> external programs. Is this acceptable, and is it guaranteed that sed
    >> will be available on users' systems?

`sed' is POSIX mandatory, and `bash' is not. And `echo' is mandatory
as well, since youʼre also using that :-)

    Ulrich> In fact, only '"', '$', and '\' need to be backslash-escaped.
    Ulrich> Patch included below, works fine here.

That looks better. We can then add `--funcall' to emacs-30, and revisit
this there.

Thanks

Robert
-- 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]