Every CVE Search/ Get API key

CVE-2026-5958

Race Condition in GNU Sed

2.1 LowFix available

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.

Attack profile

How easy it is to exploit

Attack vector
Local
Complexity
Low
Privileges needed
None
User interaction
None

What an attacker can affect

Confidentiality
None
Integrity
Low
Availability
None

Exploit likelihood

0.14%Up 0.1 points since Apr 21, 2026
90%50%10%1%

What each source reports

CVE List Score used 2.1

Race Condition in GNU Sed

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.

Record
CVE-2026-5958
CVSS 4.0
2.1 LowCVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N
Weakness
CWE-367
Updated
2026-11-02
EUVDEUVD-2026-23834 2.1

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.

Record
EUVD-2026-23834
CVSS 4.0
2.1 LowCVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N
Updated
2026-11-02
GitHub AdvisoriesGHSA-9r7w-j29g-xqx8 2.1

When sed is invoked with both -i (in-place edit) and --follow-symlinks, the function...

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.

Record
GHSA-9r7w-j29g-xqx8
CVSS 4.0
2.1 LowCVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Weakness
CWE-367
Updated
2026-11-02
NVD 2.1

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.

Record
CVE-2026-5958
CVSS 4.0
2.1 LowCVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Weakness
CWE-367
Updated
2026-11-02
OSVDEBIAN-CVE-2026-5958 2.1

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.

Record
DEBIAN-CVE-2026-5958
CVSS 4.0
2.1 LowCVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Updated
2026-11-02
OSVJLSEC-2026-213 2.1

When sed is invoked with both -i (in-place edit) and --follow-symlinks, the function...

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.

Record
JLSEC-2026-213
CVSS 4.0
2.1 LowCVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Updated
2026-11-02
Show 20 moreShow less
OSVOESA-2026-2281 2.1

sed security update

Sed is a non-interactive command-line text editor. A stream editor is used to per-form basic text transformations on an input stream (a file or input from a pipeline).

Security Fix(es):

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.(CVE-2026-5958)

Record
OESA-2026-2281
CVSS 4.0
2.1 LowCVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Updated
2026-11-02
OSVOESA-2026-2282 2.1

sed security update

Sed is a non-interactive command-line text editor. A stream editor is used to per-form basic text transformations on an input stream (a file or input from a pipeline).

Security Fix(es):

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.(CVE-2026-5958)

Record
OESA-2026-2282
CVSS 4.0
2.1 LowCVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Updated
2026-11-02
OSVOESA-2026-2283 2.1

sed security update

Sed is a non-interactive command-line text editor. A stream editor is used to per-form basic text transformations on an input stream (a file or input from a pipeline).

Security Fix(es):

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.(CVE-2026-5958)

Record
OESA-2026-2283
CVSS 4.0
2.1 LowCVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Updated
2026-11-02
OSVOESA-2026-2284 2.1

sed security update

Sed is a non-interactive command-line text editor. A stream editor is used to per-form basic text transformations on an input stream (a file or input from a pipeline).

Security Fix(es):

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.(CVE-2026-5958)

Record
OESA-2026-2284
CVSS 4.0
2.1 LowCVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Updated
2026-11-02
OSVOESA-2026-2478 2.1

sed security update

Sed is a non-interactive command-line text editor. A stream editor is used to per-form basic text transformations on an input stream (a file or input from a pipeline).

Security Fix(es):

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.(CVE-2026-5958)

Record
OESA-2026-2478
CVSS 4.0
2.1 LowCVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Updated
2026-11-02
OSVRHSA-2026:10995 6.3

Red Hat Security Advisory: Red Hat Hardened Images RPMs bug fix and enhancement update

Record
RHSA-2026:10995
CVSS 3.1
6.3 MediumCVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:H
Updated
2026-11-02
OSVUBUNTU-CVE-2026-5958 2.1

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.

Record
UBUNTU-CVE-2026-5958
CVSS 4.0
2.1 LowCVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N
Updated
2026-11-02
OSVAZL-83102 No score

CVE-2026-5958 affecting package sed for versions less than 4.9-2

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.

Record
AZL-83102
Updated
2026-11-05
OSVMGASA-2026-0128 No score

Updated sed packages fix security vulnerability

Race Condition in GNU Sed. (CVE-2026-5958)

Record
MGASA-2026-0128
Updated
2026-11-02
OSVopenSUSE-SU-2026:10649-1 No score

sed-4.10-1.1 on GA media

These are all security issues fixed in the sed-4.10-1.1 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2026:10649-1
Updated
2026-11-02
OSVopenSUSE-SU-2026:21024-1 No score

Security update for sed

