CVE-2017-12795

9.8 CRITICAL

📋 TL;DR

CVE-2017-12795 is an improper input validation vulnerability in OpenMRS HTML Form Entry module that allows attackers to execute arbitrary code on affected systems. This affects OpenMRS installations using the vulnerable module version, potentially compromising patient health data and system integrity. The vulnerability stems from insufficient validation of user-supplied input in the HTML form processing component.

💻 Affected Systems

Products:
  • OpenMRS HTML Form Entry Module
Versions: Version 3.3.2 specifically
Operating Systems: Any OS running OpenMRS (typically Linux/Windows)
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects systems with the HTML Form Entry module installed and enabled. OpenMRS core without this module is not vulnerable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete system compromise allowing remote code execution, data exfiltration of sensitive patient health information, and potential ransomware deployment across the healthcare system.

🟠

Likely Case

Unauthorized access to patient records, modification of medical data, and potential installation of backdoors for persistent access to the healthcare system.

🟢

If Mitigated

Limited impact with proper input validation and sanitization, potentially only causing application errors or denial of service.

🌐 Internet-Facing: HIGH - The vulnerability affects web-based healthcare systems that are often internet-accessible for patient and provider access.
🏢 Internal Only: MEDIUM - Even internally deployed systems are at risk from insider threats or compromised internal devices.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

The CVSS 9.8 score indicates critical severity with network access and no authentication required. While no public exploit code is documented, the vulnerability type suggests straightforward exploitation.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Versions after commit 86f35221c8a57cdd7557ce731a56b90db216c8e0

Vendor Advisory: https://github.com/openmrs/openmrs-module-htmlformentry/commit/86f35221c8a57cdd7557ce731a56b90db216c8e0

Restart Required: Yes

Instructions:

1. Update OpenMRS HTML Form Entry module to latest version. 2. Apply commit 86f35221c8a57cdd7557ce731a56b90db216c8e0. 3. Restart OpenMRS application server. 4. Verify module functionality post-update.

🔧 Temporary Workarounds

Disable HTML Form Entry Module

all

Temporarily disable the vulnerable module if immediate patching isn't possible

# In OpenMRS administration interface, navigate to Module Management and disable 'htmlformentry' module

Web Application Firewall Rules

all

Implement WAF rules to block suspicious HTML form submissions

# Example ModSecurity rule: SecRule ARGS "@rx malicious_pattern" "id:1001,phase:2,deny"

🧯 If You Can't Patch

  • Implement strict input validation at application layer for all HTML form submissions
  • Deploy network segmentation to isolate OpenMRS systems from general network access

🔍 How to Verify

Check if Vulnerable:

Check OpenMRS module version via administration interface or examine module JAR file version metadata

Check Version:

# Check module version in OpenMRS: grep 'htmlformentry' /path/to/openmrs/modules/version.properties

Verify Fix Applied:

Verify module version is updated beyond vulnerable version and test HTML form submission functionality

📡 Detection & Monitoring

Log Indicators:

  • Unusual HTML form submission patterns
  • Exception stack traces containing input validation errors
  • Unexpected system command execution in logs

Network Indicators:

  • Unusual outbound connections from OpenMRS server
  • Large data exfiltration from patient database

SIEM Query:

source="openmrs.log" AND ("htmlformentry" OR "input validation") AND severity=ERROR

🔗 References

📤 Share & Export