Skip to content

Commit 760164d

Browse files
authored
Merge pull request #5175 from microsoft/pawelwi/emacs_cve_fix
Patched `emacs` to fix CVE-2023-28617.
2 parents 66f8ef1 + 240a683 commit 760164d

File tree

2 files changed

+74
-1
lines changed

2 files changed

+74
-1
lines changed

SPECS/emacs/CVE-2023-28617.patch

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
From 8f8ec2ccf3f5ef8f38d68ec84a7e4739c45db485 Mon Sep 17 00:00:00 2001
2+
From: Xi Lu <[email protected]>
3+
Date: Sat, 18 Feb 2023 18:03:28 +0800
4+
Subject: * lisp/ob-latex.el (org-babel-execute:latex): Fix command injection
5+
vulnerability
6+
7+
Link: https://orgmode.org/list/[email protected]
8+
9+
TINYCHANGE
10+
---
11+
lisp/org/ob-latex.el | 2 +-
12+
1 file changed, 1 insertion(+), 1 deletion(-)
13+
14+
diff --git a/lisp/org/ob-latex.el b/lisp/org/ob-latex.el
15+
index 428907a..a0154bf 100644
16+
--- a/lisp/org/ob-latex.el
17+
+++ b/lisp/org/ob-latex.el
18+
@@ -180,7 +180,7 @@ This function is called by `org-babel-execute-src-block'."
19+
tmp-pdf
20+
(list org-babel-latex-pdf-svg-process)
21+
extension err-msg log-buf)))
22+
- (shell-command (format "mv %s %s" img-out out-file)))))
23+
+ (rename-file img-out out-file t))))
24+
((string-suffix-p ".tikz" out-file)
25+
(when (file-exists-p out-file) (delete-file out-file))
26+
(with-temp-file out-file
27+
--
28+
29+
From a8006ea580ed74f27f974d60b598143b04ad1741 Mon Sep 17 00:00:00 2001
30+
From: Xi Lu <[email protected]>
31+
Date: Sat, 11 Mar 2023 18:53:37 +0800
32+
Subject: * lisp/ob-latex.el: Fix command injection vulnerability
33+
34+
(org-babel-execute:latex):
35+
Replaced the `(shell-command "mv BAR NEWBAR")' with `rename-file'.
36+
37+
TINYCHANGE
38+
---
39+
lisp/org/ob-latex.el | 13 +++++--------
40+
1 file changed, 5 insertions(+), 8 deletions(-)
41+
42+
diff --git a/lisp/org/ob-latex.el b/lisp/org/ob-latex.el
43+
index a2c24b3..ce39628 100644
44+
--- a/lisp/org/ob-latex.el
45+
+++ b/lisp/org/ob-latex.el
46+
@@ -218,17 +218,14 @@ This function is called by `org-babel-execute-src-block'."
47+
(if (string-suffix-p ".svg" out-file)
48+
(progn
49+
(shell-command "pwd")
50+
- (shell-command (format "mv %s %s"
51+
- (concat (file-name-sans-extension tex-file) "-1.svg")
52+
- out-file)))
53+
+ (rename-file (concat (file-name-sans-extension tex-file) "-1.svg")
54+
+ out-file t))
55+
(error "SVG file produced but HTML file requested")))
56+
((file-exists-p (concat (file-name-sans-extension tex-file) ".html"))
57+
(if (string-suffix-p ".html" out-file)
58+
- (shell-command "mv %s %s"
59+
- (concat (file-name-sans-extension tex-file)
60+
- ".html")
61+
- out-file)
62+
- (error "HTML file produced but SVG file requested")))))
63+
+ (rename-file (concat (file-name-sans-extension tex-file) ".html")
64+
+ out-file t)
65+
+ (error "HTML file produced but SVG file requested")))))
66+
((or (string= "pdf" extension) imagemagick)
67+
(with-temp-file tex-file
68+
(require 'ox-latex)
69+
--

SPECS/emacs/emacs.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Summary: GNU Emacs text editor
22
Name: emacs
33
Version: 28.2
4-
Release: 4%{?dist}
4+
Release: 5%{?dist}
55
License: GPLv3+ AND CC0-1.0
66
Vendor: Microsoft Corporation
77
Distribution: Mariner
@@ -13,6 +13,7 @@ Patch1: CVE-2022-48337.patch
1313
Patch2: CVE-2022-48338.patch
1414
Patch3: CVE-2022-48339.patch
1515
Patch4: CVE-2023-27986.patch
16+
Patch5: CVE-2023-28617.patch
1617
BuildRequires: gcc
1718
BuildRequires: glibc-devel
1819
BuildRequires: gnutls-devel
@@ -89,6 +90,9 @@ mkdir -p %{buildroot}%{_datadir}/emacs/site-lisp/site-start.d
8990
%dir %{_datadir}/emacs/site-lisp/site-start.d
9091

9192
%changelog
93+
* Mon Mar 27 2023 Pawel Winogrodzki <[email protected]> - 28.2-5
94+
- Applied upstream patches to fix CVE-2023-28617.
95+
9296
* Thu Mar 16 2023 Nicolas Guibourge <[email protected]> - 28.2-4
9397
- Apply upstream patches to fix CVE-2023-27986, CVE-2023-27985
9498

0 commit comments

Comments
 (0)