Bug 2546645 - CVE-2026-101258 ghostscript: ghostscript: -dSAFER sandbox bypass via Type 5 shading OOB write and procedure-stream use-after-free [fedora-all]
Summary: CVE-2026-101258 ghostscript: ghostscript: -dSAFER sandbox bypass via Type 5 s...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: ghostscript
Version: rawhide
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
Assignee: Zdenek Dohnal
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: {"flaws": ["aaaa4a9d-b378-4256-846e-0...
Depends On:
Blocks: CVE-2026-101258
TreeView+ depends on / blocked
 
Reported: 2026-10-06 16:00 UTC by lcelant
Modified: 2026-10-31 18:44 UTC (History)
3 users (show)

Fixed In Version: ghostscript-10.06.0-3.fc44 ghostscript-10.05.1-7.fc43 ghostscript-10.07.1-3.fc45
Clone Of:
Environment:
Last Closed: 2026-10-21 01:14:24 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description lcelant 2026-10-06 16:00:07 UTC
Disclaimer: Community trackers are created by Red Hat Product Security team on a best effort basis. Package maintainers are required to ascertain if the flaw indeed affects their package, before starting the update process.

Ghostscript's -dSAFER sandbox can be bypassed by a crafted PostScript document that chains two memory-safety bugs to achieve arbitrary command execution in the Ghostscript process context.

Bug 1 (procedure-stream use-after-free, psi/zfproc.c): In s_proc_read_continue, ss->data = *opbuf (line 323) stores a procedure-returned string without a save/restore write barrier. A global procedure stream can retain a reference to a local-VM string freed by restore, leaving a dangling pointer. Subsequent reads leak heap contents (ASLR defeat). GhostPDL 10.09.0 adds cross-space copy (s_proc_copy_string, lines 313-321) and save-ID tracking (s_proc_record_data / s_proc_data_valid); the public PoC works through upstream 10.07.1 on x86-64.

Bug 2 (Type 5 shading OOB write, base/gsshade.c, base/gsfunc3.c, psi/zshade.c): check_CBFD validated only the ArrayedOutput wrapper n field. fn_AdOt_evaluate (gsfunc3.c:643-648) calls gs_function_evaluate for each sub-function at out+i, assuming one output per sub-function. A one-element Function array wrapping a multi-output sub-function passes validation but overruns the color buffer. GhostPDL 10.09.0 check_CBFD (gsshade.c:82-93) requires each sub-function to declare exactly one output.

Exploit chain: (1) UAF leak for code and heap pointers; (2) shading OOB write corrupts a SubFileDecode stream for arbitrary read; (3) scan gs_lib_ctx_core_t for path_control_active; (4) write 0 to path_control_active; (5) %pipe% executes a shell command. Enforcement bypass is in gp_validate_path_len (base/gpmisc.c:1048-1051) when path_control_active == 0.

Trigger: malicious .ps/.eps (or embedded in ODF/DOCX/SVG) processed with a raster device (not nullpage/bbox/pdfwrite). Public PoC: https://github.com/v12-security/pocs/tree/main/ghostscript (V12 Security, BSides Canberra 2026). Reported upstream 10.00.0 through 10.07.1 on x86-64 Linux; layout constants are architecture-specific.

Red Hat verification: On RHEL 10.2 x86_64, ghostscript-10.02.1-16.el10 (CentOS Stream 10) and ghostscript-10.02.1-16.el10_0 (UBI 10) ran attacker command under -dSAFER (gs exit 139). SELinux enforcing did not block unconfined_t or initrc_t; container_t still launched a shell (AVC denied proof-file write only). RHEL 8/9 builds not dynamically retested; impact under analysis.

Affected (upstream): Ghostscript 10.00.0 through at least 10.07.1 (exploit); underlying bugs may affect older branches shipped in RHEL 8/9.
Fix: No Red Hat package fix yet. Upstream GhostPDL 10.09.0 source contains apparent fixes for both primitives; backport assessment pending.

Reporter: Akiyoshi Kurita (PSIRTSUPT submitter); research by V12 Security.
PSIRT ticket: PSIRTSUPT-24732
OSIM: OSIM-119279 / CVE-2026-101258 (embargoed).

Comment 1 Fedora Update System 2026-10-16 13:49:26 UTC
FEDORA-2026-b90bfa1339 (ghostscript-10.07.1-3.fc45) has been submitted as an update to Fedora 45.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-b90bfa1339

Comment 2 Fedora Update System 2026-10-16 14:00:10 UTC
FEDORA-2026-cf31315f93 (ghostscript-10.06.0-3.fc44) has been submitted as an update to Fedora 44.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-cf31315f93

Comment 3 Fedora Update System 2026-10-16 14:09:50 UTC
FEDORA-2026-58a572baa1 (ghostscript-10.05.1-7.fc43) has been submitted as an update to Fedora 43.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-58a572baa1

Comment 4 Fedora Update System 2026-10-17 01:56:20 UTC
FEDORA-2026-b90bfa1339 has been pushed to the Fedora 45 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2026-b90bfa1339`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2026-b90bfa1339

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 5 Fedora Update System 2026-10-17 02:26:27 UTC
FEDORA-2026-cf31315f93 has been pushed to the Fedora 44 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2026-cf31315f93`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2026-cf31315f93

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 6 Fedora Update System 2026-10-17 02:49:10 UTC
FEDORA-2026-58a572baa1 has been pushed to the Fedora 43 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2026-58a572baa1`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2026-58a572baa1

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 7 Fedora Update System 2026-10-21 01:14:24 UTC
FEDORA-2026-cf31315f93 (ghostscript-10.06.0-3.fc44) has been pushed to the Fedora 44 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 8 Fedora Update System 2026-10-28 02:46:57 UTC
FEDORA-2026-58a572baa1 (ghostscript-10.05.1-7.fc43) has been pushed to the Fedora 43 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 9 Fedora Update System 2026-10-31 18:44:35 UTC
FEDORA-2026-b90bfa1339 (ghostscript-10.07.1-3.fc45) has been pushed to the Fedora 45 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.