Skip to main content
CVE-2026-5958VulnerabilityPublished Updated

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

Affects sedSource GCVE Database

0
Compare
Authoritative record:CVE-2026-5958· Low 2.1

Not known to be exploited · CVSS 2.1 Low · fixed in 4.4-2ubuntu0.1~esm1 : update sed when convenient.

Data as of 24 Nov 2026, 21:16 UTC

CVSS 4.0 base score
2.1Low
How severe the flaw is on the 0–10 CVSS scale.
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.4-2ubuntu0.1~esm1, 4.7-1ubuntu0.1~esm1, 4.8-1ubuntu2.1 +3
CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N

Exploitation evidence

  1. Disclosed: evidence found.

    CVE published 20 Apr 2026

  2. Detectable: no evidence on record.

    No public nuclei template indexed

  3. Weaponized: no evidence on record.

    No public exploit code indexed in Metasploit or Exploit-DB

  4. Exploited in the wild: no evidence on record.

    Not in CISA KEV and no source reports exploitation

  5. Observed by OffSeq 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 24 Nov 2026.

What to do

Upgrade to a fixed release listed under Affected software.

Affected software

ProductAffectedFixed in
Ubuntu 26.04 LTSsedpkg:deb/ubuntu/sed?arch=source&distro=resoluteOther threatsAffected
  • <4.9-2ubuntu1
Fixed in
  • 4.9-2ubuntu1
Ubuntu 25.10sedpkg:deb/ubuntu/sed?arch=source&distro=questingOther threatsAffected
  • <4.9-2ubuntu0.25.10.1
Fixed in
  • 4.9-2ubuntu0.25.10.1
Ubuntu 24.04 LTSsedpkg:deb/ubuntu/sed?arch=source&distro=nobleOther threatsAffected
  • <4.9-2ubuntu0.24.04.1
Fixed in
  • 4.9-2ubuntu0.24.04.1
Ubuntu 22.04 LTSsedpkg:deb/ubuntu/sed?arch=source&distro=jammyOther threatsAffected
  • <4.8-1ubuntu2.1
Fixed in
  • 4.8-1ubuntu2.1
Ubuntu Pro 20.04 LTSsedpkg:deb/ubuntu/sed?arch=source&distro=esm-infra/focalOther threatsAffected
  • <4.7-1ubuntu0.1~esm1
Fixed in
  • 4.7-1ubuntu0.1~esm1
Ubuntu Pro 18.04 LTSsedpkg:deb/ubuntu/sed?arch=source&distro=esm-infra/bionicOther threatsAffected
  • <4.4-2ubuntu0.1~esm1
Fixed in
  • 4.4-2ubuntu0.1~esm1

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

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.

References

Community reviews

Loading reviews…