>From e1579b5ebde7c6935c84a1998e618d7c27c79731 Mon Sep 17 00:00:00 2001 From: Xi Lu Date: Fri, 23 Dec 2022 12:52:48 +0800 Subject: [PATCH] Fix ruby-mode.el local command injection vulnerability. * lisp/progmodes/ruby-mode.el (ruby-find-library-file): Fix local command injection vulnerability. --- lisp/progmodes/ruby-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 1f3e9b6ae7..a4aa61905e 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -1899,7 +1899,7 @@ ruby-find-library-file (setq feature-name (read-string "Feature name: " init)))) (let ((out (substring - (shell-command-to-string (concat "gem which " feature-name)) + (shell-command-to-string (concat "gem which " (shell-quote-argument feature-name))) 0 -1))) (if (string-match-p "\\`ERROR" out) (user-error "%s" out) -- 2.38.1