summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVijay Anusuri <vanusuri@mvista.com>2023-10-09 09:48:05 +0530
committerSteve Sakoman <steve@sakoman.com>2023-10-13 05:47:07 -1000
commiteebb034b2195f6b27ac17f436653db28ebdcfa4c (patch)
treeda8a9067c10947dda7e7f98a30291c6585832f6e
parente4d507b93bece23276bd7785c5fad26ffc1a5cb0 (diff)
downloadpoky-eebb034b2195f6b27ac17f436653db28ebdcfa4c.tar.gz
ghostscript: Backport fix CVE-2023-43115
In Artifex Ghostscript through 10.01.2, gdevijs.c in GhostPDL can lead to remote code execution via crafted PostScript documents because they can switch to the IJS device, or change the IjsServer parameter, after SAFER has been activated. NOTE: it is a documented risk that the IJS server can be specified on a gs command line (the IJS device inherently must execute a command to start the IJS server). References: https://nvd.nist.gov/vuln/detail/CVE-2023-43115 Upstream commit: https://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=e59216049cac290fb437a04c4f41ea46826cfba5 (From OE-Core rev: a43f7277061ee6c30c42c9318e3e9dd076563f5d) Signed-off-by: Vijay Anusuri <vanusuri@mvista.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r--meta/recipes-extended/ghostscript/ghostscript/CVE-2023-43115.patch62
-rw-r--r--meta/recipes-extended/ghostscript/ghostscript_9.52.bb1
2 files changed, 63 insertions, 0 deletions
diff --git a/meta/recipes-extended/ghostscript/ghostscript/CVE-2023-43115.patch b/meta/recipes-extended/ghostscript/ghostscript/CVE-2023-43115.patch
new file mode 100644
index 0000000000..3acb8a503c
--- /dev/null
+++ b/meta/recipes-extended/ghostscript/ghostscript/CVE-2023-43115.patch
@@ -0,0 +1,62 @@
1From 8b0f20002536867bd73ff4552408a72597190cbe Mon Sep 17 00:00:00 2001
2From: Ken Sharp <ken.sharp@artifex.com>
3Date: Thu, 24 Aug 2023 15:24:35 +0100
4Subject: [PATCH] IJS device - try and secure the IJS server startup
5
6Bug #707051 ""ijs" device can execute arbitrary commands"
7
8The problem is that the 'IJS' device needs to start the IJS server, and
9that is indeed an arbitrary command line. There is (apparently) no way
10to validate it. Indeed, this is covered quite clearly in the comments
11at the start of the source:
12
13 * WARNING: The ijs server can be selected on the gs command line
14 * which is a security risk, since any program can be run.
15
16Previously this used the awful LockSafetyParams hackery, which we
17abandoned some time ago because it simply couldn't be made secure (it
18was implemented in PostScript and was therefore vulnerable to PostScript
19programs).
20
21This commit prevents PostScript programs switching to the IJS device
22after SAFER has been activated, and prevents changes to the IjsServer
23parameter after SAFER has been activated.
24
25SAFER is activated, unless explicitly disabled, before any user
26PostScript is executed which means that the device and the server
27invocation can only be configured on the command line. This does at
28least provide minimal security against malicious PostScript programs.
29
30Upstream-Status: Backport [https://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=e59216049cac290fb437a04c4f41ea46826cfba5]
31CVE: CVE-2023-43115
32Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
33---
34 devices/gdevijs.c | 5 ++++-
35 1 file changed, 4 insertions(+), 1 deletion(-)
36
37diff --git a/devices/gdevijs.c b/devices/gdevijs.c
38index 3d337c5..e50d69f 100644
39--- a/devices/gdevijs.c
40+++ b/devices/gdevijs.c
41@@ -934,6 +934,9 @@ gsijs_finish_copydevice(gx_device *dev, const gx_device *from_dev)
42 static const char rgb[] = "DeviceRGB";
43 gx_device_ijs *ijsdev = (gx_device_ijs *)dev;
44
45+ if (ijsdev->memory->gs_lib_ctx->core->path_control_active)
46+ return_error(gs_error_invalidaccess);
47+
48 code = gx_default_finish_copydevice(dev, from_dev);
49 if(code < 0)
50 return code;
51@@ -1363,7 +1366,7 @@ gsijs_put_params(gx_device *dev, gs_param_list *plist)
52 if (code >= 0)
53 code = gsijs_read_string(plist, "IjsServer",
54 ijsdev->IjsServer, sizeof(ijsdev->IjsServer),
55- dev->LockSafetyParams, is_open);
56+ ijsdev->memory->gs_lib_ctx->core->path_control_active, is_open);
57
58 if (code >= 0)
59 code = gsijs_read_string_malloc(plist, "DeviceManufacturer",
60--
612.25.1
62
diff --git a/meta/recipes-extended/ghostscript/ghostscript_9.52.bb b/meta/recipes-extended/ghostscript/ghostscript_9.52.bb
index 0a2f9f5046..9712871e7f 100644
--- a/meta/recipes-extended/ghostscript/ghostscript_9.52.bb
+++ b/meta/recipes-extended/ghostscript/ghostscript_9.52.bb
@@ -44,6 +44,7 @@ SRC_URI_BASE = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/d
44 file://CVE-2023-36664-pre1.patch \ 44 file://CVE-2023-36664-pre1.patch \
45 file://CVE-2023-36664-1.patch \ 45 file://CVE-2023-36664-1.patch \
46 file://CVE-2023-36664-2.patch \ 46 file://CVE-2023-36664-2.patch \
47 file://CVE-2023-43115.patch \
47" 48"
48 49
49SRC_URI = "${SRC_URI_BASE} \ 50SRC_URI = "${SRC_URI_BASE} \