ghostscript: fix CVE-2025-48708

gs_lib_ctx_stash_sanitized_arg in base/gslibctx.c in Artifex Ghostscript before 10.05.1
lacks argument sanitization for the # case. A created PDF document includes
its password in cleartext.

(From OE-Core rev: 7052a81e4f9b19b5640b414c10b19f8232d81572)

Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
This commit is contained in:
Archana Polampalli
2025-05-30 13:36:40 +05:30
committed by Steve Sakoman
parent 81e0dc80d7
commit 5b18890ace
2 changed files with 47 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
From 5b5968c306b3e35cdeec83bb15026fd74a7334de Mon Sep 17 00:00:00 2001
From: Ken Sharp <Ken.Sharp@artifex.com>
Date: Sat, 12 Apr 2025 10:24:43 +0100
Subject: [PATCH] Argument sanitisation - handle '#' as per '='
Bug 708446
CVE: CVE-2025-48708
Upstream-Status: Backport [https://cgit.ghostscript.com/cgi-bin/cgit.cgi/ghostpdl.git/commit/?id=5b5968c306b3e35cdeec83bb15026fd74a7334de]
Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
---
base/gslibctx.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/base/gslibctx.c b/base/gslibctx.c
index 2cf5c9dda..40ff984f9 100644
--- a/base/gslibctx.c
+++ b/base/gslibctx.c
@@ -1225,9 +1225,9 @@ gs_lib_ctx_stash_sanitized_arg(gs_lib_ctx_t *ctx, const char *arg)
case '-': /* Need to check for permitted file lists */
/* By default, we want to keep the key, but lose the value */
p = arg+2;
- while (*p && *p != '=')
+ while (*p && *p != '=' && *p != '#')
p++;
- if (*p == '=')
+ if (*p == '=' || *p == '#')
p++;
if (*p == 0)
break; /* No value to elide */
@@ -1269,9 +1269,9 @@ gs_lib_ctx_stash_sanitized_arg(gs_lib_ctx_t *ctx, const char *arg)
case 'S':
/* By default, we want to keep the key, but lose the value */
p = arg+2;
- while (*p && *p != '=')
+ while (*p && *p != '=' && *p != '#')
p++;
- if (*p == '=')
+ if (*p == '=' || *p == '#')
p++;
if (*p == 0)
break; /* No value to elide */
--
2.40.0

View File

@@ -73,6 +73,7 @@ SRC_URI_BASE = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/d
file://CVE-2025-27835.patch \
file://CVE-2025-27836-1.patch \
file://CVE-2025-27836-2.patch \
file://CVE-2025-48708.patch \
"
SRC_URI = "${SRC_URI_BASE} \