Bug 2293959 (CVE-2024-33870) - CVE-2024-33870 ghostscript: path traversal to arbitrary files if the current directory is in the permitted paths
Summary: CVE-2024-33870 ghostscript: path traversal to arbitrary files if the current ...
Keywords:
Status: NEW
Alias: CVE-2024-33870
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 2293960
Blocks: 2278776
TreeView+ depends on / blocked
 
Reported: 2024-06-24 16:06 UTC by Robb Gatica
Modified: 2024-09-12 14:28 UTC (History)
0 users

Fixed In Version: ghostscript 10.03.1
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2024:6650 0 None None None 2024-09-12 14:28:35 UTC
Red Hat Product Errata RHSA-2024:6197 0 None None None 2024-09-03 10:24:58 UTC
Red Hat Product Errata RHSA-2024:6466 0 None None None 2024-09-09 01:31:33 UTC

Description Robb Gatica 2024-06-24 16:06:23 UTC
When the `gp_validate_path_len` 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/show_bug.cgi?id=707686

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

Comment 1 Robb Gatica 2024-06-24 16:08:11 UTC
Created ghostscript tracking bugs for this issue:

Affects: fedora-all [bug 2293960]

Comment 3 errata-xmlrpc 2024-09-03 10:24:57 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9

Via RHSA-2024:6197 https://access.redhat.com/errata/RHSA-2024:6197

Comment 4 errata-xmlrpc 2024-09-09 01:31:32 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9.2 Extended Update Support

Via RHSA-2024:6466 https://access.redhat.com/errata/RHSA-2024:6466


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