CVE-2026-64298
High · 7.1CVSS
7.1
EPSS
0.1%
Published
Jul 25, 2026
CISA due date
—
Cloudanix analysis
A logged-in user on a Linux system may be able to erase files on shared network storage even when they are supposed to have read-only access.
- Exploitation
- Local Privilege
- Attacker needs
- Low Privilege
- Complexity
- Moderate
- Impact
- Data Tampering
- Component
- OS kernel
- Class
- Authorization Bypass
- Remediation
- Patch
- Effort
- Medium
- Patch risk
- Low
What it actually does
This is a Linux kernel NFSv4 authorization bypass in the client-side handling of cached write delegations. When a process opens an NFSv4 file with O_TRUNC but without a write access mode, such as O_RDONLY | O_TRUNC, the NFS client incorrectly builds the local permission check from the read/write access mode only and omits MAY_WRITE. If the open is satisfied locally through a cached write delegation, the client can then issue a SETATTR(size=0) operation to the NFS server using the delegation state, causing the file to be truncated even though POSIX semantics require write permission and the operation should fail with EACCES. The impact is unauthorized file modification/destruction by a local authenticated user with access to an affected NFS client and read access to a delegated file.
Why it matters to the business
An authenticated local user may be able to erase the contents of files on NFSv4 shares even when they should only have read access, creating risk of data loss, service disruption, corrupted shared application data, and recovery costs. The issue is not currently listed in CISA KEV, has low EPSS, and has no known public exploit maturity in the provided data, but shared NFS environments can have high operational impact because one compromised or malicious user on a client can affect files used by multiple users or services.
How an attack unfolds
An attacker first obtains local code execution or an interactive account on a Linux system that mounts an NFSv4 export. The attacker identifies files on the NFS share that they can access for reading but should not be allowed to modify. Under the vulnerable behavior, if the NFS client has a cached write delegation that allows the open to be handled locally, the attacker opens a target file using flags equivalent to O_RDONLY | O_TRUNC. The vulnerable NFS client checks only for read permission, not the write permission required for truncation, so the local authorization gate permits the open. The client then sends a SETATTR operation setting the file size to zero using the delegation state, and the NFS server accepts it under delegation semantics. The result is that the target file is truncated despite the attacker lacking write permission.
How to fix it
Apply a Linux kernel update that includes the NFSv4 fix adding MAY_WRITE to the open permission mask whenever O_TRUNC is set. No exact fixed package versions were provided, so use the relevant distribution kernel advisories and upgrade to the first kernel build that explicitly includes the fix for this issue. Prioritize NFS clients used by multi-user systems, application servers, build hosts, shared research/HPC nodes, and any systems mounting sensitive NFSv4 exports. If immediate patching is not possible, reduce exposure by limiting local shell/code execution on NFS clients, tightening access to sensitive NFS exports, monitoring for suspicious truncation activity, and disabling or restricting NFSv4 delegations where operationally acceptable so opens are more likely to be authorized by the server rather than satisfied from client delegation state. Maintain recoverable backups or snapshots for important NFS-hosted data.
How to confirm the fix worked
Confirm that each Linux NFS client is running a kernel build containing the fix. Where vendor package metadata is available, verify the installed kernel version against the distribution security advisory rather than relying only on upstream version numbers. In a controlled test environment, mount an NFSv4 export, create a file that a test user can read but cannot write, and attempt to open it with O_RDONLY | O_TRUNC using a small C, Python, or Perl test program. A fixed client should return EACCES or otherwise deny the operation and the file size should remain unchanged. Review NFS server and client audit logs for SETATTR or truncation events that reduce files to zero bytes and confirm that the initiating user had write authorization.
Typical attack path
- Gain local access to a Linux system that mounts an affected NFSv4 share.
- Enumerate readable files on the NFS-mounted filesystem where the attacker lacks write permission.
- Wait for or induce conditions where the NFS client can satisfy an open through a cached write delegation.
- Open the target file with O_TRUNC while using a non-write access mode, such as O_RDONLY | O_TRUNC.
- Rely on the vulnerable client-side permission mask to authorize the operation as read-only.
- Cause the NFS client to issue SETATTR(size=0) to the server using the delegation state.
- Verify that the file contents have been erased or reduced to zero bytes.
How to detect it
Look for evidence of unauthorized truncation on NFSv4-mounted filesystems. Useful sources include Linux auditd syscall logs on NFS clients, endpoint telemetry showing open/openat/openat2 calls with O_TRUNC, NFS server logs or packet captures showing SETATTR requests that set file size to 0, file integrity monitoring events showing files changed to zero bytes, shell history or process telemetry for scripts/programs deliberately opening files with truncate flags, and storage snapshot/versioning records showing sudden content loss. Prioritize events where the actor had read access but lacked write permission, where the operation occurred from a shared NFS client, or where many files were truncated in a short period. Because this flaw does not require a unique malware payload or network exploit string, detection is behavior-based rather than signature-based.
- O_RDONLY|O_TRUNC
- O_RDONLY | O_TRUNC
- O_TRUNC
- SETATTR(size=0)
- SETATTR size=0
- setattr size 0
- openat
- openat2
- truncate
- ftruncate
- size=0
What your security team should do
- Inventory Linux systems that mount NFSv4 exports, especially shared multi-user clients and systems with sensitive or business-critical shared files.
- Patch affected Linux kernels through vendor-supported packages as soon as practical, prioritizing NFS clients over unrelated servers.
- If patching is delayed, evaluate disabling NFSv4 delegations or write delegations for high-value exports where the performance impact is acceptable.
- Enable or tune auditing on NFS clients and servers to capture file truncation events, open/openat/openat2 calls using O_TRUNC, and NFS SETATTR operations setting size to zero.
- Hunt for recent zero-byte changes to important NFS-hosted files and correlate them to user sessions, process execution, and NFS client hosts.
- Restrict local interactive access and untrusted code execution on systems that mount sensitive NFSv4 shares.
- Ensure backups, snapshots, or versioning are available for critical data stored on NFS exports.
The record
In the Linux kernel, the following vulnerability has been resolved: NFSv4: include MAY_WRITE in open permission mask for O_TRUNC POSIX requires write permission to truncate a file, so an open() that specifies O_TRUNC must be authorized for write access regardless of the O_ACCMODE access mode. nfs_open_permission_mask() builds the access mask passed to nfs_may_open(), which is the local authorization gate for OPENs the client serves itself from a cached write delegation via the can_open_delegated() path in nfs4_try_open_cached(). The mask is derived from O_ACCMODE alone, so an open(O_RDONLY | O_TRUNC) against a file the caller cannot write requests only MAY_READ and passes the local check. The OPEN is then satisfied locally and the truncation is issued to the server as a SETATTR(size=0) over the delegation stateid, which the server accepts under standard write-delegation semantics. POSIX requires that this open fail with EACCES. Include MAY_WRITE in the mask whenever O_TRUNC is set so the local check matches the access the server would have enforced.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|