CVE-2026-35339: chmod Recursive Mode Returns Exit Code Vulnerability

MODERATE
Advisory Identifier: GHSA-4x34-chg5-mwjj
CVSS 5.5
CWE-755 CWE-253 CWE-252
Published
Advisory Summary

CVE-2026-35339 is a MODERATE (CVSS 5.5) recursive mode returns exit code vulnerability (CWE-755: Improper Handling of Exceptional Conditions) affecting chmod libraries in the crates.io ecosystem. The issue involves recursive mode returns exit code 0 even when some files fail (last-file-wins). Remediation is available by upgrading affected packages to version 0.6.0.

CVE-2026-35339 at a Glance

CVE Identifier CVE-2026-35339
GHSA Identifier GHSA-4x34-chg5-mwjj
Severity MODERATE
CVSS v3.1 Base Score 5.5
CWE Classification CWE-755: Improper Handling of Exceptional Conditions
Affected Product chmod
Package Ecosystem crates.io
Published Date
Last Updated

Security Impact

CVSS: 5.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2026-35339

To remediate this vulnerability, upgrade all affected chmod dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

uu_chmod fixed: 0.6.0
Upgrade uu_chmod to 0.6.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for uu_chmod

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-35339, inspect your project dependencies for chmod:

inspect dependencies for uu_chmod

Analyze the terminal output to locate any version of chmod in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.6.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-755: Improper Handling of Exceptional Conditions, where the product does not handle or incorrectly handles an exceptional condition. In chmod, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

In `Chmoder::chmod()` the recursive branch overwrites the running result instead of accumulating it, so the exit code reflects only the *last* file processed: ``` if self.recursive { r = self.walk_dir_with_context(file, true); // overwrites r } else { r = self.chmod_file(file).and(r); } ``` **PoC:** GNU returns 1 when a file fails; uutils returns 0 if the last entry succeeds: ``` $ chmod -R 0755 chmod-bug/root chmod-bug/user # GNU -> ret=1 $ uutils chmod -R 0755 chmod-bug/root chmod-bug/user # -> ret=0 ``` **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. **Remediation:** Acknowledged by Canonical; fixed in commit abd581f6. --- _Reported by Zellic in the *uutils coreutils Program Security Assessment* (prepared for Canonical, Jan 20 2026), audited commit `3a07ffc5a9bd4c283e75afa548ba1f1957bad242`. Finding 3.2. Credit: Zellic._

CVE-2026-35339 Affected chmod Versions

1 component(s)
Fixed Versions:
0.6.0
Product / Package Ecosystem Affected Versions Fixed Version
uu_chmod
crates.io
< 0.6.0
0.6.0

References

Frequently Asked Questions

What is CVE-2026-35339?
CVE-2026-35339 is a security vulnerability in chmod involving recursive mode returns exit code 0 even when some files fail (last-file-wins) under CWE-755: Improper Handling of Exceptional Conditions.
Which chmod versions are affected?
Affected versions include releases prior to 0.6.0 across affected packages: uu_chmod.
What version fixes CVE-2026-35339?
Upgrading to 0.6.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is uu_chmod affected?
Yes, uu_chmod is affected in releases prior to 0.6.0. Upgrade your dependency to 0.6.0 or later.
What is the CVSS score of CVE-2026-35339?
CVE-2026-35339 has a CVSS v3.1 base score of 5.5 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2026-35339?
CVE-2026-35339 is classified under CWE-755: Improper Handling of Exceptional Conditions (The product does not handle or incorrectly handles an exceptional condition.).
How can I check crates.io dependencies for CVE-2026-35339?
Run the dependency tree command: 'inspect dependencies for uu_chmod'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-4x34-chg5-mwjj",
  "modified" : "2026-07-06T19:27:41Z",
  "published" : "2026-07-06T19:27:41Z",
  "aliases" : [ "CVE-2026-35339" ],
  "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 -> ret=1\n$ uutils chmod -R 0755 chmod-bug/root chmod-bug/user  # -> 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._",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "uu_chmod"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.6.0"
      } ]
    } ]
  } ],
  "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"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-252", "CWE-253", "CWE-755" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-06T19:27:41Z",
    "nvd_published_at" : null
  }
}