Skip to main content
Mallory
HighPublic exploitVulnerability

CVE-2021-31195: Microsoft Exchange Server CAS Reflected Cross-Site Scripting

Published May 11, 2021 · Updated 1 month ago
Trending this weekNot trendingOutside this week’s top 100
Mention activity · 30 daysNo mention activity in the last 30 days.
CVSS8.8High · v3.1
EPSS73.7%100th percentile
CISA KEVNoNot listed
In the wildNonePublic exploit, no exploitation reported
Vendor
Microsoft Corporation
IdentifiersCVE-2021-31195CWE-79

CVE-2021-31195 is a reflected cross-site scripting vulnerability in the Microsoft Exchange Server Client Access Server frontend. Exchange fails to sanitize attacker-controlled data before embedding it in JSON on an Outlook Web Access error page, allowing injected JavaScript to execute in the security context of a victim's Exchange origin. It is one component of the ProxyOracle exploit chain with CVE-2021-31196.

Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Analyst brief

Impact, mitigation & remediation

What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

An attacker can execute arbitrary JavaScript in a victim's browser under the affected Exchange origin. In the ProxyOracle chain, the XSS can be used to configure Exchange proxy behavior that causes victim browser requests to be relayed to attacker-controlled infrastructure, enabling interception of HttpOnly-protected Form-Based Authentication cookies. Those cookies can subsequently be subjected to the CVE-2021-31196 padding oracle to recover Exchange credentials in plaintext.

Mitigation

If you can’t patch tonight, do this now.

If immediate patching is not possible, reduce exposure of internet-facing Exchange services, restrict access to Exchange administrative and client access endpoints to trusted networks where operationally feasible, and monitor for suspicious activity targeting Exchange. The available information does not provide a vulnerability-specific mitigation beyond vendor patching.

Remediation

Patch, then assume compromise.

Apply Microsoft's May 11, 2021 security update for Microsoft Exchange Server addressing CVE-2021-31195.

Public exploits

Exploits

1 exploit validated by Mallory's analysis.

View more in app →
ProxyVulnsThis repository contains operational exploit scripts for multiple high-profile Microsoft Exchange Server vulnerabilities: ProxyLogon (CVE-2021-26855, etc.), ProxyOracle (CVE-2021-31196), and ProxyShell (CVE-2021-34473, CVE-2021-31207). The structure includes four main Python scripts: - 26855.py: Implements the ProxyLogon exploit chain, culminating in the upload of a JScript webshell (api.aspx) to the Exchange server by abusing the OAB virtual directory. It automates the process of obtaining necessary tokens and SIDs, and provides a final webshell URL for remote code execution. - 31196.py: Implements the ProxyOracle padding oracle attack, allowing extraction of plaintext credentials from encrypted session cookies by exploiting a padding oracle vulnerability in OWA. It requires a valid 'cadata' cookie and outputs the decrypted username and password. - 34473.py: Implements the ProxyShell exploit chain, allowing remote PowerShell command execution on the Exchange server. It automates the process of obtaining a valid CommonAccessToken and then uses pypsrp to execute arbitrary PowerShell scripts remotely. - 31207.py: Works with 34473.py to deliver arbitrary files (e.g., malicious PDFs) to user mailboxes and then exports mailbox contents to a specified UNC path, leveraging Exchange's mailbox export features. A users.txt file provides a list of default or known usernames to assist in the exploitation process. The README.md gives usage instructions and references for each exploit. The scripts are operational and automate the full exploitation process, including credential extraction, webshell upload, remote command execution, and file delivery. The main attack vector is network-based, targeting exposed Exchange web services (ECP, OWA, Autodiscover, EWS, and PowerShell endpoints).hosch3n · Disclosed Apr 14, 2021 · python · networkOperational
Exposure surface

Affected products & vendors

Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.

VendorProductType
Microsoft CorporationExchange Serverapplication
FAQ

Frequently asked questions

Is CVE-2021-31195 exploited in the wild?
As of Oct 16, 2026, Mallory has no reports of CVE-2021-31195 being exploited in the wild. It is not listed in CISA KEV.
Is there a public exploit for CVE-2021-31195?
Yes. Mallory tracks 1 public exploit or proof of concept for CVE-2021-31195, the earliest disclosed Apr 14, 2021.
Is there a patch for CVE-2021-31195?
Apply Microsoft's May 11, 2021 security update for Microsoft Exchange Server addressing CVE-2021-31195.
What products are affected by CVE-2021-31195?
Microsoft Corporation Exchange Server.
How severe is CVE-2021-31195?
CVE-2021-31195 has a CVSS v3.1 score of 8.8 (High) and an EPSS score of 73.7% (100th percentile) as of Oct 16, 2026.
Mallory platform

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, and which detections to deploy tonight.
Exposure mappingQuery your assets running an affected version, and investigate the blast radius.
Threat actor evidenceEvery report linking this CVE to a named adversary.
Associated malware1Malware families linked to this CVE, with evidence and IOCs.
Detection signaturesYARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Vendor-by-vendor mappingCross-references every affected SKU, including bundled OEM variants.
Social activityCommunity discussion across Reddit, Mastodon, and other social sources.