CVE-2026-50642

Source
https://cve.org/CVERecord?id=CVE-2026-50642
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-50642.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2026-50642
Published
2026-07-29T09:46:07.962Z
Modified
2026-07-30T04:03:24.527918816Z
Severity
  • 4.8 (Medium) CVSS_V4 - 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 CVSS Calculator
Summary
Terminal Escape Injection in diff‑so‑fancy
Details

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

Database specific
{
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/50xxx/CVE-2026-50642.json",
    "cna_assigner": "CERT-PL",
    "cwe_ids": [
        "CWE-116"
    ]
}
References

Affected packages

Git / github.com/so-fancy/diff-so-fancy

Affected ranges

Type
GIT
Repo
https://github.com/so-fancy/diff-so-fancy
Events
Introduced
0 Unknown introduced commit / All previous commits are affected
Last affected
Database specific
{
    "extracted_events": [
        {
            "introduced": "0"
        },
        {
            "last_affected": "1.4.10"
        }
    ],
    "source": "AFFECTED_FIELD"
}

Affected versions

v0.*
v0.1.0
v0.1.1
v0.1.2
v0.10.0
v0.10.1
v0.11.0
v0.11.1
v0.11.2
v0.11.3
v0.11.4
v0.2.0
v0.2.1
v0.3.0
v0.4.0
v0.4.1
v0.5.0
v0.5.1
v0.5.2
v0.6.0
v0.6.1
v0.6.2
v0.6.3
v0.7.0
v0.7.1
v0.8.0
v0.9.0
v0.9.1
v0.9.2
v0.9.3
v1.*
v1.0.0
v1.1.0
v1.2.1-beta
v1.2.5
v1.2.6
v1.3.0
v1.4.0
v1.4.10
v1.4.2
v1.4.6
v1.4.8

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-50642.json"