all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: Max Nikulin <manikulin@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH] Re: [BUG][Security] begin_src :var evaluated before the prompt to confirm execution
Date: Sat, 29 Oct 2022 03:19:03 +0000	[thread overview]
Message-ID: <8735b7l3ko.fsf@localhost> (raw)
In-Reply-To: <tjh2hg$pae$1@ciao.gmane.io>

Max Nikulin <manikulin@gmail.com> writes:

> On 28/10/2022 10:15, Ihor Radchenko wrote:
>> 
>> See the attached tentative patch.
>> I tried to balance between annoying users with query and not evaluating
>> unsafe code: '-quoted lists and symbols are still evaluated without
>> prompt.
>> 
>> Let me know if you see any potential issues.
>
> If I got it right, it prompt user for every variable. I believed that 
> single prompt is enough for both header arguments and body evaluation. 
> Maybe I missed some issue with dependent code blocks. If I remember 
> correctly, each block causes a prompt and I am not going to dispute such 
> behavior. Unsure if early prompt may increase user confusion since some 
> blocks will be evaluated not immediately after related prompt but 
> perhaps after some delay to confirm dependent code.

You are right that a separate prompt will be shown for each eval form,
even when multiple :var assignments are present in the header arguments.

I could try to patch the higher-level function that is causing the
"pwned" in your example, but I figured that org-babel-read is actually
used in many more places and thus similar issue could occur in different
scenarios. Displaying prompt in org-babel-read is the safest approach I
managed to come up with.

What can help here is the feature request about bulk-yes/bulk-no code
prompts:
https://list.orgmode.org/orgmode/l-mfSe5KD9g7LPdD7qHPtqtjBD45DK8OeOqO6ybMWqoXG-oEQAFjlW1V1N1NtJQBWM_A4CeGT_92rpSKF7Aq0KRzsNmMZfAJnAbyVWeCjoA=@protonmail.ch/

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


  reply	other threads:[~2022-10-29  5:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-27  3:18 [BUG][Security] begin_src :var evaluated before the prompt to confirm execution Max Nikulin
2022-10-27  4:22 ` Jean Louis
2022-10-27  4:46   ` Max Nikulin
2022-10-28  4:33     ` Ihor Radchenko
2022-10-28  3:19   ` Ihor Radchenko
2022-10-28  4:11     ` Max Nikulin
2022-10-28  7:30     ` Jean Louis
2022-10-28  3:15 ` [PATCH] " Ihor Radchenko
2022-10-28 17:12   ` Max Nikulin
2022-10-29  3:19     ` Ihor Radchenko [this message]
2022-11-10  5:55   ` Ihor Radchenko

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=8735b7l3ko.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=emacs-orgmode@gnu.org \
    --cc=manikulin@gmail.com \
    /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.