CVE-2026-50642
published medium CVSS 4.0 · 4.8Terminal Escape Injection in diff‑so‑fancy
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| so-fancy | — | diff-so-fancy0 through 1.4.10 · Other versions: unaffected | Affected | Not stated | CERT-PL |
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
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 4.0
- Base score
- 4.8 / 10
- Severity
- medium
- Provider
- CERT-PL · cna
- Vector string
- 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
- Scenarios
- en: GENERAL
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| so-fancy | diff-so-fancy | 0 through 1.4.10 (affected · semver)Default: unaffected | CERT-PL · cna |
Weaknesses
1- CWE-116 CWE-116 Improper Encoding or Escaping of Output
References
2Provider assertions
2CERT-PL · cna
Terminal Escape Injection in diff‑so‑fancy
CISA-ADP · adp
CISA ADP Vulnrichment
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 5c7f11a15e5ace1ac3ecb7a39e492f3813bfe31c3820f623f1b5692c2da9a316
- Ingested
- 23 Sep 2026, 09:18:57 UTC
- Source record
- Official CVE record