CVE-2024-30043: Abusing URL Pa... Note

CVE-2024-30043: Abusing URL Parsing Confusion to Exploit XXE on SharePoint Server and Cloud

A security researcher discovered an XML eXternal Entity (XXE) injection vulnerability in SharePoint, which allows for file reading, server-side request forgery (SSRF), and NTLM relaying. The vulnerability, known as CVE-2024-30043, is present in the Microsoft.SharePoint.WebControls.BaseXmlDataSource class. The researcher found that the XXE could be exploited by creating an XmlUrlDataSource and fetching malicious XML from an HTTP server. However, the XmlSecureResolver, which is used to apply resource fetching restrictions, prevents the XXE from being fully exploited. The researcher then discovered that SPXmlDataSource can handle a malformed URL, leading to an unrestricted access policy in XmlSecureResolver. This allows for full exploitation of the XXE and file reading. The researcher demonstrated the entire exploitation scenario and attached a demo for visualization. Microsoft has since patched the vulnerability with two main changes: more URL parsing controls for SPXmlDataSource and prohibiting DTD usage in the XmlTextReader object.