Rapid7 Vulnerability & Exploit Database

Ghostscript Command Execution via Format String

Back to Search

Ghostscript Command Execution via Format String

Disclosed
03/14/2024
Created
07/19/2024

Description

This module exploits a format string vulnerability in Ghostscript versions before 10.03.1 to achieve a SAFER sandbox bypass and execute arbitrary commands. This vulnerability is reachable via libraries such as ImageMagick. This exploit only works against Ghostscript versions 10.03.0 and 10.01.2. Some offsets adjustement will probably be needed to make it work with other versions.

Author(s)

  • Thomas Rinsma
  • Christophe De La fuente

Platform

Linux,Unix,Windows

Architectures

cmd, x86, x64

Development

Module Options

To display the available options, load the module within the Metasploit console and run the commands 'show options' or 'show advanced':

msf > use exploit/multi/fileformat/ghostscript_format_string_cve_2024_29510
msf exploit(ghostscript_format_string_cve_2024_29510) > show targets
    ...targets...
msf exploit(ghostscript_format_string_cve_2024_29510) > set TARGET < target-id >
msf exploit(ghostscript_format_string_cve_2024_29510) > show options
    ...show and set options...
msf exploit(ghostscript_format_string_cve_2024_29510) > exploit

Time is precious, so I don’t want to do something manually that I can automate. Leveraging the Metasploit Framework when automating any task keeps us from having to re-create the wheel as we can use the existing libraries and focus our efforts where it matters.

– Jim O’Gorman | President, Offensive Security

;