CVE-2019-12921
Medium · 6.5CVSS
6.5
EPSS
8.0%
Published
Mar 18, 2020
CISA due date
—
Cloudanix analysis
A graphics processing tool can be tricked into leaking private files on a computer when someone opens a specially made picture file.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Low
- Impact
- Data Exposure
- Component
- Library
- Class
- Command Injection
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Allows remote file read of arbitrary system files by abusing the TranslateTextEx function when processing a crafted SVG image that references a malicious text filename component.
Why it matters to the business
Attackers can exfiltrate sensitive configuration files, credentials, or other data from systems that process user-supplied images, increasing breach risk and compliance exposure; the flaw remains unpatched in many older distributions despite being public for years.
How an attack unfolds
An attacker creates a minimal SVG file containing a text element whose filename attribute is set to a path traversal string such as '../../etc/passwd'. When a victim application uses GraphicsMagick to render or inspect the SVG, TranslateTextEx follows the filename and returns the file contents in the image metadata or error output, allowing the attacker to retrieve the data.
How to fix it
Upgrade GraphicsMagick to version 1.3.32 or newer on all affected systems; rebuild or reinstall any packages that statically link older versions; apply vendor patches for Debian, openSUSE Leap, and Backports SLE as they become available.
How to confirm the fix worked
Run 'gm version' and confirm the reported version is 1.3.32 or later; re-test SVG processing with a known path-traversal test file and verify that file contents are no longer returned; scan package databases for any remaining pre-1.3.32 GraphicsMagick binaries.
Typical attack path
- Craft malicious SVG containing path traversal in text filename component
- Deliver SVG to target via upload, email attachment, or web page
- Victim application invokes GraphicsMagick on the file (e.g., thumbnail generation, format conversion)
- TranslateTextEx resolves the filename and leaks file contents
- Attacker receives file data through image output, logs, or side-channel
How to detect it
Search web server and application logs for SVG uploads followed by unusual file paths or error messages containing system file contents; inspect GraphicsMagick process command lines and output for references to TranslateTextEx or unexpected file reads; review SIEM events for image-processing binaries accessing sensitive directories.
What your security team should do
- Immediately inventory all systems using GraphicsMagick and prioritize upgrade to 1.3.32+
- Add GraphicsMagick version checks to CI/CD and container build pipelines
- Block or sanitize SVG uploads in any application that invokes GraphicsMagick
- Monitor EPSS and KEV updates for future exploitation activity
The record
In GraphicsMagick before 1.3.32, the text filename component allows remote attackers to read arbitrary files via a crafted image because of TranslateTextEx for SVG.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:10 | graphicsmagick | 0 | 1.4+really1.3.35-1~deb10u1 |
| Debian:11 | graphicsmagick | 0 | 1.4~hg16039-1 |
| Debian:12 | graphicsmagick | 0 | 1.4~hg16039-1 |
| Debian:13 | graphicsmagick | 0 | 1.4~hg16039-1 |
| Debian:8 | graphicsmagick | 0 | 1.3.20-3+deb8u9 |
| Debian:9 | graphicsmagick | 0 | 1.3.30+hg15796-1~deb9u4 |
| SUSE:Package Hub 15 SP1 | GraphicsMagick | 0 | 1.3.29-bp151.5.12.1 |
| Ubuntu:20.04:LTS | graphicsmagick | 0 | 1.4+really1.3.35-1 |
| Ubuntu:22.04:LTS | graphicsmagick | 0 | 1.4+really1.3.38-1 |
| Ubuntu:Pro:14.04:LTS | graphicsmagick | 0 | 1.3.18-1ubuntu3.1+esm7 |
| Ubuntu:Pro:16.04:LTS | graphicsmagick | 0 | 1.3.23-1ubuntu0.6+esm1 |
| Ubuntu:Pro:18.04:LTS | graphicsmagick | 0 | 1.3.28-2ubuntu0.2+esm1 |
| Ubuntu:Pro:18.04:LTS | graphicsmagick | 0 | 1.3.28-2ubuntu0.1+esm1 |
| Ubuntu:Pro:20.04:LTS | graphicsmagick | 0 | 1.4+really1.3.35-1ubuntu0.1~esm1 |
| openSUSE:Leap 15.1 | GraphicsMagick | 0 | 1.3.29-lp151.4.17.1 |
Related vulnerabilities
- CVE-2022-1270 In GraphicsMagick, a heap buffer overflow was found when parsing MIFF. Also affects graphicsmagick
- CVE-2017-14165 The ReadSUNImage function in coders/sun.c in GraphicsMagick 1.3.26 has an issue where… Also affects graphicsmagick
- CVE-2006-4144 Integer overflow in the ReadSGIImage function in sgi.c in ImageMagick before 6.2.9 allows… Also affects graphicsmagick
- CVE-2025-27796 ReadWPGImage in WPG in GraphicsMagick before 1.3.46 mishandles palette buffer allocation… Also affects graphicsmagick
- CVE-2018-20184 In GraphicsMagick 1.4 snapshot-20181209 Q8, there is a heap-based buffer overflow in the… Also affects graphicsmagick
- CVE-2017-17912 In GraphicsMagick 1.4 snapshot-20171217 Q8, there is a heap-based buffer over-read in… Also affects graphicsmagick
- CVE-2017-16545 The ReadWPGImage function in coders/wpg.c in GraphicsMagick 1.3.26 does not properly… Also affects graphicsmagick
- CVE-2017-16352 GraphicsMagick 1.3.26 is vulnerable to a heap-based buffer overflow vulnerability found… Also affects graphicsmagick