From 7d774cba7257d7de5f5e8bd7dba076c2f8da82d2 Mon Sep 17 00:00:00 2001 From: Funda Wang Date: Wed, 29 Jan 2025 13:43:26 +0800 Subject: [PATCH] add opensuse patch to fix CVE-2024-53920 --- emacs-CVE-2024-53920.patch | 47 ++++++++++++++++++++++++++++++++++++++ emacs.spec | 10 +++++--- 2 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 emacs-CVE-2024-53920.patch diff --git a/emacs-CVE-2024-53920.patch b/emacs-CVE-2024-53920.patch new file mode 100644 index 0000000..532d14f --- /dev/null +++ b/emacs-CVE-2024-53920.patch @@ -0,0 +1,47 @@ +From: Werner Fink +Date: Fri, 13 Dec 2024 14:32:39 +0000 +Subject: [PATCH] Disable flymake on start and save (CVE-2024-53920) + +Disable flymake on start and save to avoid to be attacked with elisp code +like in this example: + + > cat document.txt + ;; -*- mode: emacs-lisp -*- + (rx (eval (call-process "touch" nil nil nil "/tmp/owned"))) + +if not disabled the elisp code above is completed which means executed +without any warning if `flymake-mode' would be enabled by default for +`emacs-lisp-mode'. + +--- + lisp/progmodes/flymake.el | 14 ++++++++++---- + 1 file changed, 10 insertions(+), 4 deletions(-) + +--- a/lisp/progmodes/flymake.el ++++ b/lisp/progmodes/flymake.el 2024-12-13 14:26:43.833166494 +0000 +@@ -199,15 +199,21 @@ If nil, never start checking buffer auto + (define-obsolete-variable-alias 'flymake-start-syntax-check-on-find-file + 'flymake-start-on-flymake-mode "26.1") + +-(defcustom flymake-start-on-flymake-mode t ++(defcustom flymake-start-on-flymake-mode nil + "If non-nil, start syntax check when `flymake-mode' is enabled. +-Specifically, start it when the buffer is actually displayed." ++Specifically, start it when the buffer is actually displayed. ++Warning: if enabled and with elisp-mode the triggered code completion on ++untrusted Emacs Lisp source code allows attackers to execute arbitrary code. ++More information at https://www.cve.org/CVERecord?id=CVE-2024-53920" + :version "26.1" + :type 'boolean) + +-(defcustom flymake-start-on-save-buffer t ++(defcustom flymake-start-on-save-buffer nil + "If non-nil, start syntax check when a buffer is saved. +-Specifically, start it when the saved buffer is actually displayed." ++Specifically, start it when the saved buffer is actually displayed. ++Warning: if enabled and with elisp-mode the triggered code completion on ++untrusted Emacs Lisp source code allows attackers to execute arbitrary code. ++More information at https://www.cve.org/CVERecord?id=CVE-2024-53920" + :version "27.1" + :type 'boolean) + diff --git a/emacs.spec b/emacs.spec index 4fa7935..ffb58ec 100644 --- a/emacs.spec +++ b/emacs.spec @@ -8,9 +8,9 @@ Name: emacs Epoch: 1 Version: 27.2 -Release: 14 +Release: 15 Summary: An extensible GNU text editor -License: GPLv3+ and CC0-1.0 +License: GPL-3.0-or-later AND CC0-1.0 URL: http://www.gnu.org/software/emacs Source0: https://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz Source1: site-start.el @@ -36,6 +36,7 @@ Patch6011: backport-CVE-2024-30203.patch Patch6012: backport-CVE-2024-30204.patch Patch6013: backport-CVE-2024-30205.patch Patch6014: backport-CVE-2024-39331.patch +Patch6015: emacs-CVE-2024-53920.patch Patch9000: emacs-deal-taboo-words.patch @@ -106,7 +107,7 @@ on a terminal %package common Summary: Emacs common files -License: GPLv3+ and GFDL and BSD +License: GPL-3.0-or-later AND GFDL-1.3-or-later AND BSD-3-Clause Requires: %{name}-filesystem = %{epoch}:%{version}-%{release} Requires(preun): /sbin/install-info Requires(preun): %{_sbindir}/alternatives @@ -425,6 +426,9 @@ fi %{_mandir}/*/* %changelog +* Wed Jan 29 2025 Funda Wang - 1:27.2-15 +- add opensuse patch to fix CVE-2024-53920 + * Tue Jul 02 2024 zhangpan - 1:27.2-14 - fix CVE-2024-39331 -- Gitee