CVE-2026-5958
Publication date 19 April 2026
Last updated 14 May 2026
Ubuntu priority
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.
Status
| Package | Ubuntu Release | Status |
|---|---|---|
| sed | 26.04 LTS resolute |
Fixed 4.9-2ubuntu1
|
| 25.10 questing |
Fixed 4.9-2ubuntu0.25.10.1
|
|
| 24.04 LTS noble |
Fixed 4.9-2ubuntu0.24.04.1
|
|
| 22.04 LTS jammy |
Fixed 4.8-1ubuntu2.1
|
|
| 20.04 LTS focal |
Needs evaluation
|
|
| 18.04 LTS bionic |
Needs evaluation
|
|
| 16.04 LTS xenial |
Needs evaluation
|
|
| 14.04 LTS trusty |
Needs evaluation
|
References
Related Ubuntu Security Notices (USN)
- USN-8229-1
- sed vulnerability
- 4 May 2026