Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2026-50642: CWE-116 Improper Encoding or Escaping of Output in so-fancy diff-so-fancy

0
Medium
VulnerabilityCVE-2026-50642cvecve-2026-50642cwe-116
Published: 07/29/2026 (07/29/2026, 09:46:07 UTC)
Source: CVE Database V5
Vendor/Project: so-fancy
Product: diff-so-fancy

Description

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

CVSS v4.0

Score 4.8medium

Attack Vector
Local
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
Passive
Vuln. Confidentiality
None
Vuln. Integrity
None
Vuln. Availability
Low
Subsq. Confidentiality
None
Subsq. Integrity
Low
Subsq. Availability
None
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

Affected software

GitHub Actionsmore threats →cve
diff-so-fancy
pkg:github/diff-so-fancy
Affected versions
<=1.4.10

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 07/29/2026, 10:39:24 UTC

Technical Analysis

The vulnerability in diff-so-fancy (CVE-2026-50642) involves improper encoding or escaping of output (CWE-116). The application strips only ANSI SGR sequences but allows other terminal control sequences, including carriage return and escape sequences (OSC, CSI), to pass unsanitized. Attackers can embed these sequences in filenames, diff metadata, or file content, which are then rendered in the terminal, enabling manipulation of terminal output and clipboard injection. This can mislead users during code review or alter terminal state. The vulnerability affects versions up to and including 1.4.10 and has been fixed in a subsequent commit (9c81294).

Potential Impact

An attacker can manipulate terminal output by injecting malicious control sequences, potentially causing filename spoofing, terminal screen clearing, and clipboard hijacking. This may mislead users during code review or cause unintended command execution via clipboard injection. The CVSS score is 4.8 (medium severity), indicating a limited attack vector (local), low complexity, no privileges required, but user interaction is needed.

Mitigation Recommendations

A fix is available and has been implemented in the commit 9c81294. Users should upgrade diff-so-fancy to a version that includes this fix, i.e., any version later than 1.4.10. There is no indication that temporary mitigations or workarounds are provided; upgrading is the recommended remediation.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
CERT-PL
Date Reserved
2026-06-05T13:27:10.270Z
Cvss Version
4.0
State
PUBLISHED
Remediation Level
null

Threat ID: 6a69d4879c2644c7f856ba7a

Added to database: 07/29/2026, 10:23:03 UTC

Last enriched: 07/29/2026, 10:39:24 UTC

Last updated: 07/29/2026, 21:33:00 UTC

Views: 5

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses