VYPR
Low severity3.4NVD Advisory· Published Apr 22, 2026· Updated Apr 27, 2026

CVE-2026-35361

CVE-2026-35361

Description

The mknod utility in uutils coreutils fails to handle security labels atomically by creating device nodes before setting the SELinux context. If labeling fails, the utility attempts cleanup using std::fs::remove_dir, which cannot remove device nodes or FIFOs. This leaves mislabeled nodes behind with incorrect default contexts, potentially allowing unauthorized access to device nodes that should have been restricted by mandatory access controls.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
coreutilscrates.io
< 0.6.00.6.0

Affected products

1

Patches

1
42b2ad83cdcf

mknod: fix SELinux cleanup when context setting fails (#10582)

https://github.com/uutils/coreutilsChiamakaUIJan 31, 2026via ghsa
2 files changed · +19 1
  • src/uu/mknod/src/mknod.rs+1 1 modified
    @@ -94,7 +94,7 @@ fn mknod(file_name: &str, config: Config) -> i32 {
                     config.context,
                 ) {
                     // if it fails, delete the file
    -                let _ = std::fs::remove_dir(file_name);
    +                let _ = std::fs::remove_file(file_name);
                     eprintln!("{}: {}", uucore::util_name(), e);
                     return 1;
                 }
    
  • tests/by-util/test_mknod.rs+18 0 modified
    @@ -240,3 +240,21 @@ fn test_mknod_selinux_invalid() {
             }
         }
     }
    +
    +#[test]
    +#[cfg(feature = "feat_selinux")]
    +fn test_mknod_selinux_invalid_cleanup() {
    +    let scene = TestScenario::new(util_name!());
    +    let at = &scene.fixtures;
    +    let dest = "test_fifo";
    +
    +    new_ucmd!()
    +        .arg("--context=invalid_context_t")
    +        .arg(at.plus_as_string(dest))
    +        .arg("p")
    +        .fails()
    +        .no_stdout();
    +
    +    // invalid context → node must not exist
    +    assert!(!at.file_exists(dest));
    +}
    

Vulnerability mechanics

Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

5

News mentions

0

No linked articles in our index yet.