summaryrefslogtreecommitdiff
path: root/lisp/progmodes/ruby-mode.el
diff options
context:
space:
mode:
authorXi Lu <lx@shellcodes.org>2022-12-23 12:52:48 +0800
committerDmitry Gutov <dgutov@yandex.ru>2022-12-24 01:42:42 +0200
commit9a3b08061feea14d6f37685ca1ab8801758bfd1c (patch)
tree8bf04015859a46f38cb68f446536dd0df98c32bc /lisp/progmodes/ruby-mode.el
parent4b44a395b3c6760fbb9d19fe5d9d23117a79bbf0 (diff)
downloademacs-9a3b08061feea14d6f37685ca1ab8801758bfd1c.tar.gz
emacs-9a3b08061feea14d6f37685ca1ab8801758bfd1c.tar.bz2
emacs-9a3b08061feea14d6f37685ca1ab8801758bfd1c.zip
Fix ruby-mode.el local command injection vulnerability (bug#60268)
* lisp/progmodes/ruby-mode.el (ruby-find-library-file): Fix local command injection vulnerability.
Diffstat (limited to 'lisp/progmodes/ruby-mode.el')
-rw-r--r--lisp/progmodes/ruby-mode.el2
1 files changed, 1 insertions, 1 deletions
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index 1f3e9b6ae7b..a4aa61905e4 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -1899,7 +1899,7 @@ or `gem' statement around point."
(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)