VYPR
High severity7.3NVD Advisory· Published Apr 22, 2026· Updated Apr 27, 2026

CVE-2026-35338

CVE-2026-35338

Description

A vulnerability in the chmod utility of uutils coreutils allows users to bypass the --preserve-root safety mechanism. The implementation only validates if the target path is literally / and does not canonicalize the path. An attacker or accidental user can use path variants such as /../ or symbolic links to execute destructive recursive operations (e.g., chmod -R 000) on the entire root filesystem, leading to system-wide permission loss and potential complete system breakdown.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
coreutilscrates.io
< 0.6.00.6.0

Affected products

1

Patches

1
413055b378fa

Chmod preserve root (#10033)

https://github.com/uutils/coreutilscerdelenJan 7, 2026via ghsa
2 files changed · +16 1
  • src/uu/chmod/src/chmod.rs+5 1 modified
    @@ -407,7 +407,7 @@ impl Chmoder {
                     // should not change the permissions in this case
                     continue;
                 }
    -            if self.recursive && self.preserve_root && file == Path::new("/") {
    +            if self.recursive && self.preserve_root && Self::is_root(file) {
                     return Err(ChmodError::PreserveRoot("/".into()).into());
                 }
                 if self.recursive {
    @@ -419,6 +419,10 @@ impl Chmoder {
             r
         }
     
    +    fn is_root(file: impl AsRef<Path>) -> bool {
    +        matches!(fs::canonicalize(&file), Ok(p) if p == Path::new("/"))
    +    }
    +
         #[cfg(not(target_os = "linux"))]
         fn walk_dir_with_context(&self, file_path: &Path, is_command_line_arg: bool) -> UResult<()> {
             let mut r = self.chmod_file(file_path);
    
  • tests/by-util/test_chmod.rs+11 0 modified
    @@ -508,6 +508,17 @@ fn test_chmod_preserve_root() {
             .stderr_contains("chmod: it is dangerous to operate recursively on '/'");
     }
     
    +#[test]
    +fn test_chmod_preserve_root_with_paths_that_resolve_to_root() {
    +    new_ucmd!()
    +        .arg("-R")
    +        .arg("--preserve-root")
    +        .arg("755")
    +        .arg("/../")
    +        .fails_with_code(1)
    +        .stderr_contains("chmod: it is dangerous to operate recursively on '/'");
    +}
    +
     #[test]
     fn test_chmod_symlink_non_existing_file() {
         let scene = TestScenario::new(util_name!());
    

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.