Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAttacker crafts malicious escape sequences in repo content
-
DeliveryContent submitted via pull request or commit
-
ExploitDeveloper runs diff-so-fancy to review changes
-
ExecutionTerminal renders unsanitized OSC/CSI sequences
-
PersistClipboard overwritten with attacker-controlled payload
-
ImpactDeveloper pastes clipboard, executing injected command
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding for downstream
|
| Exploitation Conditions | The victim must be running diff-so-fancy to view output from |
| Impact | The CVSS 4.0 score of 4.8 (AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:L/SC:N/SI:L/SA:N) correctly reflects moderate risk with an important nuance: the local attack vector means the attacker must place malicious content into a repository the victim will review, not directly reach the victim's system over the network. The zero-privilege requirement (PR:N) refers to the victim's machine - any repository contributor (including external pull request authors) can serve as the threat actor. The user interaction requirement (UI:P) is the sole meaningful barrier. The most dangerous impact is clipboard injection (SI:L on subsequent system), since many terminal emulators support OSC 52-based clipboard writes that could stage arbitrary commands for silent execution. No KEV listing, no EPSS data, and no confirmed POC were provided - exploitation likelihood is speculative but technically trivial given that the technique is well-documented in terminal security research. This vulnerability is most relevant to open-source maintainers and security reviewers who regularly diff untrusted code contributions. |
| Exploit ScenarioDerived | An external contributor submits a pull request to an open-source project, embedding OSC 52 clipboard-write sequences within a filename or a strategically crafted line of source code. When a maintainer runs |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jul 29, 2026
Terminal control sequence injection in diff-so-fancy exposes developers to output manipulation, filename spoofing, terminal screen clearing, and clipboard hijacking when viewing diffs containing attacker-controlled content. The application filters only ANSI SGR sequences while passing OSC, CSI, carriage returns, and other VT100 control characters through unsanitized to the terminal, affecting all versions prior to commit 9c81294. No public exploit is identified at time of analysis, but the low attack complexity (CVSS 4.0 AV:L/AC:L) means the primary barrier is only the requirement for a developer to actively view the malicious diff.
RemediationAI
The upstream fix is available via commit 9c81294 in the diff-so-fancy GitHub repository (https://github.com/so-fancy/diff-so-fancy); however, no tagged release version has been confirmed from the available data, so users should update directly from the latest HEAD of the main branch or monitor the repository for a formal release. As a compensating control, developers can pipe diff-so-fancy output through a terminal sequence stripping tool such as ansi2txt or strip-ansi before display, though this will remove intended color formatting. Alternatively, switching to a diff viewer with comprehensive escape sequence sanitization (e.g., delta) removes the vulnerable component entirely. Developers reviewing untrusted contributions should be especially cautious and consider inspecting raw git diff output directly when evaluating external pull requests until an official patched release is available.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
diff-so-fancy (CPE: cpe:2.3:a:so-fancy:diff-so-fancy:*:*:*:*:*:*:*:*) is a Node.js-based git diff beautifier that post-processes output from git diff, applying color and formatting improvements. Its sanitization logic targets ANSI SGR (Select Graphic Rendition) sequences - the codes that set text color and style - but ignores the broader ANSI/VT100 escape sequence taxonomy. This includes OSC (Operating System Command, e.g., sequences used to set clipboard content on xterm-compatible terminals via OSC 52), CSI (Control Sequence Introducer, enabling cursor movement and screen clearing), and bare carriage returns (\r) that allow line overwriting. CWE-116 (Improper Encoding or Escaping of Output) precisely describes this root cause: the application performs output encoding for a subset of dangerous characters while leaving a larger attack surface unsanitized. Attack surface includes git-tracked filenames, commit metadata, and file contents - all of which appear in diff output.
Know when Diff So Fancy gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:L/SC:N/SI:L/SA:N
Local vector because attacker controls repository content, not network path; scope change because clipboard and terminal state are outside the application boundary.
Primary rating from Vendor (CERT-PL).
CVSS VectorVendor: CERT-PL
DescriptionCVE.org
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
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.
EUVD-2026-50278
GHSA-q6jf-93cp-9xwf
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB