Back to blog

Making Sense of the SharePoint 'ToolShell' Zero-Day and Insecure Deserialization

Imagine an absolute monster of a zero-day exploit that bypasses authentication, allows remote code execution, and steals keys for persistent access, even after patching. That is the reality (nightmare?) that Microsoft SharePoint on-premises users find themselves in today, thanks to CVE-2025-53770, aka "ToolShell." However, for the many SOC managers, analysts, and incident responders that are thankfully not affected by this zero-day, what lessons can be learned? Let's break it down, shall we?

What is CVE-2025-53770 ("ToolShell")?

CVE-2025-53770 is a critical zero-day Remote Code Execution (RCE) vulnerability affecting Microsoft SharePoint Server and is actively being exploited in the wild. The vulnerability allows unauthenticated attackers to execute arbitrary code on affected on-premises SharePoint Server 2016, 2019, and Subscription Edition deployments, as well as unsupported versions 2010 and 2013. This vulnerability has been actively exploited in large-scale cyberattacks, impacting hundreds of organizations globally, including major corporations and US government agencies across various sectors like government, healthcare, finance, education, and manufacturing. SharePoint Online (Microsoft 365) is not affected.

What is the fundamental nature and root cause of "ToolShell"?

The root cause of CVE-2025-53770 is insecure deserialization of untrusted data. Deserialization is the process of converting data back into an object that an application can use. When an application deserializes user-supplied data without proper validation, it can be tricked into loading and executing malicious code. In the case of "ToolShell," this flaw allows a remote, unauthenticated attacker to execute arbitrary code over the network without any user interaction.

What is the "ToolShell" exploit chain?

The "ToolShell" exploit is a sophisticated, multi-stage attack designed for long-term persistence:

  • Stage 1: Authentication Bypass (CVE-2025-53771): Attackers are able to bypass authentication by crafting a request that mimics a legitimate SharePoint workflow. Specifically, it involves a crafted POST request to /_layouts/15/ToolPane.aspx?DisplayMode=Edit with a forged Referer header (e.g., /_layouts/SignOut.aspx). This grants attackers unauthenticated and privileged access to the SharePoint server.
  • Stage 2: Remote Code Execution via Deserialization (CVE-2025-53770): With the privileged access gained in Stage 1, attackers can run arbitrary commands on the SharePoint server via a deserialization flaw in the ToolPane.aspx page. 
  • Stage 3: Theft of Cryptographic Keys: To maintain persistent access, attackers can upload web shells (e.g., spinstall0.aspx), steal ASP.NET machine keys (ValidationKey, DecryptionKey), forge authentication tokens and __VIEWSTATE payloads, and maintain persistent access. This access survives server restarts and removal of web shells, creating a "permanent backdoor" for attackers on the host.

Why do insecure deserialization vulnerabilities persist in the industry?

Despite being a known risk (OWASP Top 10 2021 categorized this under "Software and Data Integrity Failures"), insecure deserialization remains a challenge due to:

  • Limitations of Traditional Defenses: Web Application Firewalls (WAFs) struggle to effectively parse and inspect the complex, application-specific, and often encoded/encrypted serialized payloads used in these attacks. They lack the deep runtime context needed. Similarly, Endpoint Detection and Response (EDR) tools often "lack the runtime context to detect the growing threats" at the application layer.
  • The "Hidden" Threat: These vulnerabilities are often underreported because efficient tools for their identification are lacking, and human intervention is frequently needed for validation. This means they often reach production environments, only to be discovered through active exploitation.
  • The AI Speed Paradox: The accelerating pace of AI-powered code generation and rapid deployment cycles introduces new vulnerabilities and widens the window of opportunity for attackers. Attackers can exploit new flaws in as little as 5 days, while patching critical vulnerabilities can take 84 days on average.

How can security professionals proactively defend against these complex threats?

Given the limitations of reactive patching and network-level defenses, a proactive, "inside-out" security strategy is essential. This involves Application Detection and Response (ADR). The technology embeds security directly within the running application or its runtime environment, allowing for real-time detection and blocking of attacks at their source, even for novel exploits, by monitoring application behavior and context.

How does Contrast Application Detection and Response (ADR) protect against insecure deserialization and RCE (CWEs)?

Contrast Security's Application Detection and Response (ADR) platform offers a robust solution by operating with deep security instrumentation, embedding sensors directly into the application's runtime environment.

  • Deep Runtime Visibility: Contrast ADR's sensors are woven into the application at runtime, allowing it to extract critical contextual information like data flow, control flow, and actual data values. This enables it to monitor the deserialization process itself, detecting malicious payloads or unexpected object constructions as they occur within the application's memory.
  • Behavior-Based Detection and Real-time Blocking: Unlike signature-based tools, Contrast ADR identifies and blocks malicious activity based on anomalous behavior within the application layer. For Remote Code Execution (RCE), it detects attempts to execute arbitrary commands or spawn unauthorized processes, even for zero-day exploits like "ToolShell," and can block them in real-time.
  • Contextual Intelligence with the Contrast Graph: The Contrast Graph builds a real-time "digital twin" of your application and API environment, mapping live attack paths and correlating runtime behavior. This provides a comprehensive view of how malicious data enters, where it's deserialized, and its impact, enabling precise detection and response.
  • Zero-Day and Post-Exploitation Protection: Contrast ADR continuously detects and prevents both known threats and zero-day attacks. It can block the initial deserialization attempt or monitor for post-exploitation activities such as web shell creation, attempts to exfiltrate sensitive data like cryptographic keys, or lateral movement techniques (e.g. Mimikatz, PsExec, WMI).
  • AI-Powered Remediation Guidance: The platform provides AI-powered guidance for remediation, offering clear, actionable steps to developers on how to fix identified vulnerabilities at the code level. This approach helps address the root cause earlier, reducing remediation costs and time.
  • Agentic Remediation: Contrast AI SmartFix leverages the deep context of the Contrast Graph to generate precise vulnerability fixes and automatically prepares a pull request to streamline remediation.

Conclusion

The "ToolShell" exploit is a stark reminder that insecure deserialization remains a critical threat, capable of bypassing traditional defenses and establishing persistent footholds. For SOC teams, relying solely on reactive patching is no longer sufficient. Proactive, runtime application security solutions like Contrast ADR are essential. By providing deep, real-time visibility and behavior-based protection directly within the application, they empower your team to detect, respond to, and ultimately prevent the exploitation of these complex and evolving vulnerabilities, safeguarding your critical digital assets in an increasingly hostile landscape.

To see how Contrast stops zero-day attacks, even when there’s no available patch, watch the product tour.

Naomi Buckwalter

Naomi Buckwalter

Naomi Buckwalter, CISSP CISM, is the Senior Director of Product Security for Contrast Security and author of the LinkedIn course: “Training today for tomorrow’s solutions – Building the Next Generation of Cybersecurity Professionals”. She has over 20 years’ experience in IT and Security and has held roles in Software Engineering, Security Architecture, Security Engineering, and Security Executive Leadership. A dynamic speaker and mentor, her passion is to cultivate the next generation of cybersecurity leaders through education and mentorship. Naomi has two Masters degrees from Villanova University and a Bachelors of Engineering from Stevens Institute of Technology.

Enlarged Image