CVE-2024-21389 Overview
CVE-2024-21389 is a stored cross-site scripting (XSS) vulnerability affecting Microsoft Dynamics 365 (on-premises). The flaw is classified under [CWE-79], improper neutralization of input during web page generation. An authenticated attacker with low privileges can inject malicious script content that executes in the browser of another Dynamics 365 user who interacts with the affected component.
Successful exploitation results in a scope change, allowing script execution in the context of a different security authority. The vulnerability impacts confidentiality highly and integrity to a lower degree, but does not affect availability. Microsoft published guidance through the Microsoft Security Response Center (MSRC) update guide.
Critical Impact
Authenticated attackers can execute arbitrary script in victim browsers, hijack Dynamics 365 sessions, and exfiltrate business data such as customer records and CRM content.
Affected Products
- Microsoft Dynamics 365 (on-premises)
- Deployments exposing customized entity forms and web resources
- Environments where users interact with untrusted record content
Discovery Timeline
- 2024-02-13 - CVE-2024-21389 published to NVD
- 2026-08-10 - Last updated in NVD database
Technical Details for CVE-2024-21389
Vulnerability Analysis
The vulnerability resides in how Microsoft Dynamics 365 (on-premises) renders user-supplied content within its web interface. Input submitted through record fields, forms, or web resources is not sufficiently neutralized before being reflected back to other users' browsers. When a victim views the poisoned data, the browser interprets attacker-controlled markup as executable JavaScript.
An attacker must authenticate to the Dynamics 365 instance and requires user interaction from the victim to trigger execution. Because the flaw crosses a security scope, code executed in the victim's session can act on data and permissions the attacker would not otherwise reach. Typical outcomes include session token theft, form manipulation, and unauthorized retrieval of CRM records.
Root Cause
The root cause is improper output encoding of user-controlled input rendered inside Dynamics 365 web pages. The application accepts input containing HTML or JavaScript control characters and emits it into the response without context-appropriate escaping. This violates [CWE-79] guidance on neutralizing script constructs during web page generation.
Attack Vector
Exploitation occurs over the network against the Dynamics 365 web interface. The attacker plants a malicious payload in a field or resource accessible to other users. When a privileged user opens the record, the payload runs in that user's browser context, inheriting their Dynamics 365 privileges and session state.
No verified public proof-of-concept code is available. Refer to the Microsoft Security Update CVE-2024-21389 advisory for vendor-supplied technical details.
Detection Methods for CVE-2024-21389
Indicators of Compromise
- Dynamics 365 record fields containing <script> tags, javascript: URIs, or encoded HTML event handlers such as onerror= or onload=.
- Outbound HTTP requests from user browsers to unfamiliar domains immediately after opening a Dynamics 365 record.
- Unexpected session token or cookie values appearing in web server access logs referencing Dynamics 365 pages.
Detection Strategies
- Inspect Dynamics 365 audit logs for record modifications that introduce HTML or script markup in text fields.
- Deploy web application firewall (WAF) rules that flag script-like payloads submitted to Dynamics 365 endpoints.
- Correlate authentication anomalies with recent record views to identify potential session hijacking following XSS execution.
Monitoring Recommendations
- Enable and centralize IIS and Dynamics 365 application logs in a SIEM for query and alerting on suspicious field content.
- Monitor browser-side telemetry, including Content Security Policy (CSP) violation reports, from clients accessing Dynamics 365.
- Track privileged user sessions for behavioral deviations such as bulk record exports following record views.
How to Mitigate CVE-2024-21389
Immediate Actions Required
- Apply the security update referenced in the Microsoft Security Update CVE-2024-21389 advisory to all Dynamics 365 (on-premises) instances.
- Audit existing records and custom web resources for previously injected script content and sanitize identified entries.
- Rotate credentials and session tokens for users who may have viewed attacker-controlled records prior to patching.
Patch Information
Microsoft has published a security update for Dynamics 365 (on-premises) through MSRC. Administrators should follow the update guide at Microsoft Security Update CVE-2024-21389 to obtain the applicable patch for their deployment version and apply it during a controlled maintenance window.
Workarounds
- Restrict Dynamics 365 authoring privileges to trusted users to reduce the pool of accounts capable of injecting content.
- Enforce a strict Content Security Policy (CSP) on Dynamics 365 web endpoints to limit inline script execution.
- Require multi-factor authentication for all Dynamics 365 users to reduce the value of any stolen session tokens.
- Educate users to avoid interacting with unexpected records or links inside the Dynamics 365 interface until patched.
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

