I Sent You A Jpeg Now I Own Your Mac
ExifTool versions up to 13.49 on macOS passed an unsanitised date value from image metadata into a shell command, allowing command injection. An attacker could embed shell commands in a JPEG's DateTimeOriginal field and trigger execution when the file is processed with specific ExifTool options.
Published on infosecwriteups.com
Yet on macOS, ExifTool versions up to 13.49 allowed attacker-controlled metadata to flow into a shell execution path through a vulnerable macOS-specific code path.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The date value from image metadata was inserted into a shell command string without sanitisation, and Perl's single-argument system() passed it to /bin/sh -c, allowing shell metacharacters to execute.
Impact
An attacker could execute arbitrary shell commands on a macOS system when ExifTool processes a crafted image, potentially leading to data theft or further compromise.
What the attacker needed
ExifTool ≤ 13.49 on macOS; Victim processes crafted image with -tagsFromFile; Attacker can supply image file
The fix
The vulnerability was fixed in ExifTool 13.50 by switching from a single shell command string to argument-based process execution, which avoids shell interpretation.
How it was found
- Create or obtain a JPEG image.
- Use ExifTool with the -n flag to write a malicious DateTimeOriginal value containing shell metacharacters into the image.
- Verify the payload is embedded by reading the DateTimeOriginal tag.
- Copy the crafted image to a new file.
- Run ExifTool with -tagsFromFile to copy DateTimeOriginal into FileCreateDate on the new file, triggering the vulnerable SetMacOSTags() path and executing the injected command.
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 write-up has not been written yet. The Original tab links to the source.
ExifTool is a program that reads and writes hidden information (metadata) inside image files. On macOS, it used a system command to set file dates, and it built that command by gluing text together without cleaning it. Because the date value from the image was not cleaned, an attacker could put extra shell commands in the date field, and those commands would run when the image was processed.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.