CVE-2026-50642CWE-116

CVE-2026-50642

published July 29, 2026

CVSS
4.8
EPSS
0%
Percentile
12.9
In the wild
Unconfirmed
What it is

diff‑so‑fancy does not properly sanitize non‑SGR terminal control sequences before outputting diff data. The application only strips ANSI SGR sequences while allowing other control characters, including carriage return (\r) and escape sequences (e.g., OSC, CSI), to pass through unsanitized.

An attacker can embed malicious control sequences in filenames, diff metadata, or file content that are rendered directly in the terminal during diff viewing. This can lead to output manipulation, including filename spoofing, terminal screen clearing, and clipboard injection via supported escape sequences.

Successful exploitation may mislead users during code review, alter terminal state, or result in unintended command execution through clipboard hijacking.

This issue has been fixed in the commit 9c81294

The record
Technical detail
CVSS
4.8 · NONE
CVSS v4.0
Not supplied
EPSS
0.00229 · 12.9th percentile
Weakness
CWE-116 · Improper Encoding or Escaping of Output
Published
2026-07-29T15:16Z
References (2)
EPSS history
Timeline
  • 29 JUL 09:46Z
    Terminal Escape Injection in diff‑so‑fancy
    cvelistv5