This update for sed fixes the following issue

  • CVE-2026-5958: a TOCTOU race can allow to read attacker-controlled content and write it to an unintended file (bsc#1262144).
Record
openSUSE-SU-2026:21024-1
Updated
2026-11-02
OSVSUSE-SU-2026:1659-1 No score

Security update for sed

This update for sed fixes the following issues:

  • CVE-2026-5958: TOCTOU race allows write of user-controlled content to unintended files and can lead to arbitrary file overwrite (bsc#1262144).
Record
SUSE-SU-2026:1659-1
Updated
2026-11-02
OSVSUSE-SU-2026:1699-1 No score

Security update for sed

This update for sed fixes the following issue:

  • CVE-2026-5958: a TOCTOU race can allow to read attacker-controlled content and write it to an unintended file (bsc#1262144).
Record
SUSE-SU-2026:1699-1
Updated
2026-11-02
OSVSUSE-SU-2026:1941-1 No score

Security update for sed

This update for sed fixes the following issue:

  • CVE-2026-5958: a TOCTOU race can allow to read attacker-controlled content and write it to an unintended file (bsc#1262144).
Record
SUSE-SU-2026:1941-1
Updated
2026-11-02
OSVSUSE-SU-2026:21413-1 No score

Security update for sed

This update for sed fixes the following issue:

  • CVE-2026-5958: TOCTOU race allows write of user-controlled content to unintended files and can lead to arbitrary file overwrite (bsc#1262144).
Record
SUSE-SU-2026:21413-1
Updated
2026-11-02
OSVSUSE-SU-2026:21448-1 No score

Security update for sed

This update for sed fixes the following issue:

  • CVE-2026-5958: TOCTOU race allows write of user-controlled content to unintended files and can lead to arbitrary file overwrite (bsc#1262144).
Record
SUSE-SU-2026:21448-1
Updated
2026-11-02
OSVSUSE-SU-2026:22256-1 No score

Security update for sed

This update for sed fixes the following issue

  • CVE-2026-5958: a TOCTOU race can allow to read attacker-controlled content and write it to an unintended file (bsc#1262144).
Record
SUSE-SU-2026:22256-1
Updated
2026-11-02
OSVSUSE-SU-2026:22325-1 No score

Security update for sed

This update for sed fixes the following issue

  • CVE-2026-5958: a TOCTOU race can allow to read attacker-controlled content and write it to an unintended file (bsc#1262144).
Record
SUSE-SU-2026:22325-1
Updated
2026-11-02
OSVUSN-8229-1 No score

sed vulnerability

Michał Majchrowicz and Marcin Wyczechowski discovered that sed incorrectly handled symbolic links when performing in-place edits. A local attacker could possibly use this issue to overwrite arbitrary files.

Record
USN-8229-1
Updated
2026-11-02
OSVUSN-8229-2 No score

sed vulnerability

USN-8229-1 fixed a vulnerability in sed. This update provides the corresponding update for Ubuntu 18.04 LTS and Ubuntu 20.04 LTS.

Original advisory details:

Michał Majchrowicz and Marcin Wyczechowski discovered that sed incorrectly handled symbolic links when performing in-place edits. A local attacker could possibly use this issue to overwrite arbitrary files.

Record
USN-8229-2
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
sed
Azure Linux:3
before 4.9-2
4.9-2
sed
Debian:12
before 4.9-1+deb12u1, plus listed versions
4.9-1
4.9-1+deb12u1
sed
Debian:13
before 4.9-2+deb13u1, plus listed versions
4.9-2
4.9-2+deb13u1
sed
Debian:14
before 4.9-3, plus listed versions
4.9-2
4.9-3
sed_jll
Julia
before 4.10.0+0
4.10.0+0
sed
Mageia:9
before 4.9-1.1.mga9
4.9-1.1.mga9
sed
openEuler:24.03-LTS-SP3
before 4.9-5.oe2403sp3
4.9-5.oe2403sp3
sed
openEuler:22.03-LTS-SP4
before 4.8-8.oe2203sp4
4.8-8.oe2203sp4
sed
openEuler:24.03-LTS
before 4.9-5.oe2403
4.9-5.oe2403
sed
openEuler:24.03-LTS-SP1
before 4.9-5.oe2403sp1
4.9-5.oe2403sp1
Show 13 moreShow less
Affected packages
PackageAffectedFixed
sed
openEuler:20.03-LTS-SP4
before 4.8-8.oe2003sp4
4.8-8.oe2003sp4
sed
Red Hat:hummingbird:1
before 0:4.10-1.hum1
0:4.10-1.hum1
sed
SUSE:Linux Micro 6.2
before 4.9-160000.3.1
4.9-160000.3.1
sed
SUSE:Linux Enterprise Server 16.0
before 4.9-160000.3.1
4.9-160000.3.1
sed
SUSE:Linux Enterprise Server for SAP applications 16.0
before 4.9-160000.3.1
4.9-160000.3.1
sed
Ubuntu:Pro:18.04:LTS
before 4.4-2ubuntu0.1~esm1, plus listed versions
4.4-14.4-2
4.4-2ubuntu0.1~esm1
sed
Ubuntu:Pro:20.04:LTS
before 4.7-1ubuntu0.1~esm1, plus listed versions
4.7-1
4.7-1ubuntu0.1~esm1
sed
Ubuntu:22.04:LTS
before 4.8-1ubuntu2.1, plus listed versions
4.7-1ubuntu14.7-1ubuntu24.8-1ubuntu14.8-1ubuntu2
4.8-1ubuntu2.1
sed
Ubuntu:24.04:LTS
before 4.9-2ubuntu0.24.04.1, plus listed versions
4.9-14.9-24.9-2build1
4.9-2ubuntu0.24.04.1
sed
Ubuntu:25.10
before 4.9-2ubuntu0.25.10.1, plus listed versions
4.9-2build14.9-2build2
4.9-2ubuntu0.25.10.1
sed
Ubuntu:26.04:LTS
before 4.9-2ubuntu1, plus listed versions
4.9-2build24.9-2build3
4.9-2ubuntu1
sed
openSUSE:Tumbleweed
before 4.10-1.1
4.10-1.1
sed
openSUSE:Leap 16.0
before 4.9-160000.3.1
4.9-160000.3.1

History

History
RecordedChangedSources
factsOSV
first indexedCVE List, EUVD, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2026-5958 is a low vulnerability (CVSS 2.1) in Gnu Sed, published April 19, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.14%, the 3rd percentile. Fixed in sed 4.9-2.

References

Show 27 moreShow less
MoveEnter Open