CVE-2025-67752
Executive Summary
CVE-2025-67752 is a critical security vulnerability in OpenEMR, a widely used open-source electronic health records (EHR) and medical practice management application. The flaw resides in the HTTP client wrapper (oeHttp/oeHttpRequest), which disables SSL/TLS certificate verification by default (verify: false). This misconfiguration makes all external HTTPS connections from the application vulnerable to man-in-the-middle (MITM) attacks. An attacker positioned on the network path between the OpenEMR server and any external API (e.g., government healthcare APIs, third-party services) can intercept, decrypt, and modify traffic, potentially exposing Protected Health Information (PHI). The vulnerability is present in all versions prior to 7.0.4.
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 a supply chain compromise of a package manager (NPM, PyPI, Go, Ruby). It is a direct code-level flaw in the OpenEMR application itself. However, the risk is amplified because OpenEMR often integrates with external healthcare APIs (e.g., for e-prescribing, lab results, insurance verification), and any compromise of those connections could lead to widespread PHI exposure.
CVSS Breakdown & Threat Level
- CVSS Score: 8.1 (High)
- Attack Vector (AV): Network (N) – The attacker must be on the same network segment as the OpenEMR server or be able to intercept traffic between the server and external APIs.
- Attack Complexity (AC): High (H) – The attacker needs to perform a MITM attack, which requires network access and the ability to intercept and modify traffic.
- Privileges Required (PR): None (N) – No authentication is needed to exploit the vulnerability.
- User Interaction (UI): None (N) – The victim does not need to perform any action.
- Scope (S): Unchanged (U) – The impact is confined to the vulnerable component.
- Confidentiality (C): High (H) – PHI and other sensitive data can be fully exposed.
- Integrity (I): High (H) – An attacker can modify data in transit, potentially altering medical records or API responses.
- Availability (A): High (H) – An attacker could disrupt communication with critical healthcare services.
Threat Level: High. The vulnerability is easy to exploit once network access is achieved, and the potential impact on patient privacy and data integrity is severe.
Deep Dive & Mechanics
The vulnerability is rooted in the oeHttp and oeHttpRequest classes, which are custom HTTP client wrappers used by OpenEMR. These wrappers are built on top of PHP's cURL library. The critical flaw is the hardcoded verify: false option, which disables SSL/TLS certificate validation.
How it works:
- Normal HTTPS Connection: When a client (e.g., a web browser) connects to an HTTPS server, it verifies the server's SSL/TLS certificate against a trusted Certificate Authority (CA). This ensures the server is who it claims to be and that the connection is encrypted.
- Vulnerable OpenEMR Connection: OpenEMR's
oeHttpwrapper, when making an HTTPS request, sets the cURL optionCURLOPT_SSL_VERIFYPEERtofalse. This tells cURL to accept any certificate presented by the server, even if it is self-signed, expired, or issued by an untrusted CA. - MITM Attack: An attacker on the same network (e.g., via ARP spoofing, rogue Wi-Fi, or compromised router) can intercept the connection. The attacker presents their own fake certificate to OpenEMR. Since OpenEMR does not verify the certificate, it accepts the attacker's certificate and establishes an encrypted connection with the attacker. The attacker then establishes a separate, legitimate HTTPS connection to the real external API. The attacker can now decrypt, read, and modify all data flowing between OpenEMR and the external API.
Affected Components:
library/oeHttp/oeHttpRequest.phplibrary/oeHttp/oeHttp.php
Root Cause: The verify option is set to false in the default configuration of the HTTP client wrapper.
Vulnerable vs. Patched Code
Vulnerable Code (Pre-7.0.4):
// library/oeHttp/oeHttpRequest.php
class oeHttpRequest {
private $verify = false; // VULNERABLE: Disables SSL verification
public function setVerify($verify) {
$this->verify = $verify;
}
public function execute() {
$ch = curl_init();
// ... other cURL options ...
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $this->verify);
// ... execute request ...
}
}
Patched Code (7.0.4+):
// library/oeHttp/oeHttpRequest.php
class oeHttpRequest {
private $verify = true; // FIXED: Enables SSL verification by default
public function setVerify($verify) {
$this->verify = $verify;
}
public function execute() {
$ch = curl_init();
// ... other cURL options ...
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $this->verify);
// ... execute request ...
}
}
Key Difference: The default value of the $verify property is changed from false to true. This ensures that SSL/TLS certificate verification is enabled by default for all HTTPS connections.
Exploitation & Lab Setup
Red Team (Attacker)
Objective: Intercept and decrypt HTTPS traffic from OpenEMR to an external API (e.g., a government healthcare API).
Lab Setup:
- Target: OpenEMR instance (version < 7.0.4) running on a local network (e.g., 192.168.1.100).
- Attacker Machine: Kali Linux (192.168.1.50).
- External API: A simulated healthcare API (e.g.,
https://api.healthcare.gov).
Exploitation Steps:
- ARP Spoofing: The attacker poisons the ARP cache of the OpenEMR server to redirect traffic destined for the external API to the attacker's machine.
arpspoof -i eth0 -t 192.168.1.100 192.168.1.1 - Enable IP Forwarding: Allow the attacker machine to forward traffic between the OpenEMR server and the real API.
echo 1 > /proc/sys/net/ipv4/ip_forward - Set up MITM Proxy (mitmproxy): The attacker uses
mitmproxyto intercept and decrypt the traffic.mitmproxy --mode transparent --listen-port 8080 - Redirect Traffic: Use
iptablesto redirect all HTTP/HTTPS traffic from the OpenEMR server to the mitmproxy.iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 8080 iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080 - Capture Data: The attacker can now view all decrypted traffic, including PHI, API keys, and authentication tokens, in the mitmproxy interface.
Expected Outcome: The attacker can read and modify all data exchanged between OpenEMR and the external API, including patient records, lab results, and insurance information.
Blue Team (Defender)
Objective: Detect and prevent MITM attacks exploiting this vulnerability.
Detection Steps:
- Network Monitoring: Monitor for ARP spoofing attacks using tools like
arpwatchor by analyzing network traffic for duplicate IP addresses. - SSL/TLS Inspection: Deploy a network-based SSL/TLS inspection solution (e.g., a forward proxy) that can detect connections where certificate validation is disabled.
- Log Analysis: Monitor OpenEMR logs for connections to external APIs that are not using proper certificate validation. Look for errors related to SSL/TLS.
- Honeypot: Set up a fake external API endpoint and monitor for connections that do not perform proper certificate validation.
Prevention Steps:
- Patch Immediately: Upgrade OpenEMR to version 7.0.4 or later.
- Network Segmentation: Isolate the OpenEMR server on a separate network segment with strict firewall rules.
- Use a VPN: Force all external API communication through a VPN tunnel to add an extra layer of encryption and authentication.
- Certificate Pinning: Implement certificate pinning in the application code to ensure only specific certificates are accepted.
Indicators of Compromise (IOCs)
- Network IOCs:
- Unusual ARP traffic (e.g., multiple IP addresses claiming the same MAC address).
- Connections to external APIs from unexpected IP addresses.
- SSL/TLS certificate errors in OpenEMR logs (e.g., "SSL certificate problem: self-signed certificate in certificate chain").
- Traffic to known malicious IP addresses or domains.
- Host IOCs:
- Modified
library/oeHttp/oeHttpRequest.phpfile withverifyset tofalse. - Presence of MITM tools (e.g.,
mitmproxy,bettercap) on the network.
- Modified
- Application IOCs:
- OpenEMR logs showing failed SSL/TLS handshakes.
- Unexpected changes to data received from external APIs.
Detection Engineering
YARA Rule
rule CVE_2025_67752_OpenEMR_SSL_Disable {
meta:
description = "Detects OpenEMR code that disables SSL/TLS certificate verification"
author = "Valters IT"
date = "2025-04-10"
cve = "CVE-2025-67752"
severity = "high"
strings:
$s1 = "verify: false" nocase
$s2 = "CURLOPT_SSL_VERIFYPEER" nocase
$s3 = "verify = false" nocase
condition:
any of ($s*) and filesize < 100KB
}
Sigma Rule
title: CVE-2025-67752 - OpenEMR SSL/TLS Verification Disabled
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects network connections from OpenEMR that may be vulnerable to MITM due to disabled SSL verification.
author: Valters IT
date: 2025/04/10
tags:
- attack.t1557.001
- cve.2025.67752
logsource:
category: network_connection
product: windows
service: sysmon
detection:
selection:
Image|endswith: '\php.exe'
DestinationPort: 443
Initiated: 'true'
filter:
- DestinationHostname: '*.healthcare.gov' # Example legitimate API
condition: selection and not filter
falsepositives:
- Legitimate connections to trusted APIs that are properly configured.
level: high
Suricata Rule
alert tcp $HOME_NET any -> $EXTERNAL_NET 443 (msg:"CVE-2025-67752 - OpenEMR Potential MITM - SSL Verification Disabled"; flow:to_server,established; content:"|16 03|"; depth:2; content:"|01|"; distance:0; within:1; content:"|00 00|"; distance:0; within:2; content:"|0b 00|"; distance:0; within:2; content:"|00 00 00 00 00 00 00 00|"; distance:0; within:8; reference:cve,2025-67752; classtype:attempted-recon; sid:1000001; rev:1;)
Note: The Suricata rule above is a simplified example. A more accurate detection would require deep packet inspection of the TLS handshake to detect missing certificate validation, which is complex. The rule above looks for a specific pattern in the TLS Client Hello that might indicate a vulnerable client, but it is not foolproof.
Remediation & Mitigation
Immediate Actions:
- Patch: Upgrade OpenEMR to version 7.0.4 or later immediately. This is the only complete fix.
- Workaround: If patching is not immediately possible, manually edit the
library/oeHttp/oeHttpRequest.phpfile and changeprivate $verify = false;toprivate $verify = true;. This will restore SSL verification. - Network Controls: Implement strict firewall rules to limit outbound connections from the OpenEMR server to only known and trusted external APIs.
- Monitor: Enable detailed logging for all outbound HTTPS connections and monitor for anomalies.
Long-Term Mitigations:
- Code Review: Conduct a thorough code review of all custom HTTP client wrappers to ensure SSL/TLS verification is enabled by default.
- Security Training: Train developers on secure coding practices, especially regarding SSL/TLS and certificate validation.
- Vulnerability Scanning: Regularly scan the OpenEMR instance for known vulnerabilities using tools like OpenVAS or Nessus.
- Web Application Firewall (WAF): Deploy a WAF to inspect and filter traffic to and from the OpenEMR application.
Valters IT
This report is generated for educational and defensive purposes. Unauthorized exploitation of this vulnerability is illegal.