CVE-2026-91205: Cockpit-files: cockpit-files: local attacker can hijack file ownership via symlink race

Published May 4, 2026
·
Updated

A flaw was found in cockpit-files. A local unprivileged attacker can exploit a race condition during directory creation with owner assignment. By controlling a writable parent directory, the attacker can replace a newly created directory with a symbolic link (symlink) before the ownership change operation (chown) is applied. This allows the attacker to redirect the ownership change to an arbitrary file, potentially leading to information disclosure or unauthorized modification of sensitive files.

Other sources

AIONLYREPORT package: cockpit-files-36-1.el10 ------ Summary: Symlink Hijacking in chown during directory creation: a local attacker who controls a writable parent directory can race privileged mkdir and chown operations and redirect the ownership change to a symlink target. Requirements to exploit: A local unprivileged attacker must control the parent directory of the path being created, that directory must be writable in a way that allows entry replacement, a user must perform the directory creation through Cockpit Files with owner assignment enabled, and the attacker must win the race between mkdir and chown. Component affected: cockpit-files-36-1.el10, src/dialogs/mkdir.tsx, createdirectory() Version affected: cockpit-files-36-1.el10 Patch available: no released package fix established; proposed patch included below Version fixed: unknown Upstream coordination: Not notified. CVSS: CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:N - 6.0 (MEDIUM) AV:L - The attacker needs local access to a system where Cockpit Files is used. AC:H - Exploitation depends on winning a narrow pathname race and on an attacker-controlled writable parent directory. PR:L - The attacker needs only a low-privileged local account to prepare the directory and run the race. UI:R - A user must trigger the vulnerable directory creation flow. S:U - The impact remains within the same security scope. C:H - A successful attack can redirect ownership changes onto sensitive files and expose their contents. I:H - A successful attack can grant write control over files whose ownership should not be attacker-controlled. A:N - The demonstrated impact is confidentiality and integrity compromise rather than a direct denial of service. Impact: Moderate. The flaw can compromise confidentiality and integrity, but exploitation is materially constrained by local access, required user interaction, a race condition, and a specific writable-parent-directory setup. That aligns more closely with Red Hat's Moderate category than Important. Embargo: no Reason: The issue is local, requires a privileged user action and favorable filesystem conditions, and has straightforward operational mitigations, so delayed public disclosure is not strongly justified on the available evidence. Acknowledgement: Aisle Research Vulnerability Details: In the privileged owner-assignment path, directory creation and ownership change are performed as two separate operations on the same pathname: ts async function createdirectory(path: string, owner?: string) { if (owner !== undefined) { const opts = { err: "message", superuser: "require" } as const; await cockpit.spawn(["mkdir", path], opts); await cockpit.spawn(["chown", owner, path], opts); } else { await cockpit.spawn(["mkdir", path], { err: "message" }); } } If an attacker can modify the parent directory contents between these two calls, the newly created directory entry can be replaced with a symlink before chown runs. In that situation, the ownership change may be applied to the symlink target rather than the directory that Cockpit Files intended to create. The risk is limited to scenarios where the attacker can control the parent directory and where the superuser-assisted owner-setting path is actually used. Steps to reproduce: 1. Prepare two users: an unprivileged local attacker account and a user who will operate Cockpit Files with superuser access. 2. Create an attacker-controlled parent directory, for example: sudo mkdir -p /home/attacker/share sudo chown attacker:attacker /home/attacker/share sudo chmod 0777 /home/attacker/share 3. As the attacker, run a loop that continually replaces the target name with a symlink: while true; do rm -rf /home/attacker/share/poc; ln -s /etc/shadow /home/attacker/share/poc 2>/dev/null; done 4. In Cockpit Files, browse to /home/attacker/share/, choose to create directory poc, and use the owner-setting flow that triggers the privileged chown path. 5. If the race is won, verify whether the ownership of /etc/shadow changed unexpectedly: ls -l /etc/shadow Mitigation: Avoid using the privileged owner-setting directory creation flow inside attacker-writable directories. Restrict write access on shared parent directories, use sticky-bit protections where appropriate, and prefer symlink-safe ownership changes that do not dereference attacker-controlled path replacements. Proposed Fix: Add --no-dereference to the privileged chown invocation so that ownership changes do not follow a substituted symlink. diff diff --git a/src/dialogs/mkdir.tsx b/src/dialogs/mkdir.tsx @@ -42,7 +42,7 @@ async function createdirectory(path: string, owner?: string) { if (owner !== undefined) { const opts = { err: "message", superuser: "require" } as const; await cockpit.spawn(["mkdir", path], opts); await cockpit.spawn(["chown", owner, path], opts); + await cockpit.spawn(["chown", "--no-dereference", owner, path], opts); } else { await cockpit.spawn(["mkdir", path], { err: "message" }); }

------ This report was generated using AI technology. Always review AI-generated content prior to use

— Red Hat

Affected Software

3 affected componentsFixes available
Red Hat cockpit-files=cockpit-files-36-1.el10
debian/cockpit-files<45-1
45-1
debian/cockpit-files
46-147-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/cockpit-files to a version that resolves this vulnerability.

    Fixed in 45-1
  2. Upgrade

    Upgrade debian/cockpit-files to a version that resolves this vulnerability.

    Fixed in 46-1Fixed in 47-1
  3. Upgrade

    Upgrade cockpit-files-36-1.el10 to a version that resolves this vulnerability.

    Fixed in unknown
  4. Configuration

    Apply the proposed fix: add "--no-dereference" to the privileged chown command used in Cockpit Files directory creation when owner assignment is enabled (src/dialogs/mkdir.tsx).

    cockpit-files (directory creation owner-assignment flow) chown invocation = --no-dereference

Event History

May 4, 2026
Data Sourced
via Red Hat·06:07 PM
DescriptionSeverityAffected Software
Sep 18, 2026
CVE Published
via MITRE·07:14 PM
Data Sourced
via MITRE·07:14 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·08:17 PM
DescriptionSeverityWeakness
Data Sourced
via OSV·08:17 PM
DescriptionSeverityAffected Software

Frequently Asked Questions

1

Who is realistically exposed to this issue?

Systems are exposed where an unprivileged local attacker controls a writable parent directory and a user creates a directory under that location through Cockpit Files with owner assignment enabled. Remote-only attackers are not described as able to exploit this flaw.

2

What must an attacker do to exploit it?

The attacker must replace the newly created directory with a symlink after mkdir completes but before chown runs, causing the ownership change to target the symlink destination. Exploitation requires winning this timing race as well as control of the writable parent directory.

3

Is ordinary directory creation affected?

The described vulnerable path requires directory creation through Cockpit Files with owner assignment enabled. The provided information does not indicate that directory creation without owner assignment is affected.

4

How can administrators reduce exposure before a fix is available?

Avoid using Cockpit Files to create directories with owner assignment inside parent directories writable by untrusted local users. Restrict untrusted users' ability to create or replace entries in parent directories used for these operations.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203