Web Exploitation · Term

What is ToolShell?

In July 2025, one unauthenticated request chain gave attackers code execution on on-premises SharePoint, and stolen machine keys let them keep access after the patch. ToolShell is why "patch and rotate keys" became the advice.

TL;DR

ToolShell is the name for a remote code execution chain in on-premises Microsoft SharePoint Server, tracked as CVE-2025-53770 (deserialization of untrusted data, CVSS 9.8) and CVE-2025-53771 (an authentication bypass through path traversal). They are bypasses of CVE-2025-49704 and CVE-2025-49706, first shown at Pwn2Own in May 2025 and patched in July. Attackers posted to ToolPane.aspx without logging in, dropped a web shell and stole the ASP.NET machine keys. SharePoint 2016, 2019 and Subscription Edition were affected; SharePoint Online was not.

By Pranav Khune, Lead Pentester, SecureLayer7Updated

What ToolShell is

SharePoint Server is Microsoft's on-premises collaboration platform, built on ASP.NET and Internet Information Services (IIS). ToolShell chains two flaws:

  • An authentication bypass (CVE-2025-49706, then its bypass CVE-2025-53771). A request to /_layouts/15/ToolPane.aspx with a Referer header pointing at the sign-out page was treated as trusted, so the endpoint ran without a login.
  • Deserialization of untrusted data (CVE-2025-49704, then its bypass CVE-2025-53770). ToolPane processed attacker-supplied data in a way that rebuilt .NET objects from it, a classic insecure deserialization path to code execution.

The original pair was demonstrated at Pwn2Own Berlin in May 2025 and patched on July 8, 2025. Attackers found variants that slipped past those patches within days, and Microsoft issued emergency updates on July 20 and 21, 2025 under the new CVE numbers. CISA added CVE-2025-53770 to its Known Exploited Vulnerabilities catalog, and MITRE tracks the activity as campaign C0058.

How the attack worked

Shown for defensive context, the campaign followed a consistent pattern:

  • A crafted POST to /_layouts/15/ToolPane.aspx?DisplayMode=Edit with Referer: /_layouts/SignOut.aspx, carrying the deserialization payload.
  • A [web shell](/learn/persistence/what-is-a-web-shell) written as spinstall0.aspx (and variants) in the _layouts/15/ folder.
  • Machine key theft. The shell read the ASP.NET ValidationKey and DecryptionKey from web.config. With those keys an attacker can sign their own __VIEWSTATE payloads, which SharePoint then deserializes as trusted, so they keep code execution even after the bug is patched.
  • Follow-on activity: credential theft with Mimikatz, lateral movement with PsExec and Impacket, disabling Microsoft Defender and, in some intrusions, ransomware.

Espionage and ransomware groups both used the chain against finance, education, energy, healthcare and government targets.

How to fix and defend

  • Install the July 2025 SharePoint security updates or later for SharePoint Server 2016, 2019 and Subscription Edition. Out-of-support versions such as SharePoint 2013 get no fix.
  • Rotate the ASP.NET machine keys after patching, with Update-SPMachineKey in PowerShell or the Machine Key Rotation timer job, then restart IIS on every server in the farm.
  • Turn on AMSI integration (the Antimalware Scan Interface, Full Mode) with an endpoint protection product, which Microsoft recommended as a compensating control.
  • Hunt for spinstall0.aspx or other unexpected .aspx files in _layouts, POSTs to ToolPane.aspx with a sign-out referer in IIS logs, and w3wp.exe spawning cmd.exe or powershell.exe.
  • Reduce exposure. Do not publish on-premises SharePoint directly to the internet without an authenticating gateway in front of it.

References

  1. [1]NVD: CVE-2025-53770(NIST NVD)
  2. [2]NVD: CVE-2025-53771(NIST NVD)
  3. [3]MITRE ATT&CK: SharePoint ToolShell Exploitation (C0058)(MITRE)
  4. [4]MITRE CWE-502: Deserialization of Untrusted Data(MITRE)
  5. [5]CISA Known Exploited Vulnerabilities Catalog(CISA)
Related terms
Related service
Web & API Penetration Testing
Manual, exploit-grade testing of your web apps and APIs, mapped to OWASP, with fixes a developer can ship.
Web & API testing

Common questions

ToolShell, asked often

Want your servers and dependencies tested for flaws like this?

Test your application

Find the path to a shell before an attacker does.

Our testers check what your servers actually run, prove whether a named vulnerability is exploitable in your environment, and hand your developers a reproducible finding and a fix.

See web application penetration testing30-min scoping call, fixed-price proposal in 48 hours.