CVE-2026-31402: nfsd: fix heap overflow in NFSv4.0 LOCK replay cache
In the Linux kernel, the following vulnerability has been resolved:
nfsd: fix heap overflow in NFSv4.0 LOCK replay cache
The NFSv4.0 replay cache uses a fixed 112-byte inline buffer
(rp_ibuf[NFSD4_REPLAY_ISIZE]) to store encoded operation responses.
This size was calculated based on OPEN responses and does not account
for LOCK denied responses, which include the conflicting lock owner as
a variable-length field up to 1024 bytes (NFS4_OPAQUE_LIMIT).
When a LOCK operation is denied due to a conflict with an existing lock
that has a large owner, nfsd4_encode_operation() copies the full encoded
response into the undersized replay buffer via read_bytes_from_xdr_buf()
with no bounds check. This results in a slab-out-of-bounds write of up
to 944 bytes past the end of the buffer, corrupting adjacent heap memory.
This can be triggered remotely by an unauthenticated attacker with two
cooperating NFSv4.0 clients: one sets a lock with a large owner string,
then the other requests a conflicting lock to provoke the denial.
We could fix this by increasing NFSD4_REPLAY_ISIZE to allow for a full
opaque, but that would increase the size of every stateowner, when most
lockowners are not that large.
Instead, fix this by checking the encoded response length against
NFSD4_REPLAY_ISIZE before copying into the replay buffer. If the
response is too large, set rp_buflen to 0 to skip caching the replay
payload. The status is still cached, and the client already received the
correct response on the original request.
Security readout for executives and security teams
Plain-English summary
This flaw affects the Linux kernel NFS server. A remote unauthenticated attacker could trigger memory corruption through NFSv4.0 lock handling, potentially impacting confidentiality, integrity, and availability. The source says it is resolved in kernel fixes, but KEV does not indicate known active exploitation.
Executive priority
Handle as urgent for organizations operating Linux NFS servers, especially where NFS is reachable beyond tightly controlled networks. The CVSS is 9.8 and the bug is remotely triggerable without authentication, but current supplied evidence does not show active exploitation.
Technical view
nfsd caches NFSv4.0 LOCK replies in a fixed 112-byte replay buffer. A denied LOCK reply can include a variable-length owner up to 1024 bytes, causing an out-of-bounds heap write when copied without a length check. The fix skips replay-payload caching when the encoded reply exceeds the buffer.
Likely exposure
Exposure is most likely on Linux systems running the kernel NFS server with NFSv4.0 reachable over a network. The supplied affected data lists Linux kernel ranges from 2.6.12 through several maintained branches before fixed releases. Distribution applicability must be verified with vendor advisories.
Exploitation context
The source describes remote unauthenticated triggering using two cooperating NFSv4.0 clients, but provides no evidence of active exploitation. KEV is false in the supplied bundle. Treat internet- or broadly network-reachable NFS servers as higher priority.
Researcher notes
Focus review on nfsd NFSv4.0 LOCK denial paths and replay-cache handling. The key condition is an encoded denied response exceeding NFSD4_REPLAY_ISIZE. Avoid assuming exploitability beyond the documented heap overflow without additional vendor or kernel analysis.
Mitigation direction
Apply Linux vendor kernel updates containing the referenced nfsd replay-cache fix.
Prioritize NFS servers reachable from untrusted or broad internal networks.
Track applicable Red Hat RHSA advisories or equivalent distribution guidance.
If patch timing is constrained, follow vendor-approved NFS exposure reduction guidance.
Reboot into the fixed kernel where required by your distribution.
Validation and detection
Inventory Linux hosts running nfsd and offering NFSv4.0.
Compare installed kernel builds against vendor advisories and fixed stable commits.
Confirm patched systems are running the updated kernel after maintenance.
Review network reachability to NFS services from untrusted segments.
Document systems requiring vendor clarification or delayed maintenance windows.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · low confidence lookup
CWE-787: Exact CWE lookup
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
2CVSS vectors
5Timeline events
2ADP providers
38Source links
CVSS vector scores
2 official scores
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.
CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.
CWE-787 · source CWE mapping
Out-of-bounds Write
Out-of-bounds Write represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.