From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id gAXEFc1R8GXhqgAAqHPOHw:P1 (envelope-from ) for ; Tue, 12 Mar 2024 13:59:57 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id gAXEFc1R8GXhqgAAqHPOHw (envelope-from ) for ; Tue, 12 Mar 2024 13:59:57 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="COOYaF2/"; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1710248397; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=4Rb8TOGOCcvwyXnWHuwzbCL1Vs9Wlk1I4jcb5mKOoXY=; b=epAXEWpGXFmRtFlruvu/xwXHSjuJlpxHm0j6fpFCLGl1GtljVHhQnNMYzoB3mJwe5Ok5B8 9qGHMMirtxenlCe7uycJ8h3dGHQpK8ztnqdikadZBMGDHkcKJR14ja2rvKYm35nmnHoOvN iS58HE1YaA5gIg+vYYwEdoAhTsozvmqpq7bP1QhF4D99jWEGED1FJkb7mXBYtiyUYIQTFK P2gD0Mc6C8aiu5LDXS7FbD2wOTm5/uwXS9oETJezOL8AwKApjdT1vHSfpwB0euyPqsbNC8 WvZkfNJqc3cRGV4EmRTqL4x4SVExzuf9JIv34Ejh0drto/2MYBV9Pa2bAs90CQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="COOYaF2/"; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1710248397; a=rsa-sha256; cv=none; b=WeBi/gTcJlBNr3pmy1XSuIS3BNREKJVvLSQbZ/X8E9MUofiyIyju33xAnsy/EMn4iUbQAf 90y5P8GEjrffEVkyTRDNkxQzo4Es426HNKUYSYaOK9cMnjpm7jhlA9dlPeefvtaeMNQHZ7 xZhiHKnZws6MUA1VeMm5kxjxbWvwYZawNBlTI/BBd3kvnnhWLnKBvm8vx88INeW/48NYRa hXqMqda+UcM4A1ZgIqsax4FvLb7iLAgEk7GxFArOYNcOm/e5TQSusWPDZReItzBMUQe6e8 HmNnWZDiVMv70r6pskYmxoR2P3y8KQnBpk+4dHjfuwhAuOIIOGI5PAaXzXvQjQ== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 06ECB610D4 for ; Tue, 12 Mar 2024 13:59:57 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rk1ic-0003EL-4D; Tue, 12 Mar 2024 08:58:58 -0400 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 1rk1iX-0002rO-5I for emacs-orgmode@gnu.org; Tue, 12 Mar 2024 08:58:53 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rk1iU-0002uP-T8 for emacs-orgmode@gnu.org; Tue, 12 Mar 2024 08:58:52 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id DF8C3240028 for ; Tue, 12 Mar 2024 13:58:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1710248328; bh=qfE0XKn++CWrNO3MYe5c/o+t5oHzW5/1rtTA1PbdBhk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=COOYaF2/990EWzIVXO/LuURthlxDYhzbqxK2By1UjJM6qKQBRafljiFaHARC0yTNB ShYstUtLpNY5ANuMXC9FNpeQjG2Ou4UgjXRI5pWDcq9bd6YZoeaopwHRx3sT9woYPj aF0pxI5qTofyjvOzvo1FqGlK4+CS+fVB2iYTttxFb6WZCMRiCi8hIhMVJlRC4hWnBT bzNCZ2miQTOqfPmhTaSMzxlkis/5h2917P7iCd+/3Ci0gjoDFfjtwGzodbQG+yFaX5 VF6Yrn7n3tMEWz3TyZHL+88ZHDYiOccrALXMSZ/SH/WEHnmMtzev4umA63x9Bx1D1Q 893anJR9fOq0Q== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4TvDGw1y6pz6tvd; Tue, 12 Mar 2024 13:58:48 +0100 (CET) From: Ihor Radchenko To: Max Nikulin Cc: emacs-orgmode@gnu.org Subject: Re: Warn about shell-expansion in the docstring of org-latex-to-html-convert-command In-Reply-To: References: <87wmr1rc2w.fsf@localhost> <874jdzjqkk.fsf@localhost> <6e49c590-ad27-4fb0-b1f2-6a89c60a0b58@gmail.com> <87msrncxhq.fsf@localhost> <735645dd-1ddf-4579-a6dd-2700f3e83c94@gmail.com> <87jzmdht2w.fsf@localhost> Date: Tue, 12 Mar 2024 13:03:01 +0000 Message-ID: <87v85rd2m2.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -9.11 X-Spam-Score: -9.11 X-Migadu-Queue-Id: 06ECB610D4 X-Migadu-Scanner: mx13.migadu.com X-TUID: FidadjggovGd Max Nikulin writes: >> Even stripping quotes is unreliable when we use the example from >> docstring: 'literal:%i'. > > My idea is to recognize this case. If stripping is not performed then it > is necessary to detect if user command is safe. Otherwise apostrophe in > a formula (even after escaping) may cause leaking math to shell. I have > not figured out if it is possible to bypass double quotes, but extra > slashes may distort math expression. > > It is trivial to cause shell failure when single quotes are used around > %i. I am in doubts concerning double quotes. Perhaps stripping them is > more reliable. May you list the cases to you propose to recognize? >> Attaching tentative patch that fixes the problem. > > I think it is in the right direction. > - Manual needs update as well. Yes, #+begin_src emacs-lisp (setq org-latex-to-mathml-convert-command "latexmlmath \"%i\" --presentationmathml=%o") #+end_src example in "LaTeX math snippets" section should be updated. (note to self) > - I would explicitly stress that quotes causes undefined or even > dangerous behavior. See e.g. the last paragraph > https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s07.html In ORG-NEWS? > - I expected it as bugfix. It is a breaking change. Also, only users who customized the variable may be prone to unexpected shell expansion. So, I do not see it as a critical bug. Hence, not for bugfix. > I have tried to add some unit tests, but I faced an issue with > `org-create-math-formula'. It creates temporary files in > `default-directory' and does not remove them on failure. Moreover, it > does not work in a container where git is not installed: > ... > Debugger entered--Lisp error: (file-missing "Searching for program" "No > such file or directory" "git") > > that is called from `find-file-hook'. with emacs -Q? -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at