Skip to navigation

Threat reportVulnerabilityTL-2026-0539

ExifTool macOS Command Injection CVE-2026-3102 — Malicious Image Metadata Triggers system() Sink via Unsanitized FileCreateDate in SetMacOSTags

highPATCHED

Kaspersky GReAT disclosed CVE-2026-3102, a command injection in ExifTool <=13.49 on macOS. An attacker stages a shell payload inside an image's DateTimeOriginal tag using the -n flag (skipping PrintConvInv sanitization), then copies it into FileCreateDate via -tagsFromFile, which routes the unsanitized value through SetMacOSTags into a system() call constructing /usr/bin/setfile.

Key facts

IdentifiersTL-2026-0539, CVE-2026-3102, CVE-2021-22204
Also known asExifTool SetMacOSTags Injection, FileCreateDate Command Injection
SeverityHIGH
CVSS8.8 (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H)
Exploitation statusLinked CVE exploited in the wild; Listed in CISA KEV: CVE-2021-22204 (added )
EPSSCVE-2021-22204: 99.9% (99.9th percentile); CVE-2026-3102: 2.8% (86.1th percentile)
Affected productsPhil Harvey (ExifTool) ExifTool; Apple macOS (host platform required for vulnerable code path)
Weaknesses (CWE)CWE-77, CWE-78
ToolsExifTool <=13.49 (macOS/Darwin build), exiftool (binary or embedded Perl library)
MITRE ATT&CK techniquesT1027 Obfuscated Files or Information, T1027.003 Obfuscated Files or Information: Steganography, T1036.005 Masquerading: Match Legitimate Resource Name or Location, T1059.004 Command and Scripting Interpreter: Unix Shell, T1082 System Information Discovery, T1091 Replication Through Removable Media, T1203 Exploitation for Client Execution, T1204.002 User Execution: Malicious File, T1518 Software Discovery, T1564 Hide Artifacts, T1566 Phishing, T1566.001 Spearphishing Attachment and 3 more in the attack flow
MotivationUNKNOWN
Target sectorsmedia, publishing, government, legal, technology, creative-agencies, ci-cd-pipelines
Target regionsGlobal
Detection rules9 (1 shown free)
Sources8 cited sources

Detection coverage

As of 2026-05-20, Threadlinqs Intelligence publishes 9 detection rule(s) for TL-2026-0539 across Splunk SPL, Microsoft KQL and Sigma, covering 15 indicator(s) of compromise. The whole corpus is readable without an account. Every threat comes with one complete detection in Splunk SPL, Microsoft KQL and Sigma, free for everyone; a free account adds daily TL Creds to unlock the rest. Paid plans add a larger daily allowance, correlation and the MCP server. Threadlinqs MCP server · View plans.

Free detection: Shell Child Process of ExifTool or Perl on macOS — Injection Success & Lateral Pivot

Detects /bin/sh, /bin/bash, or /bin/zsh spawned as a direct child of /usr/bin/exiftool or /usr/bin/perl on a macOS host. This indicates successful CVE-2026-3102 command-injection execution and is the pivot point at which an attacker transitions from RCE-via-image-metadata into post-exploitation, persistence implantation, credential theft, and lateral movement (SSH, scp, osascript -> Apple Events). Captures both the immediate shell-out and any subsequent network or credential-touching activity from the injected shell tree.

  • Languages: Splunk SPL, Microsoft KQL, Sigma
  • ATT&CK: T1059.004, T1021.004, T1203, T1082
  • Data sources: osquery_process_events, macos_edr, macos_unified_logs, sysmon_for_macos
  • Severity: critical
  • Confidence: high

Splunk SPL

index=osquery OR index=edr OR index=sysmon_macos sourcetype IN ("osquery:process_events", "edr:macos:process", "XmlWinEventLog:Microsoft-Windows-Sysmon/Operational") (process_name IN ("sh", "bash", "zsh", "dash") OR process_path IN ("/bin/sh", "/bin/bash", "/bin/zsh", "/bin/dash")) cmdline="*-c*" (parent_process_name="exiftool" OR parent_process_name="perl" OR parent_process_path="*/exiftool" OR parent_process_path="*/perl")
| eval threat_id="TL-2026-0539", cve="CVE-2026-3102"
| eval lateral_pivot=if(match(cmdline, "(?i)(ssh\s|scp\s|curl\s|wget\s|osascript|security\s+find-generic-password|/Library/Keychains|nc\s|/usr/sbin/networksetup|launchctl\s+load|defaults\s+write)"), 1, 0)
| stats count min(_time) as first_seen values(cmdline) as shell_commands values(parent_process) as parents values(user) as users max(lateral_pivot) as lateral_pivot_observed by host process_name
| table host user process_name parents shell_commands lateral_pivot_observed count first_seen threat_id cve

