Skip to content
RCE Write-up Advanced

CVE-2020-0932: Remote Code Execution on Microsoft SharePoint Using TypeConverters

SharePoint did not restrict the .NET types allowed when parsing WebPart XML configuration, so an authenticated user could specify a malicious type and its TypeConverter to load a remote .resources file from an attacker-controlled SMB share, leading to deserialization and remote code execution. The attacker could execute arbitrary code in the context of the SharePoint service account.

zerodayinitiative.com

Published on zerodayinitiative.com

In April 2020, Microsoft released four Critical and two Important-rated patches to fix remote code execution bugs in Microsoft SharePoint. All these are deserialization bugs.

The author, on zerodayinitiative.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the WebPart XML parser did not restrict which .NET types could be used for property conversion, allowing a dangerous TypeConverter to instantiate an object that deserialises attacker-controlled data.

Impact

An authenticated user with page customization rights could execute arbitrary code as the SharePoint service account, potentially compromising the entire server.

What the attacker needed

Authenticated SharePoint user; Add or Customize Pages permission; attacker-controlled SMB share

The fix

Microsoft fixed the vulnerability by correcting how SharePoint checks the source markup of application packages.

How it was found

  1. Authenticate to SharePoint as a regular user.
  2. Create a new site (or find a page where the user has Add or Customize Pages permission).
  3. Set up an anonymous SMB share containing a malicious .resources file.
  4. Send a SOAP request to the WebPartPages web service with a WebPart XML payload that specifies the malicious type and the remote path to the .resources file.
  5. The server loads the .resources file from the SMB share and deserialises it, executing the payload.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

SharePoint lets users build pages using small building blocks called WebParts, and the settings for a WebPart are stored as XML. The bug is that SharePoint trusted the type name written in that XML and used it to convert a string into an object, without checking whether the type was safe. By choosing a dangerous type, an attacker could make the server download a file from a share they control and then deserialise it, which runs their code on the server.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.