CVE & CISA-KEV Catalog

CVE-2026-5958

UNSCORED

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.

How to fix

Remediation Available
sedDebian
Fixed in:4.9-1+deb12u1CVE-2026-5958
Fixed in:4.9-2+deb13u1CVE-2026-5958
Fixed in:4.9-3CVE-2026-5958
sedUbuntu
Fixed in:4.4-2ubuntu0.1~esm1USN-8229-2
Fixed in:4.7-1ubuntu0.1~esm1USN-8229-2
Fixed in:4.8-1ubuntu2.1USN-8229-1
Fixed in:4.9-2ubuntu0.24.04.1USN-8229-1
Fixed in:4.9-2ubuntu0.25.10.1USN-8229-1

Remediation is compiled from vendor and distribution security advisories. Always confirm against the linked source for your exact version and platform.

CVSS v3.1 Vector

No CVSS vector data available.

Exploit Intelligence

0.14%probability of exploitation in 30 days
4thpercentile

Low risk: more likely to be exploited than 4% of all known CVEs.

References

Related Vulnerabilities

Other CWE-367 (TOCTOU Race Condition) vulnerabilities, ordered by exploit likelihood. View all

CVESeverityCVSSEPSSExploitedFix
CVE-2022-36980High8.183%-Fix
CVE-2024-30088High7.068%KEV + RansomFix
CVE-2004-0594Medium5.155%-Fix
CVE-2024-50379Critical9.844%-Fix
CVE-2023-38146High8.839%-Fix
CVE-2024-0132Critical9.037%-Fix
Embed a live status badge for CVE-2026-5958
CVE-2026-5958 severity badge

Markdown

[![CVE-2026-5958](https://tridentstack.com/cve/badge/CVE-2026-5958.svg)](https://tridentstack.com/cve/CVE-2026-5958)

HTML

<a href="https://tridentstack.com/cve/CVE-2026-5958"><img src="https://tridentstack.com/cve/badge/CVE-2026-5958.svg" alt="CVE-2026-5958"></a>

Find and fix vulnerabilities across your fleet

TridentStack Control continuously scans your Windows, macOS, and Linux fleet for known vulnerabilities, prioritizes them by severity and active exploitation, and patches them automatically.

Start free

This product uses NVD data but is not endorsed or certified by the NVD. EPSS scores courtesy of FIRST.org (https://www.first.org/epss). Source: CISA KEV Catalog. Data as of 2026-05-19.