{"id":"GHSA-4x34-chg5-mwjj","summary":"chmod: recursive mode returns exit code 0 even when some files fail (last-file-wins)","details":"In `Chmoder::chmod()` the recursive branch overwrites the running result instead of accumulating it, so the exit code reflects only the *last* file processed:\n\n```\nif self.recursive {\n    r = self.walk_dir_with_context(file, true);   // overwrites r\n} else {\n    r = self.chmod_file(file).and(r);\n}\n```\n\n**PoC:** GNU returns 1 when a file fails; uutils returns 0 if the last entry succeeds:\n\n```\n$ chmod -R 0755 chmod-bug/root chmod-bug/user  # GNU -\u003e ret=1\n$ uutils chmod -R 0755 chmod-bug/root chmod-bug/user  # -\u003e ret=0\n```\n\n**Impact:** scripts relying on the exit code get a false success signal while some files retained restrictive/unexpected permissions, leading to access-control misconfigurations. Recommendation: accumulate errors during traversal.\n\n**Remediation:** Acknowledged by Canonical; fixed in commit abd581f6.\n\n---\n_Reported by Zellic in the *uutils coreutils Program Security Assessment* (prepared for Canonical, Jan 20 2026), audited commit `3a07ffc5a9bd4c283e75afa548ba1f1957bad242`. Finding 3.2. Credit: Zellic._","aliases":["CVE-2026-35339"],"modified":"2026-07-06T19:41:24.785517Z","published":"2026-07-06T19:27:41Z","database_specific":{"github_reviewed_at":"2026-07-06T19:27:41Z","nvd_published_at":null,"cwe_ids":["CWE-252","CWE-253","CWE-755"],"severity":"MODERATE","github_reviewed":true},"references":[{"type":"WEB","url":"https://github.com/uutils/coreutils/security/advisories/GHSA-4x34-chg5-mwjj"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-35339"},{"type":"WEB","url":"https://github.com/uutils/coreutils/pull/9793"},{"type":"WEB","url":"https://github.com/uutils/coreutils/commit/abd581f62e97d0b147306ac40eac13af71c6fbba"},{"type":"PACKAGE","url":"https://github.com/uutils/coreutils"},{"type":"WEB","url":"https://github.com/uutils/coreutils/releases/tag/0.6.0"}],"affected":[{"package":{"name":"uu_chmod","ecosystem":"crates.io","purl":"pkg:cargo/uu_chmod"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"0.6.0"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/07/GHSA-4x34-chg5-mwjj/GHSA-4x34-chg5-mwjj.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N"}]}