diff options
| author | Xi Lu | 2022-12-23 12:52:48 +0800 |
|---|---|---|
| committer | Stefan Kangas | 2023-02-17 11:20:10 +0100 |
| commit | 22fb5ff5126dc8bb01edaa0252829d853afb284f (patch) | |
| tree | c63891321b7c64c42661952340fb97bf5047331d | |
| parent | 807d2d5b3a7cd1d0e3f7dd24de22770f54f5ae16 (diff) | |
| download | emacs-22fb5ff5126dc8bb01edaa0252829d853afb284f.tar.gz emacs-22fb5ff5126dc8bb01edaa0252829d853afb284f.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.
(cherry picked from commit 9a3b08061feea14d6f37685ca1ab8801758bfd1c)
| -rw-r--r-- | lisp/progmodes/ruby-mode.el | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 72631a6557f..9b05b04a52c 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el | |||
| @@ -1819,7 +1819,7 @@ or `gem' statement around point." | |||
| 1819 | (setq feature-name (read-string "Feature name: " init)))) | 1819 | (setq feature-name (read-string "Feature name: " init)))) |
| 1820 | (let ((out | 1820 | (let ((out |
| 1821 | (substring | 1821 | (substring |
| 1822 | (shell-command-to-string (concat "gem which " feature-name)) | 1822 | (shell-command-to-string (concat "gem which " (shell-quote-argument feature-name))) |
| 1823 | 0 -1))) | 1823 | 0 -1))) |
| 1824 | (if (string-match-p "\\`ERROR" out) | 1824 | (if (string-match-p "\\`ERROR" out) |
| 1825 | (user-error "%s" out) | 1825 | (user-error "%s" out) |