Zero Day MonitorZDM
DashboardVulnerabilitiesTrendingZero-DaysNewsAbout
Login
ImpressumPrivacy Policy
Zero Day Monitor © 2026
3190 articles · 163270 vulns · 38/41 feeds (7d)
← Back to list
—
CVE-2026-5958PATCHED
gnu · sed

Race Condition in GNU Sed

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

VendorProductVersions
gnused4.1e

References

  • https://www.gnu.org/software/sed/(product)
  • https://cert.pl/en/posts/2026/04/CVE-2026-5958(third-party-advisory)

Related News (4 articles)

Tier C
oss-security34d ago
CVE-2026-5958: GNU sed: TOCTOU race in sed -i --follow-symlinks
→ No new info (linked only)
Tier B
CERT-FR53d ago
Vulnérabilité dans les produits Microsoft (24 avril 2026)
→ No new info (linked only)
Tier A
Microsoft MSRC55d ago
CVE-2026-5958 Race Condition in GNU Sed
→ No new info (linked only)
Tier C
VulDB56d ago
CVE-2026-5958 | GNU sed up to 4.9 open_next_file toctou
→ No new info (linked only)
CISA KEV❌ No
Actively exploited❌ No
Patch available
4.10
CWECWE-367
PublishedApr 20, 2026
Last enriched56d agov2
Trending Score1
Source articles4
Independent4
Info Completeness8/14
Missing: cvss, epss, kev, exploit, iocs, mitre_attack

Community Vote

0
Login to vote
0 upvotes0 downvotes
No votes yet

Related CVEs (5)

MEDIUMPRE-CVE
GNU gsasl Heap Disclosure in NTLM Client Step
Trending: 23
CRITICALCVE-2026-5450
scanf %mc off-by-one heap buffer overflow
Trending: 11
HIGHCVE-2026-48829
CVE-2026-48829: In GNU SASL before 2.2.3, DIGEST-MD5 has a NULL pointer dereference affecting both clients and servers, via a known toke
Trending: 3
NONECVE-2026-6846
Binutils: binutils: arbitrary code execution via malformed xcoff object file processing
Trending: 2
HIGHCVE-2026-40556
Insecure Directory Permissions in GNU nano Leading to Privilege Abuse

Pin to Dashboard

Verification

State: unverified
Confidence: 0%

Vulnerability Timeline

CVE Published
Apr 20, 2026
Discovered by ZDM
Apr 20, 2026
Updated: affectedVersions, severity
Apr 20, 2026
Patch Available
May 13, 2026

Version History

v2
Last enriched 56d ago
v2Tier C56d ago

Added affected version 4.9, updated severity to HIGH, and noted that no exploit is available.

affectedVersionsseverity
via VulDB
v156d ago

Initial creation