diff options
author | Joe Slater <joe.slater@windriver.com> | 2023-10-11 16:09:11 -0700 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2023-10-18 05:25:19 -1000 |
commit | f9694145e9bb9f94f9d5968220c7383a66b912d6 (patch) | |
tree | 9306f66351da2f955d174152a832b8701b1a0bde | |
parent | d06bb8d657159cb42247719e28c97f3d2c02bb6c (diff) | |
download | poky-f9694145e9bb9f94f9d5968220c7383a66b912d6.tar.gz |
ghostscript: fix CVE-2023-43115
The patch is copied from kirkstone. master has advanced
to ghostscript 10.02.0 which includes the fix.
(From OE-Core rev: 80a9b54ca94a9fe5818daa1cd03ae8035043e1e8)
Signed-off-by: Joe Slater <joe.slater@windriver.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r-- | meta/recipes-extended/ghostscript/ghostscript/CVE-2023-43115.patch | 62 | ||||
-rw-r--r-- | meta/recipes-extended/ghostscript/ghostscript_10.0.0.bb | 1 |
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..979f354ed5 --- /dev/null +++ b/meta/recipes-extended/ghostscript/ghostscript/CVE-2023-43115.patch | |||
@@ -0,0 +1,62 @@ | |||
1 | From 8b0f20002536867bd73ff4552408a72597190cbe Mon Sep 17 00:00:00 2001 | ||
2 | From: Ken Sharp <ken.sharp@artifex.com> | ||
3 | Date: Thu, 24 Aug 2023 15:24:35 +0100 | ||
4 | Subject: [PATCH] IJS device - try and secure the IJS server startup | ||
5 | |||
6 | Bug #707051 ""ijs" device can execute arbitrary commands" | ||
7 | |||
8 | The problem is that the 'IJS' device needs to start the IJS server, and | ||
9 | that is indeed an arbitrary command line. There is (apparently) no way | ||
10 | to validate it. Indeed, this is covered quite clearly in the comments | ||
11 | at 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 | |||
16 | Previously this used the awful LockSafetyParams hackery, which we | ||
17 | abandoned some time ago because it simply couldn't be made secure (it | ||
18 | was implemented in PostScript and was therefore vulnerable to PostScript | ||
19 | programs). | ||
20 | |||
21 | This commit prevents PostScript programs switching to the IJS device | ||
22 | after SAFER has been activated, and prevents changes to the IjsServer | ||
23 | parameter after SAFER has been activated. | ||
24 | |||
25 | SAFER is activated, unless explicitly disabled, before any user | ||
26 | PostScript is executed which means that the device and the server | ||
27 | invocation can only be configured on the command line. This does at | ||
28 | least provide minimal security against malicious PostScript programs. | ||
29 | |||
30 | Upstream-Status: Backport [https://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=8b0f20002536867bd73ff4552408a72597190cbe] | ||
31 | |||
32 | CVE: CVE-2023-43115 | ||
33 | |||
34 | Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com> | ||
35 | --- | ||
36 | devices/gdevijs.c | 4 +++- | ||
37 | 1 file changed, 3 insertions(+), 1 deletion(-) | ||
38 | |||
39 | diff --git a/devices/gdevijs.c b/devices/gdevijs.c | ||
40 | index 8cbd84b97..16f5a1752 100644 | ||
41 | --- a/devices/gdevijs.c | ||
42 | +++ b/devices/gdevijs.c | ||
43 | @@ -888,6 +888,8 @@ gsijs_initialize_device(gx_device *dev) | ||
44 | static const char rgb[] = "DeviceRGB"; | ||
45 | gx_device_ijs *ijsdev = (gx_device_ijs *)dev; | ||
46 | |||
47 | + if (ijsdev->memory->gs_lib_ctx->core->path_control_active) | ||
48 | + return_error(gs_error_invalidaccess); | ||
49 | if (!ijsdev->ColorSpace) { | ||
50 | ijsdev->ColorSpace = gs_malloc(ijsdev->memory, sizeof(rgb), 1, | ||
51 | "gsijs_initialize"); | ||
52 | @@ -1326,7 +1328,7 @@ gsijs_put_params(gx_device *dev, gs_param_list *plist) | ||
53 | if (code >= 0) | ||
54 | code = gsijs_read_string(plist, "IjsServer", | ||
55 | ijsdev->IjsServer, sizeof(ijsdev->IjsServer), | ||
56 | - dev->LockSafetyParams, is_open); | ||
57 | + ijsdev->memory->gs_lib_ctx->core->path_control_active, is_open); | ||
58 | |||
59 | if (code >= 0) | ||
60 | code = gsijs_read_string_malloc(plist, "DeviceManufacturer", | ||
61 | -- | ||
62 | 2.40.0 | ||
diff --git a/meta/recipes-extended/ghostscript/ghostscript_10.0.0.bb b/meta/recipes-extended/ghostscript/ghostscript_10.0.0.bb index 9e2cd01ff4..5c6be991d9 100644 --- a/meta/recipes-extended/ghostscript/ghostscript_10.0.0.bb +++ b/meta/recipes-extended/ghostscript/ghostscript_10.0.0.bb | |||
@@ -37,6 +37,7 @@ SRC_URI_BASE = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/d | |||
37 | file://cve-2023-28879.patch \ | 37 | file://cve-2023-28879.patch \ |
38 | file://cve-2023-36664.patch \ | 38 | file://cve-2023-36664.patch \ |
39 | file://CVE-2023-38559.patch \ | 39 | file://CVE-2023-38559.patch \ |
40 | file://CVE-2023-43115.patch \ | ||
40 | " | 41 | " |
41 | 42 | ||
42 | SRC_URI = "${SRC_URI_BASE} \ | 43 | SRC_URI = "${SRC_URI_BASE} \ |