{"schemaVersion":3,"id":"CVE-2026-5958","aliases":["MGASA-2026-0128","SUSE-SU-2026:22256-1","SUSE-SU-2026:22325-1","RHSA-2026:10995","UBUNTU-CVE-2026-5958","USN-8229-2","DEBIAN-CVE-2026-5958","openSUSE-SU-2026:10649-1","openSUSE-SU-2026:21024-1"],"status":"published","duplicateOf":null,"title":"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:\n1. resolves symlink to its target and stores the resolved path for determining when output is written,\n2. opens the original symlink path (not the resolved one) to read the file.\nBetween 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.\n\n\nThis issue was fixed in version 4.10.","dates":{"published":"2026-04-20T11:59:32.214Z","modified":"2026-05-13T05:17:46.051Z","reserved":null,"kevAdded":[],"kevDue":[]},"cvss":{"headline":{"score":2.1,"severity":"low","version":"4.0","versionLabel":"v4.0","source":"CVE.org","vector":"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","computed":false,"selection":"backend-summary"},"metrics":[{"version":"4.0","versionLabel":"v4.0","source":"CVE.org","score":2.1,"severity":"low","vector":"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","exploitability":null,"impact":null,"computed":false},{"version":"3.1","versionLabel":"v3.1","source":"OSV · Red hat","score":6.3,"severity":"medium","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:H","exploitability":2.6,"impact":8.7,"computed":true},{"version":"4.0","versionLabel":"v4.0","source":"OSV · Ubuntu","score":2.1,"severity":"low","vector":"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","exploitability":null,"impact":null,"computed":true},{"version":"4.0","versionLabel":"v4.0","source":"OSV · Debian","score":2.1,"severity":"low","vector":"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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","exploitability":null,"impact":null,"computed":true},{"version":"4.0","versionLabel":"v4.0","source":"NVD","score":2.1,"severity":"low","vector":"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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","exploitability":null,"impact":null,"computed":false}]},"epss":{"probability":0.00137,"percentile":0.02858,"severity":"low","asOf":"2026-10-22T00:00:00.000Z","change":{"pp":-0.005000000000000013,"baselineDate":"2026-09-22T00:00:00.000Z","baselineScore":0.00142},"history":[{"date":"2026-09-14T00:00:00.000Z","score":0.00142,"percentile":null},{"date":"2026-09-15T00:00:00.000Z","score":0.00142,"percentile":null},{"date":"2026-09-16T00:00:00.000Z","score":0.00142,"percentile":null},{"date":"2026-09-17T00:00:00.000Z","score":0.00142,"percentile":null},{"date":"2026-09-18T00:00:00.000Z","score":0.00142,"percentile":null},{"date":"2026-09-19T00:00:00.000Z","score":0.00142,"percentile":null},{"date":"2026-09-20T00:00:00.000Z","score":0.00142,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.00142,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.00142,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.00142,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-10-20T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-10-21T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-10-22T00:00:00.000Z","score":0.00137,"percentile":0.02858}],"last30":[{"date":"2026-09-22T00:00:00.000Z","score":0.00142,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.00142,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-10-20T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-10-21T00:00:00.000Z","score":0.00137,"percentile":null},{"date":"2026-10-22T00:00:00.000Z","score":0.00137,"percentile":0.02858}]},"kev":{"state":"not-listed","entries":[],"listedCount":0,"totalCatalogs":3,"catalogs":[{"source":"cisa","label":"CISA","listed":false,"entry":null},{"source":"enisa","label":"ENISA","listed":false,"entry":null},{"source":"circl","label":"CIRCL","listed":false,"entry":null}]},"ransomware":{"state":"none-recorded","sources":[]},"exploits":[],"exploitCount":0,"weaknesses":[{"id":"CWE-367","name":"Time-of-check Time-of-use (TOCTOU) Race Condition","description":"The product checks the state of a resource before using that resource, but the resource's state can change between the check and the use in a way that invalidates the results of the check.","type":"weakness","status":"Incomplete","abstraction":"Base","likelihoodOfExploit":"Medium","url":"https://cwe.mitre.org/data/definitions/367.html"}],"affected":[{"vendor":"debian","product":"sed","name":"sed","label":"sed","ecosystem":"Debian","cpePart":null,"purl":"pkg:deb/debian/sed","purlType":"deb","versions":[{"text":"< 4.9-1+deb12u1","noFixRecorded":false,"fixedIn":null},{"text":"< 4.9-2+deb13u1","noFixRecorded":false,"fixedIn":null},{"text":"< 4.9-3","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 4.9-1+deb12u1 | < 4.9-2+deb13u1 | < 4.9-3","eol":null,"hubHref":null},{"vendor":"ubuntu","product":"sed","name":"sed","label":"sed","ecosystem":"Ubuntu","cpePart":null,"purl":"pkg:deb/ubuntu/sed","purlType":"deb","versions":[{"text":"< 4.8-1ubuntu2.1","noFixRecorded":false,"fixedIn":null},{"text":"< 4.9-2ubuntu0.24.04.1","noFixRecorded":false,"fixedIn":null},{"text":"< 4.9-2ubuntu0.25.10.1","noFixRecorded":false,"fixedIn":null},{"text":"< 4.9-2ubuntu1","noFixRecorded":false,"fixedIn":null},{"text":"< 4.4-2ubuntu0.1~esm1","noFixRecorded":false,"fixedIn":null},{"text":"< 4.7-1ubuntu0.1~esm1","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 4.8-1ubuntu2.1 | < 4.9-2ubuntu0.24.04.1 | < 4.9-2ubuntu0.25.10.1 | < 4.9-2ubuntu1 | < 4.4-2ubuntu0.1~esm1 | < 4.7-1ubuntu0.1~esm1","eol":null,"hubHref":null},{"vendor":"gnu","product":"sed","name":"sed","label":"sed","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"≥ 4.1e, < 4.10","noFixRecorded":false,"fixedIn":null}],"versionsText":"≥ 4.1e, < 4.10","eol":null,"hubHref":"/vendor/gnu/sed"},{"vendor":"mageia","product":"sed","name":"sed","label":"sed","ecosystem":"Mageia","cpePart":null,"purl":"pkg:rpm/mageia/sed","purlType":"rpm","versions":[{"text":"< 4.9-1.1.mga9","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 4.9-1.1.mga9","eol":null,"hubHref":null},{"vendor":"opensuse","product":"sed&distro=openSUSE Leap 16.0","name":"sed","label":"sed&distro=openSUSE Leap 16.0","ecosystem":"openSUSE","cpePart":null,"purl":"pkg:rpm/opensuse/sed&distro=openSUSE Leap 16.0","purlType":"rpm","versions":[{"text":"< 4.9-160000.3.1","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 4.9-160000.3.1","eol":null,"hubHref":null},{"vendor":"opensuse","product":"sed&distro=openSUSE Tumbleweed","name":"sed","label":"sed&distro=openSUSE Tumbleweed","ecosystem":"openSUSE","cpePart":null,"purl":"pkg:rpm/opensuse/sed&distro=openSUSE Tumbleweed","purlType":"rpm","versions":[{"text":"< 4.10-1.1","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 4.10-1.1","eol":null,"hubHref":null},{"vendor":"redhat","product":"sed","name":"sed","label":"sed","ecosystem":"Red Hat","cpePart":null,"purl":"pkg:rpm/redhat/sed","purlType":"rpm","versions":[{"text":"< 0:4.10-1.hum1","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 0:4.10-1.hum1","eol":null,"hubHref":null},{"vendor":"suse","product":"sed&distro=SUSE Linux Enterprise Server 16.0","name":"sed","label":"sed&distro=SUSE Linux Enterprise Server 16.0","ecosystem":"SUSE Linux Enterprise","cpePart":null,"purl":"pkg:rpm/suse/sed&distro=SUSE Linux Enterprise Server 16.0","purlType":"rpm","versions":[{"text":"< 4.9-160000.3.1","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 4.9-160000.3.1","eol":null,"hubHref":null},{"vendor":"suse","product":"sed&distro=SUSE Linux Enterprise Server for SAP applications 16.0","name":"sed","label":"sed&distro=SUSE Linux Enterprise Server for SAP applications 16.0","ecosystem":"SUSE Linux Enterprise","cpePart":null,"purl":"pkg:rpm/suse/sed&distro=SUSE Linux Enterprise Server for SAP applications 16.0","purlType":"rpm","versions":[{"text":"< 4.9-160000.3.1","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 4.9-160000.3.1","eol":null,"hubHref":null},{"vendor":"suse","product":"sed&distro=SUSE Linux Micro 6.2","name":"sed","label":"sed&distro=SUSE Linux Micro 6.2","ecosystem":"SUSE Linux Enterprise","cpePart":null,"purl":"pkg:rpm/suse/sed&distro=SUSE Linux Micro 6.2","purlType":"rpm","versions":[{"text":"< 4.9-160000.3.1","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 4.9-160000.3.1","eol":null,"hubHref":null}],"affectedCount":10,"eol":{"hasEol":false,"count":0},"references":[{"url":"https://www.gnu.org/software/sed/","label":"www.gnu.org/software/sed/","hostname":"www.gnu.org","tags":["Product"]},{"url":"https://cert.pl/en/posts/2026/04/CVE-2026-5958","label":"cert.pl/en/posts/2026/04/CVE-2026-5958","hostname":"cert.pl","tags":["Third Party Advisory"]},{"url":"http://www.openwall.com/lists/oss-security/2026/05/13/1","label":"www.openwall.com/lists/oss-security/2026/05/13/1","hostname":"www.openwall.com","tags":[]},{"url":"https://advisories.mageia.org/MGASA-2026-0128.html","label":"advisories.mageia.org/MGASA-2026-0128.html","hostname":"advisories.mageia.org","tags":["Advisory"]},{"url":"https://bugs.mageia.org/show_bug.cgi?id=35465","label":"bugs.mageia.org/show_bug.cgi?id=35465","hostname":"bugs.mageia.org","tags":["REPORT"]},{"url":"https://lists.opensuse.org/archives/list/security-announce@lists.opensuse.org/message/242J2LW3C7C4MDLVKSD3DJDBKXAJXUTP/","label":"lists.opensuse.org/archives/…","hostname":"lists.opensuse.org","tags":["WEB"]},{"url":"https://www.suse.com/support/update/announcement/2026/suse-su-202622256-1/","label":"www.suse.com/support/update/announcement/2026/suse-su-202622256-1/","hostname":"www.suse.com","tags":["Advisory"]},{"url":"https://bugzilla.suse.com/1262144","label":"bugzilla.suse.com/1262144","hostname":"bugzilla.suse.com","tags":["REPORT"]},{"url":"https://www.suse.com/security/cve/CVE-2026-5958","label":"www.suse.com/security/cve/CVE-2026-5958","hostname":"www.suse.com","tags":["WEB"]},{"url":"https://www.suse.com/support/update/announcement/2026/suse-su-202622325-1/","label":"www.suse.com/support/update/announcement/2026/suse-su-202622325-1/","hostname":"www.suse.com","tags":["Advisory"]},{"url":"https://access.redhat.com/errata/RHSA-2026:10995","label":"access.redhat.com/errata/RHSA-2026:10995","hostname":"access.redhat.com","tags":["Advisory"]},{"url":"https://images.redhat.com/","label":"images.redhat.com","hostname":"images.redhat.com","tags":["ARTICLE"]},{"url":"https://access.redhat.com/security/cve/CVE-2026-5958","label":"access.redhat.com/security/cve/CVE-2026-5958","hostname":"access.redhat.com","tags":["REPORT"]},{"url":"https://access.redhat.com/security/updates/classification/","label":"access.redhat.com/security/updates/classification/","hostname":"access.redhat.com","tags":["ARTICLE"]},{"url":"https://security.access.redhat.com/data/csaf/v2/advisories/2026/rhsa-2026_10995.json","label":"security.access.redhat.com/data/csaf/v2/advisories/2026/rhsa-2026_10995.json","hostname":"security.access.redhat.com","tags":["Advisory"]},{"url":"https://bugzilla.redhat.com/show_bug.cgi?id=2458960","label":"bugzilla.redhat.com/show_bug.cgi?id=2458960","hostname":"bugzilla.redhat.com","tags":["REPORT"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-5958","label":"www.cve.org/CVERecord?id=CVE-2026-5958","hostname":"www.cve.org","tags":["Advisory","REPORT"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-5958","label":"nvd.nist.gov/vuln/detail/CVE-2026-5958","hostname":"nvd.nist.gov","tags":["Advisory","Oval"]},{"url":"https://ubuntu.com/security/CVE-2026-5958","label":"ubuntu.com/security/CVE-2026-5958","hostname":"ubuntu.com","tags":["REPORT"]},{"url":"https://ubuntu.com/security/notices/USN-8229-1","label":"ubuntu.com/security/notices/USN-8229-1","hostname":"ubuntu.com","tags":["Advisory"]},{"url":"https://ubuntu.com/security/notices/USN-8229-2","label":"ubuntu.com/security/notices/USN-8229-2","hostname":"ubuntu.com","tags":["Advisory"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2026-5958","label":"security-tracker.debian.org/tracker/CVE-2026-5958","hostname":"security-tracker.debian.org","tags":["Advisory"]}],"lineage":{"upstream":[],"downstream":[],"duplicates":[],"related":["USN-8229-1"]},"timeline":[{"kind":"published","date":"2026-04-20T11:59:32.214Z","label":"Published","detail":"Vulnerability first disclosed.","source":null},{"kind":"modified","date":"2026-05-13T05:17:46.051Z","label":"Last modified","detail":"Vulnerability information updated.","source":null}],"risk":{"score":8,"level":"minimal","profile":"Default","thresholds":{"critical":75,"high":50,"medium":25,"low":10}},"meta":{"dataAsOf":"2026-10-22T17:21:13.099Z","stale":false,"partial":false}}