public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/ghostscript] f45: CVE-2026-125396 ghostscript: Ghostscript: Arbitrary code execution via SAFER sandbox bypass  (fedora#2581641)
@ 2026-11-25 12:13 Zdenek Dohnal
  0 siblings, 0 replies; only message in thread
From: Zdenek Dohnal @ 2026-11-25 12:13 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/ghostscript
Branch : f45
Commit : 56ca3108e9e4be4b48325a0b68fdb3ad1c4dab5b
Author : Zdenek Dohnal <zdohnal@redhat.com>
Date   : 2026-11-25T12:46:50+01:00
Stats  : +73/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/ghostscript/c/56ca3108e9e4be4b48325a0b68fdb3ad1c4dab5b?branch=f45

Log:
CVE-2026-125396 ghostscript: Ghostscript: Arbitrary code execution via SAFER sandbox bypass  (fedora#2581641)

---
diff --git a/0001-PS-interpreter-validate-operands-to-.putgstringcopy.patch b/0001-PS-interpreter-validate-operands-to-.putgstringcopy.patch
new file mode 100644
index 0000000..25b7fa8
--- /dev/null
+++ b/0001-PS-interpreter-validate-operands-to-.putgstringcopy.patch
@@ -0,0 +1,68 @@
+From 1484854e0c8ddfda1baa4ad4cd965b8a9790aa81 Mon Sep 17 00:00:00 2001
+From: Ken Sharp <Ken.Sharp@artifex.com>
+Date: Wed, 2 Sep 2026 12:04:15 +0100
+Subject: [PATCH] PS interpreter - validate operands to .putgstringcopy
+
+Bug #709684 "Type 1 font-loader `.forceput` save/restore UAF yields native read/write and controlled dispatch/RCE under `-dSAFER`"
+
+Effectively another case of recovering .forceput, in this case by
+causing an error and then having the error handler use it.
+
+We are in the process of eliminating, or at least absolutely minimising,
+the use of .forceput. Ideally we want to remove it completely precisely
+to avoid this sort of thing. Unfortunately that's still a work in
+progress; it isn't easy to undo 30 years worth of assumptions in the
+code.
+
+For now this prevents the problem by ensuring that the operands are the
+correct types, which prevents the error executing 'copy' and so avoids
+the custom error handler managing to execute .forceput.
+
+This issue was reported by Paulos Yibelo <habte.yibelo@gmail.com>
+---
+ Resource/Init/gs_fonts.ps | 25 ++++++++++++++++---------
+ 1 file changed, 16 insertions(+), 9 deletions(-)
+
+diff --git a/Resource/Init/gs_fonts.ps b/Resource/Init/gs_fonts.ps
+index 5b46ef1f5..5420431c7 100644
+--- a/Resource/Init/gs_fonts.ps
++++ b/Resource/Init/gs_fonts.ps
+@@ -1,4 +1,4 @@
+-% Copyright (C) 2001-2023 Artifex Software, Inc.
++% Copyright (C) 2001-2026 Artifex Software, Inc.
+ % All Rights Reserved.
+ %
+ % This software is provided AS-IS with no warranty, either express or
+@@ -1024,14 +1024,21 @@ $error /SubstituteFont { } put
+ 
+ % any user of .putgstringcopy must use bind and executeonly
+ /.putgstringcopy  %   <dict> <name> <string> .putgstringcopy -
+-{ 2 index gcheck currentglobal
+-  2 copy eq {
+-    pop pop .forceput
+-  } executeonly {
+-    5 1 roll setglobal
+-    dup length string copy
+-    .forceput setglobal
+-  } executeonly ifelse
++{
++  % Check operand types
++  dup type /stringtype eq 2 index type /nametype eq and 3 index type /dicttype eq and {
++    2 index gcheck currentglobal
++    2 copy eq {
++      pop pop .forceput
++    } executeonly {
++      5 1 roll setglobal
++      dup length string copy
++      .forceput setglobal
++    } executeonly ifelse
++  }
++  {
++      /.putgstringcopy cvx /typecheck signalerror
++  } ifelse
+ } .forcebind odef % must be bound and hidden for .forceput
+ 
+ /.loadfontloop {        % <fontname> <filename> <libflag> .loadfontloop
+-- 
+2.56.1
+

diff --git a/ghostscript.spec b/ghostscript.spec
index 5416b19..0885475 100644
--- a/ghostscript.spec
+++ b/ghostscript.spec
@@ -47,7 +47,7 @@
 Name:             ghostscript
 Summary:          Interpreter for PostScript language & PDF
 Version:          10.07.1
-Release:          3%{?dist}
+Release:          4%{?dist}
 
 License:          AGPL-3.0-or-later
 
@@ -124,6 +124,7 @@ Patch003: 0001-PostScript-interpreter-don-t-permit-local-inside-glo.patch
 Patch004: 0001-graphics-library-Shadings-with-arrays-of-Functions-v.patch
 Patch005: 0001-PostScript-interpreter-procedural-data-sink-filter-d.patch
 Patch006: 0001-pdfwrite-bound-check-control-stack-in-type-1-2-font-.patch
+Patch007: 0001-PS-interpreter-validate-operands-to-.putgstringcopy.patch
 
 
 # Downstream patches -- these should be always included when doing rebase:
@@ -487,6 +488,9 @@ done
 # =============================================================================
 
 %changelog
+* Wed Nov 25 2026 Zdenek Dohnal <zdohnal@redhat.com> - 10.07.1-4
+- CVE-2026-125396 ghostscript: Ghostscript: Arbitrary code execution via SAFER sandbox bypass  (fedora#2581641)
+
 * Fri Oct 16 2026 Zdenek Dohnal <zdohnal@redhat.com> - 10.07.1-3
 - CVE-2026-39919 ghostscript: Heap buffer overflow in JPEG 2000 JPXDecode output adapter
 - CVE-2026-101258 ghostscript: ghostscript: -dSAFER sandbox bypass via Type 5 shading OOB write and procedure-stream use-after-free

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-25 12:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-25 12:13 [rpms/ghostscript] f45: CVE-2026-125396 ghostscript: Ghostscript: Arbitrary code execution via SAFER sandbox bypass (fedora#2581641) Zdenek Dohnal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox