CVE-2026-35364
Received Received - Intake
TOCTOU Race Condition in uutils coreutils mv Enables Arbitrary File Overwrite

Publication date: 2026-04-22

Last updated on: 2026-04-24

Assigner: Canonical Ltd.

Description
A Time-of-Check to Time-of-Use (TOCTOU) race condition exists in the mv utility of uutils coreutils during cross-device operations. The utility removes the destination path before recreating it through a copy operation. A local attacker with write access to the destination directory can exploit this window to replace the destination with a symbolic link. The subsequent privileged move operation will follow the symlink, allowing the attacker to redirect the write and overwrite an arbitrary target file with contents from the source.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-04-22
Last Modified
2026-04-24
Generated
2026-05-07
AI Q&A
2026-04-22
EPSS Evaluated
2026-05-05
NVD
EUVD
Affected Vendors & Products
Showing 1 associated CPE
Vendor Product Version / Range
uutils coreutils *
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-367 The product checks the state of a resource before using that resource, but the resource's state can change between the check and the use in a way that invalidates the results of the check.
Attack-Flow Graph
AI Powered Q&A
How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:

This vulnerability allows a local attacker with write access to a destination directory to overwrite arbitrary target files, including sensitive files, by exploiting a race condition in the mv utility. Such unauthorized modification of sensitive files can lead to data integrity violations and potential exposure or alteration of protected information.

As a result, this vulnerability could negatively impact compliance with common standards and regulations like GDPR and HIPAA, which require the protection of sensitive data against unauthorized access and modification. The ability to overwrite sensitive files may lead to breaches of confidentiality and integrity requirements mandated by these regulations.


How can this vulnerability impact me? :

This vulnerability can allow a local attacker with write access to the destination directory to overwrite arbitrary files by redirecting the move operation through a symbolic link. This can lead to unauthorized modification of files, potentially causing data corruption, privilege escalation, or disruption of system operations.


Can you explain this vulnerability to me?

This vulnerability is a Time-of-Check to Time-of-Use (TOCTOU) race condition in the mv utility of uutils coreutils during cross-device operations. Specifically, the utility removes the destination path before recreating it by copying. A local attacker who has write access to the destination directory can exploit the time window between removal and recreation by replacing the destination with a symbolic link. When the privileged move operation follows this symlink, it can overwrite an arbitrary target file with the contents from the source.


How can this vulnerability be detected on my network or system? Can you suggest some commands?

This vulnerability can be detected by attempting to reproduce the race condition exploit involving cross-device moves with the vulnerable mv utility from uutils coreutils.

A practical detection method involves setting up two directories on different file systems (e.g., /tmp and /home), creating a source file with known payload content, and a sensitive target file with restricted permissions.

Then, run a user-level script that continuously creates a symbolic link from the target path to the sensitive file, while simultaneously running a root-level script that continuously moves the source file to the target path using the vulnerable mv command.

  • Create source file: `echo PAYLOAD_FROM_SRC > /tmp/src_file`
  • Create sensitive target file with restricted permissions: `sudo touch /home/$USER/secure/victim && sudo chmod 600 /home/$USER/secure/victim`
  • Run user-level symlink creation script (symlink.sh) that repeatedly creates a symlink: `while true; do ln -sf /home/$USER/secure/victim /home/$USER/target; done`
  • Run root-level move script (mv.sh) that repeatedly moves the source file: `while true; do mv /tmp/src_file /home/$USER/target; done`

If the contents of the sensitive file are overwritten with the payload from the source file, the vulnerability is present.


What immediate steps should I take to mitigate this vulnerability?

To mitigate the CVE-2026-35364 vulnerability, avoid performing cross-device move operations using the vulnerable uutils/coreutils mv utility until a patch is applied.

Restrict write access to destination directories to trusted users only, as local attackers with write permissions can exploit the race condition.

Monitor for updates or patches from the uutils/coreutils project and apply them promptly once available to fix the TOCTOU race condition.

As a temporary workaround, consider using alternative move commands or utilities that do not exhibit this race condition for cross-device moves.


Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart