Time-of-check Time-of-use (TOCTOU) Affecting rhcos package, versions *


Severity

Recommended
0.0
medium
0
10

Based on Red Hat Enterprise Linux security rating.

Threat Intelligence

EPSS
0.14% (4th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-RHEL8-RHCOS-17082591
  • published29 May 2026
  • disclosed19 Apr 2026

Introduced: 19 Apr 2026

CVE-2026-5958  (opens in a new tab)
CWE-367  (opens in a new tab)

How to fix?

There is no fixed version for RHEL:8 rhcos.

NVD Description

Note: Versions mentioned in the description apply only to the upstream rhcos package and not the rhcos package as distributed by RHEL. See How to fix? for RHEL:8 relevant fixed versions and status.

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.

CVSS Base Scores

version 3.1