Skip to content

CVE-2026-5958 Race Condition in GNU Sed

LowCVSS 2.1 EPSS 0.15%
Published
Updated
Exploit status
No public exploit known
CISA SSVC
No known exploitation · automatable: no · technical impact: partial
Technology
UbuntuDebianRed Hat

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.

Upgrade path

18 packages: 9 fixed, 9 with no fix yet.

PackageAffectedFixed inStatus
cbl-mariner sed(CBL-Mariner 2.0) All versions No fix listed No fix yet
Microsoft cbl2 sed 4.8-3 All versions No fix listed No fix yet
redhat/openshift/ose-rhel-coreos-8(Red Hat openshift 4) All versions No fix listed No fix yet
redhat/openshift/ose-rhel-coreos-9(Red Hat openshift 4) All versions No fix listed No fix yet
redhat/sed(Red Hat enterprise_linux 10) All versions No fix listed No fix yet
redhat/sed(Red Hat enterprise_linux 8) All versions No fix listed No fix yet
redhat/sed(Red Hat enterprise_linux 9) All versions No fix listed No fix yet
redhat/sed(Red Hat rhel_els 6) All versions No fix listed No fix yet
redhat/sed(Red Hat rhel_els 7) All versions No fix listed No fix yet
azure linux sed(Azure Linux 3.0) < 4.9-2 4.9-2 Fixed
debian/sed(Debian 12) < 4.9-1+deb12u1; = 4.9-1 4.9-1+deb12u1 Fixed
debian/sed(Debian 13) < 4.9-2+deb13u1; = 4.9-2 4.9-2+deb13u1 Fixed
debian/sed(Debian 14) < 4.9-3; = 4.9-2 4.9-3 Fixed
GNU Sed >= 4.1e, < 4.10 4.10 Fixed
redhat/sed-main(Red Hat hummingbird 1) < 4.10-1.hum1 4.10-1.hum1 Fixed
ubuntu/sed(Ubuntu 22.04) < 4.8-1ubuntu2.1 4.8-1ubuntu2.1 Fixed
ubuntu/sed(Ubuntu 24.04) < 4.9-2ubuntu0.24.04.1 4.9-2ubuntu0.24.04.1 Fixed
ubuntu/sed(Ubuntu 26.04) < 4.9-2ubuntu1 4.9-2ubuntu1 Fixed

Affected products

ProductAffected versionsFixed in
cbl-mariner sed(CBL-Mariner:2.0) All versions No fix listed
azure linux sed(Azure Linux:3.0) < 4.9-2 4.9-2
Microsoft cbl2 sed 4.8-3 All versions No fix listed
GNU Sed >= 4.1e, < 4.10 4.10
debian/sed(Debian:12) < 4.9-1+deb12u1 4.9-1+deb12u1
debian/sed(Debian:12) = 4.9-1 No fix listed
debian/sed(Debian:13) < 4.9-2+deb13u1 4.9-2+deb13u1
debian/sed(Debian:13) = 4.9-2 No fix listed
debian/sed(Debian:14) < 4.9-3 4.9-3
debian/sed(Debian:14) = 4.9-2 No fix listed
redhat/sed-main(Red Hat:hummingbird:1) < 4.10-1.hum1 4.10-1.hum1
redhat/sed(Red Hat:enterprise_linux:10) All versions No fix listed
redhat/sed(Red Hat:rhel_els:6) All versions No fix listed
redhat/sed(Red Hat:rhel_els:7) All versions No fix listed
redhat/sed(Red Hat:enterprise_linux:8) All versions No fix listed
redhat/sed(Red Hat:enterprise_linux:9) All versions No fix listed
redhat/rhoai/odh-core-bff-rhel9(Red Hat:openshift_ai) All versions No fix listed
redhat/rhoai/odh-dashboard-rhel9(Red Hat:openshift_ai) All versions No fix listed
redhat/rhoai/odh-kf-notebook-controller-rhel9(Red Hat:openshift_ai) All versions No fix listed
redhat/rhoai/odh-mod-arch-agent-ops-rhel9(Red Hat:openshift_ai) All versions No fix listed
redhat/rhoai/odh-mod-arch-automl-rhel9(Red Hat:openshift_ai) All versions No fix listed
redhat/rhoai/odh-mod-arch-autorag-rhel9(Red Hat:openshift_ai) All versions No fix listed
redhat/rhoai/odh-mod-arch-eval-hub-rhel9(Red Hat:openshift_ai) All versions No fix listed
redhat/rhoai/odh-mod-arch-gen-ai-rhel9(Red Hat:openshift_ai) All versions No fix listed
redhat/rhoai/odh-mod-arch-maas-rhel9(Red Hat:openshift_ai) All versions No fix listed
Show 8 more
ProductAffected versionsFixed in
redhat/rhoai/odh-mod-arch-mlflow-rhel9(Red Hat:openshift_ai) All versions No fix listed
redhat/rhoai/odh-mod-arch-model-registry-rhel9(Red Hat:openshift_ai) All versions No fix listed
redhat/rhoai/odh-notebook-controller-rhel9(Red Hat:openshift_ai) All versions No fix listed
redhat/openshift/ose-rhel-coreos-8(Red Hat:openshift:4) All versions No fix listed
redhat/openshift/ose-rhel-coreos-9(Red Hat:openshift:4) All versions No fix listed
ubuntu/sed(Ubuntu:22.04) < 4.8-1ubuntu2.1 4.8-1ubuntu2.1
ubuntu/sed(Ubuntu:24.04) < 4.9-2ubuntu0.24.04.1 4.9-2ubuntu0.24.04.1
ubuntu/sed(Ubuntu:26.04) < 4.9-2ubuntu1 4.9-2ubuntu1

References