SMBv3 Compression Remote Code Execution (CVE-2020-0796)

The host is missing the fix for SMBGhost (CVE-2020-0796), a flaw in SMB 3.1.1 compression that can let an unauthenticated attacker run code on it or crash it.

SeverityCritical
CVSS 3.19.8 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H Open in the calculator
CVSS 4.09.3 CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N Open in the calculator
CWECWE-190: Integer Overflow or Wraparound
MITRE ATT&CKT1210 Exploitation of Remote Services, T1068 Exploitation for Privilege Escalation
CVECVE-2020-0796
CategoryOutdated Components

Description

The host runs a Windows release whose SMB 3.1.1 implementation is missing the update for CVE-2020-0796, known as SMBGhost or CoronaBlue. The flaw is in the way the SMB server and client handle compressed messages, a feature introduced in Windows 10 version 1903: size values in the compression header are not checked, so a crafted message causes an integer overflow and memory corruption in the kernel. Only Windows 10 versions 1903 and 1909 and Windows Server versions 1903 and 1909 (Server Core installations) are affected, and Microsoft released the fix in March 2020. These releases are no longer supported, so a vulnerable host is usually missing other security updates as well.

Public exploit code followed quickly: crashing the system is straightforward, local privilege escalation exploits were published within weeks, and a remote code execution exploit was published in June 2020, prompting an alert from CISA. An unauthenticated attacker who can reach TCP port 445 can crash the host, a denial of service that works consistently, and with the published exploit can potentially run code in the kernel and gain complete control of it, although the remote code execution exploit is less dependable. A local user can use the flaw to gain SYSTEM privileges, and because the SMB client is also affected, a user who connects to a malicious SMB server could have their computer compromised.

Network checks look for SMB 3.1.1 compression support on an affected release. Because a patched host still offers compression, such a result should be confirmed against the operating system build or the installed updates.

Remediation

Update or upgrade the host:

  • Install the March 2020 security update for the release (KB4551762) or any later cumulative update.
  • Because Windows 10 and Windows Server versions 1903 and 1909 are no longer supported, upgrade the host to a supported release so that it continues to receive security updates.
  • Until the host can be updated, disable SMBv3 compression on the server with the workaround Microsoft published, which sets the DisableCompression DWORD value to 1 under HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters, as below. The workaround does not protect the SMB client.
  • Block TCP port 445 at the internet boundary and between network segments where SMB is not needed, and block outbound SMB to the internet so that users cannot connect to malicious servers.
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" DisableCompression -Type DWORD -Value 1 -Force

Confirm the fix by checking that the operating system build includes the March 2020 update or later.

References


Add This Finding to Your Library

In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.

Free trial  ·  No card required

Only need the reporting? Our reporting tool is free and open source, with the same library.


More Network Services Findings

Every Network Services finding