CVE-2017-6004
High · 7.5CVSS
7.5
EPSS
4.5%
Published
Feb 16, 2017
CISA due date
—
Cloudanix analysis
A bug in widely used image software can make programs crash when they encounter certain unusual text patterns inside images or processing instructions.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Low
- Impact
- Denial Of Service
- Component
- Library
- Class
- Memory Corruption
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
The flaw is an out-of-bounds read in the compile_bracket_matchingpath function within the PCRE JIT compiler, triggered when processing a specially crafted regular expression, resulting in an application crash.
Why it matters to the business
Services relying on image processing libraries may experience unexpected crashes when handling user-supplied or untrusted content containing complex patterns, leading to denial of service and potential operational disruption across widely deployed image manipulation tools.
How an attack unfolds
An attacker supplies a crafted regular expression through an image processing operation that invokes PCRE matching; the JIT compilation path encounters an invalid bracket sequence, performs an out-of-bounds memory read, and terminates the process.
How to fix it
Upgrade to fixed package versions: imagemagick GIT commit 1bc1fd0ff8c555841c78829217ac81fa0598255d, Debian 11/12/13 packages 8:6.9.6.2+dfsg-2, Ubuntu 14.04 packages 8:6.7.7.10-6ubuntu3.3, and Ubuntu 16.04 packages 8:6.8.9.9-7ubuntu5.3. Rebuild any custom builds against patched PCRE sources and restart affected services.
How to confirm the fix worked
Confirm the installed library reports a version or commit hash matching the listed fixed releases; test with known triggering regex patterns in a controlled environment to verify absence of crash behavior.
Typical attack path
- Identify an entry point that accepts image data or metadata processed by the vulnerable library
- Craft a regular expression containing malformed bracket constructs designed to trigger the JIT path
- Embed or trigger the expression during image handling operations such as thumbnail generation or format conversion
- Cause the application to dereference invalid memory during pattern compilation, resulting in a crash
How to detect it
Review application and system logs for sudden crashes or segmentation faults occurring during image processing tasks; correlate with inbound requests containing image uploads or conversions around the time of the incident.
What your security team should do
- Prioritize patching all ImageMagick deployments to the listed fixed versions within standard maintenance windows
- Inventory and restrict use of regex-based processing on untrusted image inputs until upgrades are complete
- Monitor vendor advisories for any related downstream package updates
The record
The compile_bracket_matchingpath function in pcre_jit_compile.c in PCRE through 8.x before revision 1680 (e.g., the PHP 7.1.1 bundled version) allows remote attackers to cause a denial of service (out-of-bounds read and application crash) via a crafted regular expression.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:11 | pcre3 | 0 | 2:8.39-2.1 |
| Debian:12 | pcre3 | 0 | 2:8.39-2.1 |
| Mageia:5 | pcre | 0 | 8.41-1.mga5 |
| Mageia:6 | pcre | 0 | 8.41-1.mga6 |
| SUSE:HPE Helion OpenStack 8 | pcre | 0 | 8.45-8.7.1 |
| SUSE:HPE Helion OpenStack 8 | selinux-policy | 0 | 20140730-36.5.2 |
| SUSE:Linux Enterprise High Availability Extension 12 SP3 | pcre | 0 | 8.45-8.7.1 |
| SUSE:Linux Enterprise High Availability Extension 12 SP4 | pcre | 0 | 8.45-8.7.1 |
| SUSE:Linux Enterprise High Availability Extension 12 SP5 | pcre | 0 | 8.45-8.7.1 |
| SUSE:Linux Enterprise Server 12 SP2-BCL | pcre | 0 | 8.45-8.7.1 |
| SUSE:Linux Enterprise Server 12 SP2-BCL | selinux-policy | 0 | 20140730-36.5.2 |
| SUSE:Linux Enterprise Server 12 SP3-BCL | pcre | 0 | 8.45-8.7.1 |
| SUSE:Linux Enterprise Server 12 SP3-BCL | selinux-policy | 0 | 20140730-36.5.2 |
| SUSE:Linux Enterprise Server 12 SP3-LTSS | pcre | 0 | 8.45-8.7.1 |
| SUSE:Linux Enterprise Server 12 SP3-LTSS | selinux-policy | 0 | 20140730-36.5.2 |
| SUSE:Linux Enterprise Server 12 SP4-LTSS | pcre | 0 | 8.45-8.7.1 |
| SUSE:Linux Enterprise Server 12 SP4-LTSS | selinux-policy | 0 | 20140730-36.5.2 |
| SUSE:Linux Enterprise Server 12 SP5 | pcre | 0 | 8.45-8.7.1 |
| SUSE:Linux Enterprise Server 12 SP5 | selinux-policy | 0 | 20140730-36.5.2 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP3 | pcre | 0 | 8.45-8.7.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP3 | selinux-policy | 0 | 20140730-36.5.2 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP4 | pcre | 0 | 8.45-8.7.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP4 | selinux-policy | 0 | 20140730-36.5.2 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP5 | pcre | 0 | 8.45-8.7.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP5 | selinux-policy | 0 | 20140730-36.5.2 |
| SUSE:Linux Enterprise Software Development Kit 12 SP5 | pcre | 0 | 8.45-8.7.1 |
| SUSE:Linux Enterprise Software Development Kit 12 SP5 | selinux-policy | 0 | 20140730-36.5.2 |
| SUSE:Linux Enterprise Workstation Extension 12 SP5 | pcre | 0 | 8.45-8.7.1 |
| SUSE:OpenStack Cloud 8 | pcre | 0 | 8.45-8.7.1 |
| SUSE:OpenStack Cloud 8 | selinux-policy | 0 | 20140730-36.5.2 |
| SUSE:OpenStack Cloud 9 | pcre | 0 | 8.45-8.7.1 |
| SUSE:OpenStack Cloud 9 | selinux-policy | 0 | 20140730-36.5.2 |
| SUSE:OpenStack Cloud Crowbar 8 | pcre | 0 | 8.45-8.7.1 |
| SUSE:OpenStack Cloud Crowbar 8 | selinux-policy | 0 | 20140730-36.5.2 |
| SUSE:OpenStack Cloud Crowbar 9 | pcre | 0 | 8.45-8.7.1 |
| SUSE:OpenStack Cloud Crowbar 9 | selinux-policy | 0 | 20140730-36.5.2 |
| Ubuntu:Pro:16.04:LTS | pcre3 | 0 | 2:8.38-3.1ubuntu0.1~esm2 |
Related vulnerabilities
- CVE-2014-9769 pcre_jit_compile.c in PCRE 8.35 does not properly use table jumps to optimize nested… Also affects pcre3
- CVE-2014-8964 Heap-based buffer overflow in PCRE 8.36 and earlier allows remote attackers to cause a… Also affects pcre3
- CVE-2026-92824 A flaw was found in libmodulemd. CWE-125
- CVE-2026-114038 A flaw was found in device-mapper-multipath. CWE-125
- CVE-2026-112896 Pillow is a Python imaging library. CWE-125
- CVE-2026-112278 rdesktop through 1.9.0 contains a heap out-of-bounds read vulnerability in… CWE-125
- CVE-2026-112273 libtins through 4.6 contains a heap out-of-bounds read vulnerability in DNS::compose_name… CWE-125
- CVE-2026-112073 A vulnerability was identified in Tencent ncnn up to 44b02dabdcf97499281a4692ebd65bad73dc… CWE-125