Microsoft KQL

DeviceProcessEvents
| where Timestamp > ago(24h)
| where DeviceType == "Mac" or FolderPath has "/bin/"
| where FileName in~ ("sh", "bash", "zsh", "dash")
| where ProcessCommandLine has "-c"
| where InitiatingProcessFileName in~ ("exiftool", "perl")
    or InitiatingProcessFolderPath has "/exiftool"
    or InitiatingProcessFolderPath has "/perl"
| extend LateralPivot = iff(
    ProcessCommandLine matches regex @"(?i)(\bssh\b|\bscp\b|\bcurl\b|\bwget\b|\bnc\b|osascript|security\s+find-generic-password|/Library/Keychains|launchctl\s+load|defaults\s+write|networksetup)",
    "yes", "no")
| extend ThreatId = "TL-2026-0539", CVE = "CVE-2026-3102"
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine, InitiatingProcessFileName, InitiatingProcessCommandLine, InitiatingProcessParentFileName, LateralPivot, ThreatId, CVE

Sigma

title: Shell Child of ExifTool or Perl on macOS (CVE-2026-3102 Injection Success)
id: a3f1c0e2-0539-4003-9b03-e9609a9bcc0d
status: experimental
description: /bin/sh, /bin/bash, /bin/zsh, or /bin/dash spawned as a direct child of /usr/bin/exiftool or /usr/bin/perl on macOS. High-confidence indicator of CVE-2026-3102 SetMacOSTags command-injection execution; pivot point for post-exploitation and lateral movement from the compromised image-processing host.
references:
    - https://securelist.com/exiftool-compromise-mac/119866/
    - https://nvd.nist.gov/vuln/detail/CVE-2026-3102
author: Threadlinqs Team
date: 2026-05-20
tags:
    - attack.execution
    - attack.lateral_movement
    - attack.t1059.004
    - attack.t1203
    - attack.t1021.004
    - cve.2026.3102
logsource:
    product: macos
    category: process_creation
detection:
    selection_shell:
        Image|endswith:
            - '/sh'
            - '/bash'
            - '/zsh'
            - '/dash'
        CommandLine|contains: '-c'
    selection_parent:
        ParentImage|endswith:
            - '/exiftool'
            - '/perl'
    condition: selection_shell and selection_parent
falsepositives:
    - Perl scripts that legitimately shell out via system() or backticks on macOS hosts (verify script provenance)
    - ExifTool wrapper scripts using -execute with shell handlers (rare; verify version >= 13.50)
level: critical

Known false positives:

  • Custom Perl scripts that legitimately shell out via system() backticks on macOS
  • ExifTool wrapper scripts that pass through to shell handlers (verify exiftool >= 13.50)
  • Image-processing pipelines that intentionally invoke /bin/sh from Perl helpers

Tuning notes: Allowlist known Perl-based image automation scripts on a per-host basis. Escalate when the spawned shell command line contains lateral-movement keywords (ssh, scp, security find-generic-password, /Library/Keychains, osascript, launchctl load). Correlate with TL-2026-0539-SPL-001 (trigger) and TL-2026-0539-SPL-002 (setfile injection) within a 60-second window for highest-fidelity multi-stage incident creation.

8 more detection rules (Splunk SPL, Microsoft KQL, Sigma) · unlock with TL Creds. Sign up free to unlock the detection rules or query them with the Threadlinqs MCP server (Purple)
  • ExifTool CVE-2026-3102 Trigger Flag Combination (Microsoft Defender for Endpoint macOS) — Exploitation · unlock with TL Creds
  • macOS setfile With Injected Quotes via DeviceProcessEvents — Post-Exploitation · unlock with TL Creds
  • Shell Child of ExifTool/Perl + Outbound or Credential Activity (Defender) — Lateral Movement · unlock with TL Creds
  • Sigma — ExifTool CVE-2026-3102 SetMacOSTags Trigger Flag Combination (Exploitation) · unlock with TL Creds
  • Sigma — macOS setfile With Shell Metacharacters in -d Argument (Post-Exploitation) · unlock with TL Creds
  • Sigma — Shell Child of ExifTool or Perl on macOS (Injection Success & Lateral Pivot) · unlock with TL Creds
  • ExifTool CVE-2026-3102 SetMacOSTags Trigger Flag Combination — Exploitation · unlock with TL Creds
  • macOS setfile Invoked With Shell Metacharacters in -d Argument — Post-Exploitation · unlock with TL Creds

