UBUNTU-CVE-2026-5958

Source
https://ubuntu.com/security/CVE-2026-5958
Import Source
https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-5958.json
JSON Data
https://api.osv.dev/v1/vulns/UBUNTU-CVE-2026-5958
Upstream
  • CVE-2026-5958
Downstream
Related
Published
2026-04-19T00:00:00Z
Modified
2026-05-29T10:59:18.893969563Z
Severity
  • 2.1 (Low) CVSS_V4 - 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 CVSS Calculator
  • Ubuntu - medium
Summary
[none]
Details

When sed is invoked with both -i (in-place edit) and --follow-symlinks, the function opennextfile() 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

Affected packages

Ubuntu:22.04:LTS
sed

Package

Name
sed
Purl
pkg:deb/ubuntu/sed?arch=source&distro=jammy

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
4.8-1ubuntu2.1

Affected versions

4.*
4.7-1ubuntu1
4.7-1ubuntu2
4.8-1ubuntu1
4.8-1ubuntu2

Ecosystem specific

{
    "binaries": [
        {
            "binary_version": "4.8-1ubuntu2.1",
            "binary_name": "sed"
        }
    ],
    "availability": "No subscription required"
}

Database specific

source
"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-5958.json"
Ubuntu:24.04:LTS
sed

Package

Name
sed
Purl
pkg:deb/ubuntu/sed?arch=source&distro=noble

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
4.9-2ubuntu0.24.04.1

Affected versions

4.*
4.9-1
4.9-2
4.9-2build1

Ecosystem specific

{
    "binaries": [
        {
            "binary_version": "4.9-2ubuntu0.24.04.1",
            "binary_name": "sed"
        }
    ],
    "availability": "No subscription required"
}

Database specific

source
"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-5958.json"
Ubuntu:25.10
sed

Package

Name
sed
Purl
pkg:deb/ubuntu/sed?arch=source&distro=questing

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
4.9-2ubuntu0.25.10.1

Affected versions

4.*
4.9-2build1
4.9-2build2

Ecosystem specific

{
    "availability": "No subscription required",
    "binaries": [
        {
            "binary_version": "4.9-2ubuntu0.25.10.1",
            "binary_name": "sed"
        }
    ]
}

Database specific

source
"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-5958.json"
Ubuntu:26.04:LTS
sed

Package

Name
sed
Purl
pkg:deb/ubuntu/sed?arch=source&distro=resolute

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
4.9-2ubuntu1

Affected versions

4.*
4.9-2build2
4.9-2build3

Ecosystem specific

{
    "binaries": [
        {
            "binary_version": "4.9-2ubuntu1",
            "binary_name": "sed"
        }
    ],
    "availability": "No subscription required"
}

Database specific

source
"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-5958.json"
Ubuntu:Pro:18.04:LTS
sed

Package

Name
sed
Purl
pkg:deb/ubuntu/sed?arch=source&distro=esm-infra%2Fbionic

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
4.4-2ubuntu0.1~esm1

Affected versions

4.*
4.4-1
4.4-2

Ecosystem specific

{
    "binaries": [
        {
            "binary_version": "4.4-2ubuntu0.1~esm1",
            "binary_name": "sed"
        }
    ],
    "availability": "Available with Ubuntu Pro (Infra-only): https://ubuntu.com/pro"
}

Database specific

source
"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-5958.json"
Ubuntu:Pro:20.04:LTS
sed

Package

Name
sed
Purl
pkg:deb/ubuntu/sed?arch=source&distro=esm-infra%2Ffocal

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
4.7-1ubuntu0.1~esm1

Affected versions

4.*
4.7-1

Ecosystem specific

{
    "availability": "Available with Ubuntu Pro (Infra-only): https://ubuntu.com/pro",
    "binaries": [
        {
            "binary_version": "4.7-1ubuntu0.1~esm1",
            "binary_name": "sed"
        }
    ]
}

Database specific

source
"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-5958.json"