Vulnerability · Published Apr 20, 2026 · Assigned by CERT-PL

CVE-2026-5958Race Condition in GNU Sed

Low 2.1

In plain English

A low-severity security flaw in Sed from GNU. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.1% (higher than 4% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 4.0)2.1Low
Exploit odds (30 days)0.1%top 96.5% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official 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.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:12sed4.9-1+deb12u1DEBIAN-CVE-2026-5958
Debian:13sed4.9-2+deb13u1DEBIAN-CVE-2026-5958
Debian:14sed4.9-3DEBIAN-CVE-2026-5958
Ubuntu:22.04:LTSsed4.8-1ubuntu2.1UBUNTU-CVE-2026-5958
Ubuntu:24.04:LTSsed4.9-2ubuntu0.24.04.1UBUNTU-CVE-2026-5958
Ubuntu:25.10sed4.9-2ubuntu0.25.10.1UBUNTU-CVE-2026-5958
Ubuntu:26.04:LTSsed4.9-2ubuntu1UBUNTU-CVE-2026-5958

Affected products (as reported)

VendorProductVersions
GNU Sed 4.1e – before 4.10

Weakness: CWE-367 · Vector: 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

References