Skip to content
Info disclosure Write-up Advanced

From Indirect Prompt Injection to DNS Exfiltration in macOS Terminal

The macOS Terminal app allowed a crafted sequence of ANSI escape codes to trigger DNS requests, which could be abused for data exfiltration. An attacker could use this behaviour to leak information from the terminal to an external server via DNS.

embracethered.com

Published on embracethered.com

This is a follow-up to my previous Terminal DiLLMa research, and there is a positive outcome: Apple fixed a macOS Terminal behavior that enabled a DNS-based data exfiltration technique.

The author, on embracethered.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the terminal application processed ANSI escape sequences that included hostnames, causing unintended DNS resolution.

Impact

An attacker could exfiltrate data from the terminal via DNS requests, though the text does not specify the exact data or conditions.

What the attacker needed

MacOS Terminal app; victim views crafted terminal output

The fix

Apple fixed the macOS Terminal behaviour that allowed DNS requests via ANSI escape codes.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

Terminal apps interpret special control codes to format text. A researcher found that certain codes could make the terminal perform a DNS lookup, which is a way to send a small message to an external server. This could let an attacker sneak data out of a victim's machine without obvious network traffic.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.