Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2024-21393

CVE-2024-21393: Microsoft Dynamics 365 XSS Vulnerability

CVE-2024-21393 is a cross-site scripting vulnerability in Microsoft Dynamics 365 on-premises that allows attackers to inject malicious scripts into web pages. This article covers technical details, affected versions, and mitigation.

Published:

CVE-2024-21393 Overview

CVE-2024-21393 is a cross-site scripting (XSS) vulnerability affecting Microsoft Dynamics 365 (on-premises). The flaw allows an authenticated attacker with low privileges to inject malicious script that executes in the context of a victim's browser session when the victim interacts with a crafted link or resource. Successful exploitation results in a scope change, enabling the attacker to impact resources beyond the vulnerable component. Microsoft published the advisory on February 13, 2024, and tracks the issue under CWE-79: Improper Neutralization of Input During Web Page Generation.

Critical Impact

Authenticated attackers can execute arbitrary script in a victim's browser session, hijack Dynamics 365 sessions, exfiltrate business data, and pivot to other application contexts.

Affected Products

  • Microsoft Dynamics 365 (on-premises)
  • Deployments matching CPE cpe:2.3:a:microsoft:dynamics_365:*:*:*:*:on-premises:*:*:*
  • On-premises Dynamics 365 instances without the February 2024 security update applied

Discovery Timeline

  • 2024-02-13 - CVE-2024-21393 published to NVD and Microsoft releases security update
  • 2026-08-10 - Last updated in NVD database

Technical Details for CVE-2024-21393

Vulnerability Analysis

The vulnerability is a stored or reflected cross-site scripting issue in Microsoft Dynamics 365 (on-premises). Dynamics 365 fails to properly neutralize user-supplied input before rendering it in web pages served to other users. An authenticated attacker with access to submit content into Dynamics 365 records or fields can inject JavaScript payloads. When a targeted user opens the affected view, the attacker's script executes in the browser under the Dynamics 365 origin.

Because the CVSS vector indicates a scope change, the injected script can affect components beyond the vulnerable module. Attackers can steal authentication tokens, perform actions on behalf of the victim, or redirect the browser to attacker-controlled infrastructure. The vulnerability requires user interaction, meaning the victim must open a crafted link, record, or view.

Root Cause

The root cause is improper output encoding of untrusted input rendered by the Dynamics 365 web interface, classified as CWE-79. Fields that accept user content are not sanitized or contextually encoded before being returned in HTML responses, allowing script tags and event handlers to execute.

Attack Vector

Exploitation follows a standard stored XSS pattern. An authenticated attacker submits a payload containing JavaScript into a Dynamics 365 field, record, or resource that will later be rendered to another user. When a privileged user views the record, the browser executes the payload with the victim's session context. The attacker can then issue authenticated requests to Dynamics 365 APIs, harvest cookies not marked HttpOnly, or manipulate the DOM to phish credentials. No verified public proof-of-concept has been published, and the vulnerability is not listed in the CISA Known Exploited Vulnerabilities catalog.

No verified exploit code is publicly available. Refer to the Microsoft advisory for technical details:
https://msrc.microsoft.com/update-guide/vulnerability/CVE-2024-21393

Detection Methods for CVE-2024-21393

Indicators of Compromise

  • Dynamics 365 records or fields containing HTML tags such as <script>, <img onerror=>, <svg onload=>, or JavaScript URI schemes
  • Outbound browser requests from Dynamics 365 user sessions to unfamiliar external domains shortly after opening a record
  • Unexpected session token usage or API calls originating from user accounts that recently viewed suspicious records

Detection Strategies

  • Review Dynamics 365 audit logs for record updates that inject HTML or script markup into text fields
  • Deploy web application firewall (WAF) rules that inspect Dynamics 365 form submissions for XSS payloads and encoded script fragments
  • Correlate anomalous user activity, such as bulk record exports or permission changes, with prior views of user-modified content

Monitoring Recommendations

  • Enable and centralize Dynamics 365 audit trails covering entity create, update, and read events
  • Monitor browser telemetry from endpoints accessing Dynamics 365 for suspicious script execution and cross-origin requests
  • Alert on Content Security Policy (CSP) violation reports generated by Dynamics 365 origins

How to Mitigate CVE-2024-21393

Immediate Actions Required

  • Apply the February 2024 Microsoft security update for Dynamics 365 (on-premises) as referenced in the Microsoft Security Update Guide
  • Inventory all on-premises Dynamics 365 deployments and confirm patch status across environments
  • Rotate session tokens and review privileged user activity for the period preceding patch deployment

Patch Information

Microsoft addressed CVE-2024-21393 in the February 13, 2024 security update for Dynamics 365 (on-premises). Administrators should consult the Microsoft Security Update Guide for the specific update package matching their Dynamics 365 version and deployment topology. Apply the update to all front-end and application servers hosting Dynamics 365 workloads.

Workarounds

  • Restrict Dynamics 365 write permissions to trusted users until the security update is applied
  • Enforce a strict Content Security Policy on Dynamics 365 origins to limit inline script execution
  • Require multi-factor authentication for Dynamics 365 access to reduce the value of hijacked sessions
bash
# Example: verify installed Dynamics 365 update level on the application server
Get-HotFix | Where-Object { $_.HotFixID -match 'KB' } | Sort-Object InstalledOn -Descending

# Example: query Dynamics 365 version via PowerShell
Get-ItemProperty 'HKLM:\Software\Microsoft\MSCRM' | Select-Object CRM_Server_Version

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.