Skip to main content

diff-so-fancy EUVDEUVD-2026-50278

| CVE-2026-50642 MEDIUM
Improper Encoding or Escaping of Output (CWE-116)
2026-07-29 CERT-PL GHSA-q6jf-93cp-9xwf
4.8
CVSS 4.0 · Vendor: CERT-PL
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Attacker crafts malicious escape sequences in repo content
  2. Delivery
    Content submitted via pull request or commit
  3. Exploit
    Developer runs diff-so-fancy to review changes
  4. Execution
    Terminal renders unsanitized OSC/CSI sequences
  5. Persist
    Clipboard overwritten with attacker-controlled payload
  6. Impact
    Developer 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 git diff or a compatible diff tool on a terminal emulator that processes ANSI/VT100 escape sequences (virtually all modern terminals including xterm, iTerm2, GNOME Terminal, and Windows Terminal). The attacker must control content that appears in the diff - this can be a filename, file content, or diff metadata within any repository the victim reviews, including public pull requests. Clipboard injection specifically requires a terminal emulator with OSC 52 support enabled (on by default in many emulators). Exploitation is limited to contexts where a human developer actively views a diff; automated CI pipelines that do not render terminal output to an interactive terminal are not affected. No authentication to the victim's system is required, but the attacker must have write or PR access to a repository the victim reviews.

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 git diff piped through diff-so-fancy to review the PR, the escape sequences render in the terminal, silently overwriting the clipboard with a malicious shell command. If the maintainer subsequently pastes from the clipboard - a natural developer action - the injected command executes. No confirmed POC exists, but this technique maps directly to publicly documented terminal clipboard injection research.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
No patch listed yet 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

diff-so-fancy 0 ≤1.4.10

Affected Packages

euvd diff_so_fancy no fix

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

Vendor (CERT-PL) PRIMARY 4.8 MEDIUM
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
vuln.today AI 5.0 MEDIUM

Local vector because attacker controls repository content, not network path; scope change because clipboard and terminal state are outside the application boundary.

3.1 AV:L/AC:L/PR:N/UI:R/S:C/C:N/I:L/A:L
4.0 AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:L/SC:N/SI:L/SA:N
SUSE MEDIUM
Red Hat 4.4 MEDIUM

Primary rating from Vendor (CERT-PL).

CVSS VectorVendor: CERT-PL

Attack Vector
Local
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
Passive
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
Low
Subsequent system: Confidentiality
None
Subsequent system: Integrity
Low
Subsequent system: Availability
None

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

EPSS Score
0.3%
Top 78% exploitable
Prevalence
Medium
popular git diff enhancer widely used among developers, not enterprise-universal
Social Media
1
Sightings
Data Quality
9 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment Vendor CIRCL GitHub VulDB

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.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.3%
Patch available No
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Defer
Exploitation
None
System Exposure· derived
Small
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

24
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +24
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Code Injection CRITICAL

Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.

Vendor StatusVendor

SUSE

Severity: Moderate

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy