[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] ob-core: add org-confirm-babel-evaluate-cell custom variable
From: |
Max Nikulin |
Subject: |
Re: [PATCH] ob-core: add org-confirm-babel-evaluate-cell custom variable |
Date: |
Wed, 14 Dec 2022 23:40:52 +0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 |
Tom, does not the following allow to achieve the same without your patch?
#+begin_src elisp :results none
(setq-local
org-confirm-babel-evaluate
(lambda (lang body)
(not
(and
(member lang '("elisp" "emacs-lisp"))
(let ((rb (read body)))
(or
(member rb
'((or)
(and)
;; add more forms that are known safe here
))
(and
(eq (car rb) 'identity)
(let ((v (cadr rb)))
(or
(symbolp v)
(stringp v)
(numberp v)
)))))))))
#+end_src
I know, it does not work, but I think it is due to (format "%S" cell)
instead of passing cell directly in
- '((:eval . yes)) nil (format "%S" cell)
My point is that if some expression is safe for a variable value then it
is safe for the source block body.
On 14/12/2022 04:16, Tom Gillespie wrote:
Will it be clear to users what "cell" means in this context?
I assume the language was originally chosen
with tables in mind, but I think it is clear? The
one issue is that using org-babel-confirm-evaluate
doesn't use the word "cell" in the yes-or-no-p prompt.
Have you ever seen the prompt for a table?
I suppose, tables are the most prominent security issue related to
unsolicited code execution:
Max Nikulin to emacs-orgmode. Re: [BUG][Security] begin_src :var
evaluated before the prompt to confirm execution. Fri, 28 Oct 2022
11:11:18 +0700. https://list.orgmode.org/tjfkp7$ggm$1@ciao.gmane.io
I am still in doubts if
10e857d42 2022-10-28 11:09:50 +0800 Ihor Radchenko: org-babel-read: Obey
`org-confirm-babel-evaluate'
was an unambiguous improvement. Perhaps it just forces more users to set
`org-confirm-babel-evaluate' to nil compromising their security to more
severe degree.
- Re: [PATCH] ob-core: add org-confirm-babel-evaluate-cell custom variable, (continued)
- Re: [PATCH] ob-core: add org-confirm-babel-evaluate-cell custom variable, Max Nikulin, 2022/12/10
- Re: [PATCH] ob-core: add org-confirm-babel-evaluate-cell custom variable, Tom Gillespie, 2022/12/11
- Re: [PATCH] ob-core: add org-confirm-babel-evaluate-cell custom variable, Tom Gillespie, 2022/12/11
- Re: [PATCH] ob-core: add org-confirm-babel-evaluate-cell custom variable, Kyle Meyer, 2022/12/11
- Re: [PATCH] ob-core: add org-confirm-babel-evaluate-cell custom variable, Tom Gillespie, 2022/12/11
- Re: [PATCH] ob-core: add org-confirm-babel-evaluate-cell custom variable, Ihor Radchenko, 2022/12/12
- Re: [PATCH] ob-core: add org-confirm-babel-evaluate-cell custom variable, Tom Gillespie, 2022/12/12
- Re: [PATCH] ob-core: add org-confirm-babel-evaluate-cell custom variable, Ihor Radchenko, 2022/12/13
- Re: [PATCH] ob-core: add org-confirm-babel-evaluate-cell custom variable, Max Nikulin, 2022/12/13
- Re: [PATCH] ob-core: add org-confirm-babel-evaluate-cell custom variable, Tom Gillespie, 2022/12/13
- Re: [PATCH] ob-core: add org-confirm-babel-evaluate-cell custom variable,
Max Nikulin <=
- Re: [PATCH] ob-core: add org-confirm-babel-evaluate-cell custom variable, Tom Gillespie, 2022/12/14
- Re: [PATCH] ob-core: add org-confirm-babel-evaluate-cell custom variable, Ihor Radchenko, 2022/12/15
- Re: [PATCH] ob-core: add org-confirm-babel-evaluate-cell custom variable, Tom Gillespie, 2022/12/15
- Re: [PATCH] ob-core: add org-confirm-babel-evaluate-cell custom variable, tomas, 2022/12/15
- Re: [PATCH] ob-core: add org-confirm-babel-evaluate-cell custom variable, Ihor Radchenko, 2022/12/15
- Re: [PATCH] ob-core: add org-confirm-babel-evaluate-cell custom variable, Max Nikulin, 2022/12/15
- Re: [PATCH] ob-core: add org-confirm-babel-evaluate-cell custom variable, Ihor Radchenko, 2022/12/15
- Re: [PATCH] ob-core: add org-confirm-babel-evaluate-cell custom variable, Max Nikulin, 2022/12/15
- Re: [PATCH] ob-core: add org-confirm-babel-evaluate-cell custom variable, Tim Cross, 2022/12/15
- Re: [PATCH] ob-core: add org-confirm-babel-evaluate-cell custom variable, Ihor Radchenko, 2022/12/16