CVE-2023-46321

9.8 CRITICAL

📋 TL;DR

This vulnerability in iTerm2 allows command injection through malicious x-man-page URLs. Attackers can execute arbitrary commands on the system by crafting URLs with shell metacharacters. All iTerm2 users on macOS are affected if using vulnerable versions.

💻 Affected Systems

Products:
  • iTerm2
Versions: All versions before 3.5.0beta12
Operating Systems: macOS
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerability exists in the x-man-page URL handler functionality within iTermSessionLauncher.m

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full system compromise with remote code execution leading to data theft, ransomware deployment, or complete system takeover.

🟠

Likely Case

Local privilege escalation or arbitrary command execution when user clicks on a malicious URL in iTerm2.

🟢

If Mitigated

Limited impact if proper URL filtering and user education prevent malicious URL execution.

🌐 Internet-Facing: MEDIUM - Requires user interaction with malicious content but can be delivered via web links or documents.
🏢 Internal Only: HIGH - Internal phishing or malicious documents could exploit this with user interaction.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires user interaction (clicking malicious URL) but the injection mechanism is straightforward once triggered.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 3.5.0beta12 and later

Vendor Advisory: https://iterm2.com/downloads.html

Restart Required: Yes

Instructions:

1. Download iTerm2 version 3.5.0beta12 or later from https://iterm2.com/downloads.html
2. Install the new version
3. Restart iTerm2 to ensure the patch is active

🔧 Temporary Workarounds

Disable x-man-page URL handling

all

Prevent iTerm2 from handling x-man-page URLs by modifying system URL handlers

defaults write com.googlecode.iterm2 DisableURLHandling -bool YES

Use alternative terminal

all

Temporarily switch to macOS Terminal or another terminal application

🧯 If You Can't Patch

  • Implement strict URL filtering at network perimeter to block malicious x-man-page URLs
  • Educate users to avoid clicking on untrusted URLs within iTerm2

🔍 How to Verify

Check if Vulnerable:

Check iTerm2 version in Preferences > General > About. If version is earlier than 3.5.0beta12, you are vulnerable.

Check Version:

grep -i version ~/Library/Preferences/com.googlecode.iterm2.plist || echo 'Check in iTerm2 GUI: Preferences > General > About'

Verify Fix Applied:

After updating, verify version shows 3.5.0beta12 or later in Preferences > General > About.

📡 Detection & Monitoring

Log Indicators:

  • Unusual process execution from iTerm2
  • Suspicious command execution patterns following URL clicks

Network Indicators:

  • Outbound connections to unusual destinations following URL interaction

SIEM Query:

process.name:iTerm2 AND process.cmdline:*man* AND process.cmdline:*;* OR process.cmdline:*&* OR process.cmdline:*|*

🔗 References

📤 Share & Export