CVE-2026-5958
UNSCOREDDescription
When sed is invoked with both -i (in-place edit) and --follow-symlinks, the function open_next_file() performs two separate, non-atomic filesystem operations on the same path: 1. resolves symlink to its target and stores the resolved path for determining when output is written, 2. opens the original symlink path (not the resolved one) to read the file. Between these two calls there is a race window. If an attacker atomically replaces the symlink with a different target during that window, sed will: read content from the new (attacker-chosen) symlink target and write the processed result to the path recorded in step 1. This can lead to arbitrary file overwrite with attacker-controlled content in the context of the sed process. This issue was fixed in version 4.10.
How to fix
Remediation is compiled from vendor and distribution security advisories. Always confirm against the linked source for your exact version and platform.
CVSS v3.1 Vector
No CVSS vector data available.
Exploit Intelligence
Low risk: more likely to be exploited than 4% of all known CVEs.
References
Related Vulnerabilities
Other CWE-367 (TOCTOU Race Condition) vulnerabilities, ordered by exploit likelihood. View all
| CVE | Severity | CVSS | EPSS | Exploited | Fix |
|---|---|---|---|---|---|
| CVE-2022-36980 | High | 8.1 | 83% | - | Fix |
| CVE-2024-30088 | High | 7.0 | 68% | KEV + Ransom | Fix |
| CVE-2004-0594 | Medium | 5.1 | 55% | - | Fix |
| CVE-2024-50379 | Critical | 9.8 | 44% | - | Fix |
| CVE-2023-38146 | High | 8.8 | 39% | - | Fix |
| CVE-2024-0132 | Critical | 9.0 | 37% | - | Fix |
Embed a live status badge for CVE-2026-5958
Markdown
[](https://tridentstack.com/cve/CVE-2026-5958)HTML
<a href="https://tridentstack.com/cve/CVE-2026-5958"><img src="https://tridentstack.com/cve/badge/CVE-2026-5958.svg" alt="CVE-2026-5958"></a>Find and fix vulnerabilities across your fleet
TridentStack Control continuously scans your Windows, macOS, and Linux fleet for known vulnerabilities, prioritizes them by severity and active exploitation, and patches them automatically.
Start freeThis product uses NVD data but is not endorsed or certified by the NVD. EPSS scores courtesy of FIRST.org (https://www.first.org/epss). Source: CISA KEV Catalog. Data as of 2026-05-19.