CVE-2024-33870: Path Traversal

Published Jun 24, 2024
·
Updated

An issue was discovered in Artifex Ghostscript before 10.03.1. There is path traversal (via a crafted PostScript document) to arbitrary files if the current directory is in the permitted paths. For example, there can be a transformation of ../../foo to ./../../foo and this will grant access if ./ is permitted.

Other sources

When the gpvalidatepathlen function validates a path, it distinguishes between absolute and relative paths. In the case of relative paths, it will check the path with and without the current-directory-prefix ("foo" and "./foo").

The problem is that it doesn't take into account paths with a parent-directory-prefix. So a path like "../../foo" is also tested as "./../../foo" and if the current directory "./" is in the permitted paths, it will pass the check and you can access arbitrary files.

References: ttps://ghostscript.readthedocs.io/en/gs10.03.1/News.html https://bugs.ghostscript.com/showbug.cgi?id=707686

Upstream commit: https://cgit.ghostscript.com/cgi-bin/cgit.cgi/ghostpdl.git/commit/?id=79aef19c685984dc3da2dc090450407d9fbcff80

— Red Hat

Affected Software

13 affected componentsFixes available
redhat/ghostscript<10.03.1
10.03.1
Artifex Ghostscript<10.03.1
debian/ghostscript<10.0.0~dfsg-11+deb12u4
10.0.0~dfsg-11+deb12u4
debian/ghostscript<10.03.1~dfsg~git20240518-1
10.03.1~dfsg~git20240518-1
debian/ghostscript<10.03.1~dfsg~git20240518-1
10.03.1~dfsg~git20240518-1
alpine/ghostscript<10.04.0-r0
10.04.0-r0
alpine/ghostscript<10.03.1-r0
10.03.1-r0
alpine/ghostscript<10.03.1-r0
10.03.1-r0
alpine/ghostscript<10.03.1-r0
10.03.1-r0
alpine/ghostscript<10.03.1-r0
10.03.1-r0
alpine/ghostscript<10.03.1-r0
10.03.1-r0
alpine/ghostscript<10.03.1-r0
10.03.1-r0
debian/ghostscript
9.53.3~dfsg-7+deb11u710.0.0~dfsg-11+deb12u410.03.1~dfsg~git20240518-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade redhat/ghostscript to a version that resolves this vulnerability.

    Fixed in 10.03.1
  2. Upgrade

    Upgrade debian/ghostscript to a version that resolves this vulnerability.

    Fixed in 10.0.0~dfsg-11+deb12u4
  3. Upgrade

    Upgrade debian/ghostscript to a version that resolves this vulnerability.

    Fixed in 10.03.1~dfsg~git20240518-1
  4. Upgrade

    Upgrade alpine/ghostscript to a version that resolves this vulnerability.

    Fixed in 10.04.0-r0
  5. Upgrade

    Upgrade alpine/ghostscript to a version that resolves this vulnerability.

    Fixed in 10.03.1-r0
  6. Upgrade

    Upgrade debian/ghostscript to a version that resolves this vulnerability.

    Fixed in 9.53.3~dfsg-7+deb11u7Fixed in 10.0.0~dfsg-11+deb12u4Fixed in 10.03.1~dfsg~git20240518-1
  7. Upgrade

    Upgrade Artifex Ghostscript to a version that resolves this vulnerability.

    Fixed in 10.03.1

Event History

May 9, 2024
CVE Published
via Ubuntu·12:00 AM
Data Sourced
via Ubuntu·12:00 AM
RemedyDescriptionSeverityAffected Software
Updated
via Ubuntu·12:00 AM
DescriptionAffected Software
Updated
via Ubuntu·12:00 AM
RemedyDescriptionAffected Software
Jun 24, 2024
Data Sourced
via Red Hat·04:06 PM
DescriptionSeverityAffected Software
Jul 3, 2024
CVE Published
via MITRE·12:00 AM
Data Sourced
via MITRE·12:00 AM
Description
Data Sourced
via NVD·07:15 PM
Description
Data Sourced
via OSV·07:15 PM
DescriptionSeverityAffected Software
Nov 7, 2024
Data Sourced
via NVD·10:35 PM
SeverityWeakness
Event
via NVD·10:35 PM
Apr 16, 2025
Data Sourced
via NVD·07:14 PM
Affected Software
Nov 3, 2026
Updated
via OSV·06:30 AM
Affected Software

Parent advisories

This vulnerability appears in the following advisories.

Frequently Asked Questions

1

What is the severity of CVE-2024-33870?

CVE-2024-33870 is classified as a high severity vulnerability due to its potential for path traversal attacks.

2

How do I fix CVE-2024-33870?

To mitigate CVE-2024-33870, upgrade Ghostscript to version 10.03.1 or later.

3

What types of systems are affected by CVE-2024-33870?

CVE-2024-33870 affects Ghostscript versions prior to 10.03.1 on various operating systems including Debian and Red Hat.

4

What is the impact of CVE-2024-33870?

CVE-2024-33870 allows attackers to access arbitrary files through a crafted PostScript document, compromising system confidentiality.

5

Is there a workaround for CVE-2024-33870?

A temporary workaround for CVE-2024-33870 includes restricting access to allowed directories and avoiding the processing of untrusted PostScript documents.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203