cbcvebase.
CVE-2016-5118
published 2016-06-10

CVE-2016-5118: The OpenBlob function in blob.c in GraphicsMagick before 1.3.24 and ImageMagick allows remote attackers to execute arbitrary code via a | (pipe) character at…

PriorityP271critical9.8CVSS 3.1
AVNACLPRNUINSUCHIHAH
EPSS
49.98%
98.8th percentile
The OpenBlob function in blob.c in GraphicsMagick before 1.3.24 and ImageMagick allows remote attackers to execute arbitrary code via a | (pipe) character at the start of a filename.

Affected

35 ranges· showing 25
VendorProductVersion rangeFixed in
canonicalubuntu_linux
canonicalubuntu_linux
canonicalubuntu_linux
canonicalubuntu_linux
debiandebian_linux
debiangraphicsmagick< graphicsmagick 1.3.24-1 (bookworm)graphicsmagick 1.3.24-1 (bookworm)
debianimagemagick< graphicsmagick 1.3.24-1 (bookworm)graphicsmagick 1.3.24-1 (bookworm)
graphicsmagickgraphicsmagick<= 1.3.23
graphicsmagickgraphicsmagick>= 0 < 1.3.24-11.3.24-1
graphicsmagickgraphicsmagick>= 0 < 1.3.24-11.3.24-1
graphicsmagickgraphicsmagick>= 0 < 1.3.24-11.3.24-1
graphicsmagickgraphicsmagick>= 0 < 1.3.24-11.3.24-1
imagemagickimagemagick< 7.0.1-77.0.1-7
imagemagickimagemagick>= 0 < 8:6.8.9.9-7.18:6.8.9.9-7.1
imagemagickimagemagick>= 0 < 8:6.8.9.9-7.18:6.8.9.9-7.1
imagemagickimagemagick>= 0 < 8:6.8.9.9-7.18:6.8.9.9-7.1
imagemagickimagemagick>= 0 < 8:6.8.9.9-7.18:6.8.9.9-7.1
imagemagickimagemagick>= 0 < 8:6.7.7.10-6ubuntu3.18:6.7.7.10-6ubuntu3.1
imagemagickimagemagick>= 0 < 8:6.8.9.9-7ubuntu5.18:6.8.9.9-7ubuntu5.1
opensuseleap
opensuseopensuse
oraclelinux
oraclelinux
oraclesolaris
oraclesolaris

Detection & IOCsextracted from sources · hover to see the quote

snort
alert http $EXTERNAL_NET any -> $HTTP_SERVERS any (msg:"ET WEB_SERVER Possible CVE-2016-5118 Exploit SVG attempt M2"; flow:established,to_server; http.request_body; content:"<svg"; nocase; content:"|78 6c 69 6e 6b 3a 68 72 65 66 3d 27 7c|"; nocase; reference:url,seclists.org/oss-sec/2016/q2/432; reference:cve,2016-5118; classtype:trojan-activity; sid:2022847; rev:3; metadata:created_at 2016_06_01, cve CVE_2016_5118, confidence Medium, signature_severity Major, updated_at 2020_07_14;)
snort
alert http $EXTERNAL_NET any -> $HTTP_SERVERS any (msg:"ET WEB_SERVER Possible CVE-2016-5118 Exploit MVG attempt M1"; flow:established,to_server; http.request_body; content:"viewbox|20|"; nocase; fast_pattern; content:"|20 27 7c|"; nocase; reference:url,seclists.org/oss-sec/2016/q2/432; reference:cve,2016-5118; classtype:trojan-activity; sid:2022848; rev:4; metadata:created_at 2016_06_01, cve CVE_2016_5118, confidence Medium, signature_severity Major, updated_at 2020_10_06;)
snort
alert http $EXTERNAL_NET any -> $HTTP_SERVERS any (msg:"ET WEB_SERVER Possible CVE-2016-5118 Exploit SVG attempt M1"; flow:established,to_server; http.request_body; content:"<svg"; nocase; content:"|78 6c 69 6e 6b 3a 68 72 65 66 3d 22 7c|"; reference:url,seclists.org/oss-sec/2016/q2/432; reference:cve,2016-5118; classtype:trojan-activity; sid:2022846; rev:3; metadata:created_at 2016_06_01, cve CVE_2016_5118, confidence Medium, signature_severity Major, updated_at 2020_07_14;)
snort
alert http $EXTERNAL_NET any -> $HTTP_SERVERS any (msg:"ET WEB_SERVER Possible CVE-2016-5118 Exploit MVG attempt M2"; flow:established,to_server; http.request_body; content:"viewbox|20|"; nocase; fast_pattern; content:"|20 22 7c|"; nocase; reference:url,seclists.org/oss-sec/2016/q2/432; reference:cve,2016-5118; classtype:trojan-activity; sid:2022849; rev:4; metadata:created_at 2016_06_01, cve CVE_2016_5118, confidence Medium, signature_severity Major, updated_at 2020_10_06;)
bytes
|78 6c 69 6e 6b 3a 68 72 65 66 3d 27 7c|
bytes
|78 6c 69 6e 6b 3a 68 72 65 66 3d 22 7c|
bytes
|20 27 7c|
bytes
|20 22 7c|
  • The exploit is triggered by a pipe character `|` at the start of a filename passed to the OpenBlob function in blob.c, causing shell command execution. Inspect filenames in image upload/processing requests for a leading `|`.
  • SVG-based exploit payloads contain an `xlink:href` attribute whose value begins with a pipe character (both single-quote and double-quote variants observed). Look for `<svg` combined with `xlink:href='|` or `xlink:href="|` in HTTP request bodies.
  • MVG-based exploit payloads contain a `viewbox` directive followed by a pipe character (both single-quote and double-quote variants). Look for `viewbox ` combined with ` '|` or ` "|` in HTTP request bodies.
  • A remote attacker could create a specially crafted image that, when processed by an application using ImageMagick, leads to arbitrary shell command execution with the privileges of the user running the application.
  • ·The vulnerability affects GraphicsMagick before version 1.3.24 and ImageMagick (all versions at time of disclosure). Ensure both libraries are patched; GraphicsMagick fix is confirmed in 1.3.24.
  • ·Debian packages for GraphicsMagick are resolved at version 1.3.24-1 across all tracked suites (bookworm, bullseye, forky, sid, trixie).

CVSS provenance

nvdv3.19.8CRITICALCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
nvdv2.010.0CRITICALAV:N/AC:L/Au:N/C:C/I:C/A:C
osv9.8CRITICAL
vendor_debian9.8CRITICAL
vendor_redhat9.8CRITICAL
vendor_ubuntu8.4HIGH
Stop checking back — get the weekly exploitation signal.

Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.