CVE-2022-22005
A deserialisation flaw in SharePoint's chart preview image control allowed an authenticated user to execute arbitrary code by supplying a crafted session key that pointed to attacker-controlled binary data stored via an InfoPath attachment. The attacker could then trigger deserialisation of that data, leading to remote code execution.
hnd3884.github.io
Published on hnd3884.github.io
SharePoint is a platform for sharing and managing content, knowledge, and apps to support teamwork, quickly finding information, and collaborating seamlessly across the organization. More than 200,000 organizations and 190 million people use SharePoint for intranets, team sites, and content management.
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
The ChartPreviewImage control deserialised binary data from session state using BinaryFormatter without restricting the types that could be instantiated, and the session key could be manipulated to point at attacker-controlled data.
Impact
An authenticated user with default permissions could execute arbitrary code on the SharePoint server, potentially leading to full compromise.
What the attacker needed
A SharePoint account with default permissions; ability to create an InfoPath list
The fix
Microsoft fixed the issue by applying a binder that restricts the types allowed during deserialisation.
How it was found
- Create an InfoPath list on the site.
- Open the form to create a new item and save the itemId from the response.
- Attach a file containing the payload to that item but do not save, so the session state stays in the database.
- Send the itemId to FormServerAttachments.aspx and save the attachmentId from the response.
- Use the attachmentId in a request to ChartPreviewImage to trigger deserialisation.
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 is a Microsoft product for sharing documents and building internal websites. A part of it that draws charts took data from a storage area and turned it back into an object without checking what kind of object it was. An attacker with a normal account could plant harmful data there and make the server turn it into code, giving them control of 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.