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.
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.
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
- Create a list using Microsoft InfoPath and publish a form.
- Upload a file containing a gadget chain as an attachment to a new list item.
- Capture the itemId from the upload response.
- Use the itemId to generate a key parameter for a request to FormServerAttachments.aspx.
- Send the request to FormServerAttachments.aspx to obtain an attachmentId.
- 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.