Skip to content
RCE Write-up Advanced

New Wine in Old Bottle - Microsoft Sharepoint Post-Auth Deserialization RCE (CVE-2022-29108)

A post-authentication deserialization vulnerability in Microsoft SharePoint allowed an attacker to execute arbitrary code by supplying a crafted session key to the ChartPreviewImage page, which deserialized binary data from the State Service without proper type validation. The attacker could achieve remote code execution by uploading a malicious file and triggering deserialization.

Nguyễn Tiến Giang Follow

Published on starlabs.sg

Recently, I have had a some work which is related to Sharepoint, so I was learning on how to setup and debug old bugs of Sharepoint.

Nguyễn Tiến Giang (@testanull), on starlabs.sg

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 application deserialized untrusted binary data from the State Service using BinaryFormatter without a SerializationBinder to restrict allowed types, enabling arbitrary object deserialization.

What the attacker needed

Authenticated user account; State Service enabled; Self-Service Site Creation enabled

The fix

The vulnerability was fixed by adding a SerializationBinder to restrict deserialization to safe types.

How it was found

  1. Create a list using Microsoft InfoPath and publish a form.
  2. Upload a file containing a gadget chain as an attachment to a new list item.
  3. Capture the itemId from the upload response.
  4. Use the itemId to generate a key parameter for a request to FormServerAttachments.aspx.
  5. Send the request to FormServerAttachments.aspx to obtain an attachmentId.
  6. Use the attachmentId as the session key in a request to ChartPreviewImage.aspx to trigger deserialization.

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.

This report describes a security flaw in Microsoft SharePoint, a collaboration platform. An attacker who already has a user account could trick the server into running harmful code by sending a specially crafted request. The server would then execute the attacker's code, giving them control over the system.

What is RCE?

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

More by Nguyễn Tiến Giang

View all

6 more disclosed reports, best first.

More from Microsoft

View all

The newest disclosed reports for this program.

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.