[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Re: [BUG][Security] begin_src :var evaluated before the prom
From: |
Ihor Radchenko |
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 |
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>