Indicators of compromise

As of 2026-05-20, Threadlinqs Intelligence tracks 15 indicators of compromise for TL-2026-0539.

15 indicators of compromise · unlock with TL Creds. Compare plans

Technical analysis

Successful exploitation yields arbitrary shell execution as the user invoking ExifTool. Patched upstream in 13.50 (commit e9609a9bcc0d32bd252a709a562fb822d6dd86f7) by replacing string-form system() with argument-list form.

CVE-2026-3102 is an OS command injection vulnerability (CWE-77/CWE-78) in the SetMacOSTags function of lib/Image/ExifTool/MacOS.pm affecting ExifTool versions 13.49 and earlier on macOS (Darwin). Discovered by Lucas Tay of Kaspersky''s Global Research and Analysis Team (GReAT) in February 2026 as a regression-class issue traced from his prior work on CVE-2021-22204, the flaw enables arbitrary shell command execution at the privilege level of the user invoking ExifTool when processing an attacker-controlled image file.

Technical root cause: In the vulnerable SetMacOSTags code path, ExifTool builds the shell command string $cmd = "/usr/bin/setfile -d ''${val}'' ''${f}''" where $f (filename) is properly shell-escaped but $val (the date value) is interpolated unsanitized. The vulnerable branch is reached only when the processed tag matches MDItemFSCreationDate (Spotlight system attribute) or its internal alias $FileCreateDate. Because single quotes are not stripped or escaped in $val, an attacker can inject closing-quote and command-substitution sequences that break out of the wrapping quotes and execute arbitrary shell commands.

Exploit chain: (1) Direct assignment to FileCreateDate is rejected by ExifTool''s PrintConvInv filter, which validates date/time formatting. (2) The -n (alias -printConv) flag instructs ExifTool to skip PrintConvInv and accept raw values for any tag, bypassing input sanitization. (3) The attacker first writes a malformed value containing single quotes into a permissive source tag such as DateTimeOriginal (EXIF 0x9003) using -n. (4) The attacker then invokes ExifTool with -tagsFromFile to copy the staged source tag into FileCreateDate; this copy operation — and only this copy operation — triggers SetMacOSTags. (5) SetMacOSTags concatenates the tainted $val into the setfile command and passes it to Perl''s system() function, executing the injected shell payload. The publicly demonstrated trigger command is: exiftool -n -tagsFromFile evil_benign.jpg "-FileCreateDate<DateTimeOriginal" pwn.jpg. A staging command of the form: exiftool -n -DateTimeOriginal="<injected>" evil_benign.jpg primes the source tag.

Impact: An attacker who places a crafted JPEG, PNG, or other ExifTool-readable file into a victim macOS workflow (newsroom intake, asset management pipelines, CI image processors, photo organization apps, BYOD device handling shared media) can achieve arbitrary command execution as the workflow user. Because ExifTool is widely embedded as a library and as a CLI utility in macOS imaging pipelines, downstream impact includes credential theft, persistence implantation, data exfiltration, and lateral pivoting from the compromised host.

Patch (commit e9609a9bcc0d32bd252a709a562fb822d6dd86f7, ExifTool 13.50): The maintainer abstracted the system call into a new System() wrapper that uses Perl''s argument-list system() form — system(''/usr/bin/setfile'', ''-d'', $val, $file) — eliminating shell interpolation entirely. The wrapper additionally redirects STDOUT/STDERR to /dev/null to preserve original output suppression behavior. This fix removes the need for manual escaping and closes the injection class.

Detection and hunting opportunities focus on: ExifTool process invocations carrying both -n and -tagsFromFile flags with -FileCreateDate as destination, child processes of exiftool/perl matching /bin/sh -c or /usr/bin/setfile with anomalous arguments, and macOS Unified Logs showing setfile invocations with unusual quoting. Versioning checks should confirm ExifTool 13.50 or later across asset management platforms, photo apps, and bundled library copies.

MITRE ATT&CK techniques by tactic:

Defense Evasion

