CVE-2019-11832
TYPO3 CMS allowed attackers to upload PostScript files disguised as PNG or PDF, which ImageMagick would process and execute, leading to arbitrary code execution on the web server. An attacker could read local files or run commands.
security.lauritz-holtmann.de
Published on security.lauritz-holtmann.de
The following (slightly modified) advisory was sent to the TYPO3 security team ([email protected]) on 28th January 2019.
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
Likely the ImageMagick wrapper in TYPO3 did not properly validate or restrict file types, allowing PostScript to be passed to ImageMagick and executed by GhostScript.
Impact
An attacker could execute arbitrary code on the web server, leading to full compromise.
What the attacker needed
GhostScript installed on server; TYPO3 with ImageMagick; Ability to upload files
The fix
The ImageMagick wrapper should handle inputs carefully and not pass unsafe PostScript to ImageMagick, and GhostScript must run sandboxed; the fix was released in TYPO3 9.5.6 and 8.7.25.
How it was found
- Install GhostScript on the web server.
- Check TYPO3 configuration to ensure PDF reading is enabled.
- Create a test file at /tmp/secret.txt.
- Upload a file with .pdf and .png extensions containing PostScript code via the File List Module.
- View the file details to see the rendered thumbnail, which includes the contents of /tmp/secret.txt.
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.
PostScript is a programming language used for printing documents. ImageMagick is a tool that converts images. TYPO3 used ImageMagick to make thumbnails, but it did not check the file type properly, so an attacker could upload a PostScript file that ImageMagick would run, letting the attacker run code on the server.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.