Bug 2508640

Summary: CVE-2026-50642 diff-so-fancy: diff-so-fancy: Terminal escape injection allows command execution [fedora-all]
Product: [Fedora] Fedora Reporter: Thibault Guittet <tguittet>
Component: diff-so-fancyAssignee: Arthur Bols <arthur>
Status: NEW --- QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 45CC: arthur
Target Milestone: ---Keywords: Security, SecurityTracking
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: {"flaws": ["537a8a1d-ad25-43ea-bf78-661b145081c2"]}
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2508367    

Description Thibault Guittet 2026-07-29 20:15:00 UTC
Disclaimer: Community trackers are created by Red Hat Product Security team on a best effort basis. Package maintainers are required to ascertain if the flaw indeed affects their package, before starting the update process.

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

Comment 1 Aoife Moloney 2026-08-17 15:40:55 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 45 development cycle.
Changing version to 45.