From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Greg Minshall Newsgroups: gmane.emacs.bugs Subject: bug#48676: Arbitrary code execution in Org export macros Date: Thu, 27 May 2021 05:54:04 +0300 Message-ID: <4005254.1622084044@apollo2.minshall.org> References: <2nk0nl7asb.fsf@fencepost.gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6165"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 48676@debbugs.gnu.org To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu May 27 04:55:12 2021 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 1lm6Ax-0001Q8-LC for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 27 May 2021 04:55:11 +0200 Original-Received: from localhost ([::1]:52848 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lm6Aw-0006Oz-MJ for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 26 May 2021 22:55:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33172) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lm6Ao-0006Oc-Vn; Wed, 26 May 2021 22:55:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38834) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lm6Ao-0004Jd-JH; Wed, 26 May 2021 22:55:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lm6Ao-00021j-GJ; Wed, 26 May 2021 22:55:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Greg Minshall Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, emacs-orgmode@gnu.org Resent-Date: Thu, 27 May 2021 02:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48676 X-GNU-PR-Package: emacs,org-mode X-GNU-PR-Keywords: security Original-Received: via spool by 48676-submit@debbugs.gnu.org id=B48676.16220840597723 (code B ref 48676); Thu, 27 May 2021 02:55:02 +0000 Original-Received: (at 48676) by debbugs.gnu.org; 27 May 2021 02:54:19 +0000 Original-Received: from localhost ([127.0.0.1]:50376 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lm6A6-00020V-SP for submit@debbugs.gnu.org; Wed, 26 May 2021 22:54:19 -0400 Original-Received: from relay-egress-host.us-east-2.a.mail.umich.edu ([18.219.209.13]:48318 helo=joyful-pryderi.relay-egress.a.mail.umich.edu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lm6A4-00020I-Fs for 48676@debbugs.gnu.org; Wed, 26 May 2021 22:54:16 -0400 Original-Received: from shaggy-alux.authn-relay.a.mail.umich.edu (ip-10-0-74-243.us-east-2.compute.internal [10.0.74.243]) by joyful-pryderi.relay-egress.a.mail.umich.edu with ESMTPS id 60AF09D2.B252B.7065D8E5.1224308; Wed, 26 May 2021 22:54:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=umich.edu; s=relay-2018-08-29; t=1622084050; bh=jeJ3Nq/QViL185aDFTFzng7gdFvbeZlA4oMvc2Z0hf0=; h=From:To:cc:Subject:In-reply-to:Date; b=Cf1/YxGU/rDGwNOwfd0GMptAJllg+JJkwhy0+pt5Ryios+hDaV1MefAE98BbMHKnq YCbD9DIVV8KTOfJNDNFH77QoqAyeK4zPCGaFc2hbUHpihLhwNs2qpBFKksGJgi/obe A9Iei4M7VwEIDZAq7calka5EM8ZKYuYroQpizbofeihG9/+CSBby5YRkVUpknfcGg7 O/7SfZqJ0Fz4XsdWytvae+2eJpyMfvP9S2fxFs951zroevee6MBPBbwq55qf9WTACg AZRBxEx3zeEBijmooNA5YWv8p9DdOixgTtcLzfPnyhhp8qPP+LB92cMl2dENnlFHGX yBnzwvOuGweGA== Authentication-Results: shaggy-alux.authn-relay.a.mail.umich.edu; iprev=fail policy.iprev=88.236.240.114 (Mismatch); auth=pass smtp.auth=minshall Original-Received: from localhost (Mismatch [88.236.240.114]) by shaggy-alux.authn-relay.a.mail.umich.edu with ESMTPSA id 60AF09CF.F13A9.DE8AB7C.1769026; Wed, 26 May 2021 22:54:08 -0400 In-reply-to: Your message of "Wed, 26 May 2021 11:52:04 -0400." <2nk0nl7asb.fsf@fencepost.gnu.org> X-Mailer: MH-E 8.6+git; nmh 1.7.1; GNU Emacs 27.2 Content-ID: <4005253.1622084044.1@apollo2.minshall.org> 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" Xref: news.gmane.io gmane.emacs.bugs:207348 Archived-At: Glenn, thanks for the report. i guess my take is that macro-evaluation, and that of other forms, should be subject to the same restrictions as that of source block evaluation. i.e., prompting for permission to execute, subject to =org-confirm-babel-evaluate= (or, more specific variables). cheers, Greg > Package: emacs,org-mode > Version: 28.0.50 > Severity: important > Tags: security > > emacs -Q hello.org, where hello.org contains: > > #+macro: hello (eval (shell-command-to-string "touch /tmp/HELLO")) > Hello. {{{hello}}} > > Then: > M-x org-export-dispatch > t A > > -> now /tmp/HELLO exist, with no prompting. > > This seems contrary to normal Emacs practice for risky local variables, > and to the section "Code Evaluation and Security Issues" in the Org manual > (which does not mention macros).