CVE-2024-33869: Ghostscript SAFER mode path-traversal via incomplete validation
d9f931be-2504-4d84-8844-ce6b4d3e6d97
CVE-2024-33869 is a path-traversal vulnerability in Ghostscript's SAFER mode implementation. The gp_validate_path_len function in base/gpmisc.c attempts to validate file paths against permitted access lists, but has two critical flaws: (1) When stripping CWD prefixes from failed paths, it doesn't verify the path actually contains a CWD prefix, allowing specially-crafted paths to bypass validation; (2) The function only checks for %pipe% or | device specifiers at the START of paths, not in the middle, allowing paths like 'permitted_dir/%pipe%something' to bypass pipe device restrictions. This allows attackers to access files and devices outside SAFER mode restrictions.",