Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sun, 23 Jun 2024 12:42:36 -0700
From: Russ Allbery <>
To: Ihor Radchenko <>
Subject: Re: Arbitrary shell command evaluation in Org mode
 (GNU Emacs)

Ihor Radchenko <> writes:

> Here is a vulnerability in Emacs Org mode.

> Reproducer is the following .org file:

> #+LINK: shell %(shell-command-to-string)
> [[shell:touch ~/hacked.txt]]

> When sent by email and previewed in Emacs or when opened in Emacs as a
> file, the above Org file will evaluate "touch ~/hacked.txt" without any
> prompts.

> The fix is attached. It is against Org mode git repository.
> The fix can be applied to older versions of Org mode/Emacs if deemed
> necessary.

For those who want to disable automatic parsing of Org files in incoming
email messages with Emacs-based mail readers that use emacs-mime, I
believe this needs to be done with two bits of configuration.

The following (or the equivalent via customize) will disable autodetection
of Org files inline in text/plain parts, such as in the message that I'm
responding to:

   '((org-src-code-block . disabled)
     (org-meta-line . disabled))))

In order to disable automatic previewing of org-mode attachments, you need
to customize mm-automatic-display to remove text/x-org from the list of
MIME types that are automatically previewed.  (This part I have not

There are probably other ways to do this; those are just the ones that I

Russ Allbery (             <>

Powered by blists - more mailing lists

Please check out the Open Source Software Security Wiki, which is counterpart to this mailing list.

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.