Watch out for the CVE-2022-30136 Windows NFS Remote Code Execution flaw

Pierluigi Paganini July 18, 2022

Researchers published an analysis of the Windows remote code execution vulnerability CVE-2022-30136 impacting the Network File System.

Trend Micro Research has published an analysis of the recently patched Windows vulnerability CVE-2022-30136 that impacts the Network File System.

CVE-2022-30136 is a remote code execution vulnerability that resides in the Windows Network File System, it is due to improper handling of NFSv4 requests.

A remote attacker can exploit this vulnerability by sending malicious RPC calls to a target server to achieve arbitrary code execution in the context of SYSTEM. Experts pointed out that the unsuccessful exploitation of this issue may trigger a crash of the impacted system.

CVE-2022-30136 – Windows Network File System Remote Code Execution Vulnerability
This CVSS 9.8 bug looks eerily similar to CVE-2022-26937 – an NFS bug patched last month and one we blogged about last week. This vulnerability could allow a remote attacker to execute privileged code on affected systems running NFS.” reads the description published by ZDI. “On the surface, the only difference between the patches is that this month’s update fixes a bug in NFSV4.1, whereas last month’s bug only affected versions NSFV2.0 and NSFV3.0. It’s not clear if this is a variant or a failed patch or a completely new issue. Regardless, enterprises running NFS should prioritize testing and deploying this fix.”

The NFS network file system protocol was originally developed by Sun Microsystems in 1984, it allows users to access remote file shares in the same way that the local file system is accessed.

The NFS protocol uses Open Network Computing (ONC) Remote Procedure Call (RPC) to exchange control messages. When ONC RPC messages are sent over TCP, they are prepended with a Fragment header structure that specifies the length of the message, a piece of information used by the receiver to distinguish multiple messages sent over a single TCP session.

Offset    Size    Description 
-------   -----   ---------------------------------- 
0x0000    4       Fragment header, the highest bit is the last fragment flag, 
                        lower bits represent the fragment size = N 
0x0004    N       RPC Message 

“A buffer overflow vulnerability exists in the Windows implementation of NFS. The vulnerability is due to incorrect calculation of the size of response messages. The server calls the function Nfs4SvrXdrpGetEncodeOperationResultByteCount() to calculate the size of each opcode response, but it does not include the size of the opcode itself.” reads the post published by Trend Micro researchers. ” This results in the size of the response buffer being too small by OP Count * 4 bytes. A corresponding buffer is allocated with OncRpcBufMgrpAllocate. When the response data is written to the buffer, the response data overflows.”

The experts pointed out that only NFS version 4 is vulnerable because it uses the OncRpcBufMgrpAllocate function.

“This bug was patched by Microsoft in June 2022 and assigned CVE-2022-30136. In their write-up, they also list disabling NFSv4.1 as a method to mitigate attacks. However, this could lead to a loss of functionality. Also, Microsoft notes the update to address this bug should not be applied unless the fix for CVE-2022-26937 is installed.” concludes the expers. “Applying both updates in the appropriate order is the best method to fully address these vulnerabilities.”

Follow me on Twitter: @securityaffairs and Facebook

[adrotate banner=”9″][adrotate banner=”12″]

Pierluigi Paganini

(SecurityAffairs – hacking, CVE-2022-30136)

[adrotate banner=”5″]

[adrotate banner=”13″]

you might also like

leave a comment