VYPR
Medium severity5.5NVD Advisory· Published Apr 22, 2026· Updated May 4, 2026

CVE-2026-35340

CVE-2026-35340

Description

A flaw in the ChownExecutor used by uutils coreutils chown and chgrp causes the utilities to return an incorrect exit code during recursive operations. The final exit code is determined only by the last file processed. If the last operation succeeds, the command returns 0 even if earlier ownership or group changes failed due to permission errors. This can lead to security misconfigurations where administrative scripts incorrectly assume that ownership has been successfully transferred across a directory tree.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
coreutilscrates.io
< 0.6.00.6.0

Affected products

2
  • Uutils/Coreutilsreferences2 versions
    (expand)+ 1 more
    • (no CPE)
    • cpe:2.3:a:uutils:coreutils:*:*:*:*:*:rust:*:*range: <0.6.0

Patches

1
ebc08af9c341

Chgrp correct exit code (#10035)

https://github.com/uutils/coreutilscerdelenJan 9, 2026via ghsa
2 files changed · +25 2
  • src/uucore/src/lib/features/perms.rs+2 2 modified
    @@ -619,7 +619,6 @@ impl ChownExecutor {
                     );
                     continue;
                 }
    -
                 ret = match wrap_chown(
                     path,
                     &meta,
    @@ -632,7 +631,8 @@ impl ChownExecutor {
                         if !n.is_empty() {
                             show_error!("{n}");
                         }
    -                    0
    +                    // retain previous errors
    +                    ret.max(0)
                     }
                     Err(e) => {
                         if self.verbosity.level != VerbosityLevel::Silent {
    
  • tests/by-util/test_chgrp.rs+23 0 modified
    @@ -640,3 +640,26 @@ fn test_chgrp_recursive_on_file() {
             current_gid
         );
     }
    +
    +#[test]
    +fn test_chgrp_exit_code_not_being_overwritten_by_last_file() {
    +    use std::os::unix::prelude::PermissionsExt;
    +
    +    let current_gid = getegid();
    +    let (at, mut ucmd) = at_and_ucmd!();
    +    at.mkdir("dir");
    +    at.mkdir("dir/a");
    +    at.mkdir("dir/b");
    +    at.touch("dir/b/file");
    +    at.touch("dir/a/file");
    +    std::fs::set_permissions(at.plus("dir/a"), PermissionsExt::from_mode(0o0000)).unwrap();
    +
    +    // chgrp walks the dir alphabetically. Dir a does not have permissions so it fails, dir b does have
    +    // permissions so it succeeds. We check that the overall command does fail although the
    +    // last step succeeded.
    +
    +    ucmd.arg("-R")
    +        .arg(current_gid.to_string())
    +        .arg("dir")
    +        .fails();
    +}
    

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.