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 products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| GNU | Sed | 4.1e – < 4.10 | 4.10 |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | sed | 4.9-3 | — |
| Debian 13 | sed | 4.9-2+deb13u1 | — |
| Debian 12 | sed | 4.9-1+deb12u1 | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 26.04 LTS | sed | 4.9-2ubuntu1 | — |
| Ubuntu 25.10 | sed | 4.9-2ubuntu0.25.10.1 | — |
| Ubuntu 24.04 LTS | sed | 4.9-2ubuntu0.24.04.1 | — |
| Ubuntu 22.04 LTS | sed | 4.8-1ubuntu2.1 | — |
Show 2 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu Pro 20.04 LTS | sed | 4.7-1ubuntu0.1~esm1 | USN-8229-2 |
| Ubuntu Pro 18.04 LTS | sed | 4.4-2ubuntu0.1~esm1 | USN-8229-2 |
Red Hat
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Red Hat Hardened Images 1 | sed | 4.10-1.hum1 | RHSA-2026:10995 |
SUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES for SAP 16.0 | sed | 4.9-160000.3.1 | SUSE-SU-2026:22325-1 |
| SLES 16.0 | sed | 4.9-160000.3.1 | SUSE-SU-2026:22325-1 |
| SLE Micro 6.2 | sed | 4.9-160000.3.1 | SUSE-SU-2026:22256-1 |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Tumbleweed | sed | 4.10-1.1 | openSUSE-SU-2026:10649-1 |
| openSUSE Leap 16.0 | sed | 4.9-160000.3.1 | openSUSE-SU-2026:21024-1 |
Azure Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Azure Linux 3 | sed | 4.9-2 | — |
Advisories 6
- RHSA-2026:10995 Red Hat Security Advisory: Red Hat Hardened Images RPMs bug fix and enhancement update Red Hat Security Advisories (RHSA) · Sep 6, 2026
- SUSE-SU-2026:22325-1 Security update for sed SUSE / openSUSE Security Updates · Jul 2, 2026
- openSUSE-SU-2026:21024-1 Security update for sed SUSE / openSUSE Security Updates · Jun 30, 2026
- SUSE-SU-2026:22256-1 Security update for sed SUSE / openSUSE Security Updates · Jun 30, 2026
- USN-8229-2 sed vulnerability Ubuntu Security Notices (USN) · May 29, 2026
- openSUSE-SU-2026:10649-1 sed-4.10-1.1 on GA media SUSE / openSUSE Security Updates · Apr 29, 2026
References
- https://www.gnu.org/software/sed/ product
- https://cert.pl/en/posts/2026/04/CVE-2026-5958 third-party-advisory