emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Max Nikulin <manikulin@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: [PATCH] ob-clojure.el: Add support for babashka and nbb backend
Date: Sun, 14 Nov 2021 23:25:05 +0700	[thread overview]
Message-ID: <smrd98$h53$1@ciao.gmane.io> (raw)
In-Reply-To: <87bl2mycxq.fsf@kraus.my>

On 14/11/2021 22:28, Daniel Kraus wrote:
> * lisp/ob-clojure.el: Add support for babashka and nbb backend.
> ---
> +(defun ob-clojure-escape-quotes (str-val)
> +  "Escape quotes for STR-VAL."
> +  (replace-regexp-in-string "\"" "\\\"" str-val 'FIXEDCASE 'LITERAL))
> +
> +(defun ob-clojure-eval-with-babashka (bb expanded)
> +  "Evaluate EXPANDED code block using BB (babashka or nbb)."
> +  (let ((escaped (ob-clojure-escape-quotes expanded)))
> +    (shell-command-to-string
> +     (concat bb " -e \"" escaped "\""))))

Does not it an open door for security vulnerabilities? Consider a string 
somewhere in the code: "`echo arbitrary code execution`". Only outer 
quotes are escaped.



  reply	other threads:[~2021-11-14 16:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-14 15:28 Daniel Kraus
2021-11-14 16:25 ` Max Nikulin [this message]
2021-11-14 16:30   ` Daniel Kraus
2021-11-15 14:33     ` Max Nikulin
2021-11-15 16:05       ` Daniel Kraus
2021-11-17 16:12         ` Max Nikulin
2021-11-20 10:18           ` Daniel Kraus
2021-12-22 22:34             ` Daniel Kraus
2022-01-31  7:58         ` Daniel Kraus
2022-02-02 15:58           ` Max Nikulin

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

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='smrd98$h53$1@ciao.gmane.io' \
    --to=manikulin@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --subject='Re: [PATCH] ob-clojure.el: Add support for babashka and nbb backend' \
    /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

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).