T1027 Obfuscated Files or Information; T1027.003 Obfuscated Files or Information: Steganography; T1036.005 Masquerading: Match Legitimate Resource Name or Location; T1564 Hide Artifacts

Execution

T1059.004 Command and Scripting Interpreter: Unix Shell; T1203 Exploitation for Client Execution; T1204.002 User Execution: Malicious File

Discovery

T1082 System Information Discovery; T1518 Software Discovery

Initial Access

T1091 Replication Through Removable Media; T1566 Phishing; T1566.001 Spearphishing Attachment

Resource Development

T1587.004 Develop Capabilities: Exploits; T1588.005 Obtain Capabilities: Exploits; T1608.001 Stage Capabilities: Upload Malware

Remediation

Patches

  • ExifTool 13.50 (upstream release): https://github.com/exiftool/exiftool/releases/tag/13.50
  • Patch commit e9609a9bcc0d32bd252a709a562fb822d6dd86f7 (lib/Image/ExifTool/MacOS.pm)

Immediate actions

  • Upgrade ExifTool to 13.50 or later on all macOS systems
  • Audit asset management platforms and photo apps for embedded ExifTool libraries — confirm bundled versions are 13.50+
  • Block or quarantine untrusted image files at email and web gateways for macOS users until patched
  • Disable ExifTool invocations that combine -n with -tagsFromFile in CI pipelines until verified patched

Workarounds

  • Avoid invoking ExifTool with the -n / -printConv flag on attacker-controllable inputs
  • Avoid -tagsFromFile copy operations into FileCreateDate when processing untrusted images
  • Wrap ExifTool invocations behind a parser that rejects images whose DateTimeOriginal or CreateDate tags contain single quotes, backticks, $( ), or shell metacharacters
  • Restrict ExifTool to non-macOS hosts where the SetMacOSTags code path is unreachable

Longer-term hardening

  • Isolate processing of untrusted media files in sandboxed VMs or dedicated hosts with no network egress
  • Adopt least-privilege service accounts for image processing pipelines; do not run ExifTool as root or as a user with broad keychain access
  • Enforce software composition analysis (SCA) on macOS build artifacts to catch outdated ExifTool copies bundled inside third-party apps
  • Deploy macOS EDR with execution telemetry covering perl/exiftool/setfile invocations and shell child-process detection

Affected and fixed versions

  • Phil Harvey (ExifTool) — ExifTool
    Vulnerable versions: <=13.49 on macOS/Darwin
    Fixed in: 13.50
  • Apple — macOS (host platform required for vulnerable code path)
    Vulnerable versions: any macOS version running ExifTool <=13.49
    Fixed in: upgrade ExifTool to 13.50

Timeline

  • CVE-2021-22204 disclosed: prior ExifTool eval-sink command injection that inspired Lucas Tay''s audit of adjacent sanitization routines.
  • Kaspersky GReAT researcher Lucas Tay identifies CVE-2026-3102 while auditing ExifTool input validation paths similar to CVE-2021-22204.
  • ExifTool 13.50 released with commit e9609a9bcc0d32bd252a709a562fb822d6dd86f7 abstracting the vulnerable system() call into an argument-list System() wrapper.
  • CVE-2026-3102 published by VulDB / NVD with CVSS 3.1 base 8.8 (HIGH) and CWE-77/CWE-78 weakness classification.
  • NVD completes secondary analysis; vulnStatus set to Analyzed with CPE coverage for ExifTool <=13.49.
  • Threadlinqs Intelligence publishes TL-2026-0539 with full MITRE mapping, IOCs, and detection coverage.
  • Kaspersky Securelist publishes full technical writeup with reproduction steps, payload staging technique, and patch analysis.
  • As of 2026-05-29, CVE-2026-3102 (ExifTool macOS SetMacOSTags command injection) is fixed in ExifTool 13.50 (Feb 2026), NVD-Analyzed at 8.8 HIGH, with only a public PoC and no in-the-wild exploitation or CISA KEV listing. Risk now confined to unpatched or bundled ExifTool copies <=13.49 reached via the non-default -n/-tagsFromFile flag chain.

Sources cited

Previous and next in vulnerability

Drafted by the Threadlinqs research pipeline from 8 sources; published ; last updated —.

Threadlinqs Intelligence — Real-Time Threat Detection Platform

// threat_feed
$ sort --newest
Showing all threats

Live intelligence console

Threat level

Latest Threats