CVE-2026-5958: GNU Sed · Time-of-check Time-of-use (TOCTOU) Race Condition
Affects GNU SedSource CVE Database V5
Not known to be exploited · CVSS 2.1 Low : upgrade to 4.10 when convenient.
Data as of 29 Oct 2026, 19:04 UTC
- EPSS
- 0.1% chance of exploitation in 30 days – higher than 3% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
- Patch
- Available – fixed in 4.10
CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:NExploitation evidence
Disclosed: evidence found.
CVE published 20 Apr 2026
Detectable: no evidence on record.
No public nuclei template indexed
Weaponized: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 29 Oct 2026.
What to do
Upgrade GNU Sed to 4.10.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| GNUSed | Affected
| Fixed in
|
Gnugnu/sedpkg:deb/gnu/sedOther threats | Affected
| Fixed in– |
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
This vulnerability is fixed in GNU Sed version 4.10. Users should upgrade to version 4.10 or later to remediate this issue. Until upgrading, avoid using sed with both -i and --follow-symlinks options on untrusted symlinks to reduce risk. Patch status is not explicitly confirmed beyond the fixed version; check the vendor advisory for the latest remediation guidance.
Description
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.