Pull to refresh
Logo
iTerm2 patches command execution flaw triggered by viewing crafted files

iTerm2 patches command execution flaw triggered by viewing crafted files

New Capabilities

A logic bug in the Kitty image protocol let newlines in a filename reach the shell; version 3.7.9 sanitizes terminal replies, but macOS 12 users have no fixed build.

Overview

Updated 42 minutes ago

An iTerm2 user who runs `cat` on a crafted file can trigger commands while the file looks ordinary. The file carries an Application Program Command (APC) escape sequence that the terminal consumes invisibly. A failure in the Kitty image protocol, which lets programs send images to the terminal, writes an error message containing the filename back into the shell's input, where newlines in the filename become command separators.

The patch closes three misses: no trust check on APC sequences, a filename blocklist that never ran for missing files, and an error reply written straight to the shell. iTerm2 shipped it in 3.7.9 on November 20, 2026, a build that requires macOS 13. Users on macOS 12.4 to 12.x remain on 3.6.11, which still has the flaw.

Why it matters

If you run `cat` on untrusted files in iTerm2, a filename can become a command; macOS 12 users have no patched build.

Questions about this story

Free account needed to ask — your question is kept and asked for you right after sign-up. Answers are public.

No questions yet — be the first to ask.

Key Indicators

3.6.1–3.7.8
Affected iTerm2 versions
The disclosure lists every release from 3.6.1 through 3.7.8.
3.7.9
Fixed release
Built November 20, 2026; requires macOS 13 or later.
100%
Reproducibility
The researcher calls the logic bug fully reproducible with no race condition.
+148
Lines added in fix commit
Commit a53b1bc adds the sanitizer and tests across three files.
3.6.11
Last build for macOS 12
The newest release for macOS 12.4 to 12.x still carries the flaw.

Voices

Curated perspectives — historical figures and your fellow readers.

Sign up to generate historical perspectives on this story.

People Involved

Organizations Involved

Timeline

3 events Latest: Today
  1. Lobsters publishes its report on the flaw

    Today Report

    The community news site summarizes the writeup and links the original.

  2. Researcher publishes full exploit chain

    Disclosure

    The writeup explains the APC trust gap, unreachable blocklist, and PTY reply path.

  3. iTerm2 ships 3.7.9 with reply sanitizer

    Patch

    Commit a53b1bc replaces control characters in Kitty responses and hardens title reports.

Scenarios

1

No in-the-wild exploitation is reported

Likely Resolves by May 31, 2027

Discussed by: iTerm2 release notes and Minseong Kim's technical writeup

The flaw is public and the fix is available. The quiet path is that users on macOS 13 or later update to 3.7.9, and no security vendor documents an attack. The writeup shows a reliable local exploit, but it still requires a victim to display a crafted file.

2

Attackers target macOS 12 users who cannot install 3.7.9

Possible Resolves by Q1 2027

Discussed by: tldrcve and the iTerm2 downloads page

Version 3.7.9 requires macOS 13. Users on macOS 12.4 to 12.x stay on 3.6.11, which the disclosure says still has the flaw. An attacker who can get one of those users to `cat` a file has a working path with no vendor fix.

3

A CVE is assigned and the flaw enters CISA's exploited list

Unlikely Resolves by Feb 28, 2027

Discussed by: SANS Internet Storm Center and threat-intelligence writeups

The disclosure and iTerm2's release notes name no CVE. If attackers use the flaw, the National Vulnerability Database could assign an identifier and CISA could add it to the Known Exploited Vulnerabilities catalog, which sets a patch deadline for U.S. federal agencies.

Historical Context

2 moments from history that rhyme with this story — and how they unfolded.

2020

Kitty terminal graphics-protocol injection (2020)

Kitty, the terminal that introduced the graphics protocol iTerm2 implements, fixed a flaw in which a filename with special characters appeared in a graphics-protocol error message. The error reply carried the crafted filename.

Then

Kitty patched the issue.

Now

The same pattern, untrusted filename text in a protocol reply, reappeared in iTerm2 six years later.

Why this matters now

It shows this is a recurring design hazard in terminal graphics protocols, not a one-off coding slip.

April 2026

iTerm2 SSH integration escape-sequence flaw (2026)

A separate iTerm2 flaw, CVE-2026-41253, let escape sequences in a displayed.txt file run commands through the terminal's SSH integration. It was published on April 18, 2026.

Then

The flaw was publicly tracked as CVE-2026-41253.

Now

It showed that terminal output could cross into shell input in iTerm2, the same boundary crossed by the Kitty reply path.

Why this matters now

The two bugs share a root question: when should the terminal trust data that came from a file?

Sources

(9)