CVE-2023-49093
📋 TL;DR
HtmlUnit versions before 3.9.0 are vulnerable to remote code execution when processing malicious webpages containing XSLT transformations. This allows attackers to execute arbitrary code on systems running vulnerable HtmlUnit instances, affecting any Java application that uses HtmlUnit to browse untrusted web content.
💻 Affected Systems
- HtmlUnit
📦 What is this software?
Htmlunit by Htmlunit
⚠️ Risk & Real-World Impact
Worst Case
Full system compromise allowing attacker to execute arbitrary commands, steal data, install malware, or pivot to other systems.
Likely Case
Application compromise leading to data exfiltration, service disruption, or lateral movement within the network.
If Mitigated
Limited impact if proper network segmentation and least privilege principles are applied, though application compromise is still possible.
🎯 Exploit Status
Exploitation requires the victim to browse a malicious webpage using HtmlUnit. The advisory includes technical details that could facilitate exploitation.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 3.9.0
Vendor Advisory: https://github.com/HtmlUnit/htmlunit/security/advisories/GHSA-37vq-hr2f-g7h7
Restart Required: Yes
Instructions:
1. Identify all applications using HtmlUnit. 2. Update HtmlUnit dependency to version 3.9.0 or later. 3. Rebuild and redeploy affected applications. 4. Restart any running services using HtmlUnit.
🔧 Temporary Workarounds
Disable XSLT processing
allConfigure HtmlUnit to disable XSLT processing if not required by application functionality.
Set webClient.getOptions().setXSLTEnabled(false); in Java code
Network restrictions
allRestrict HtmlUnit instances from accessing untrusted external websites.
🧯 If You Can't Patch
- Implement strict network controls to prevent HtmlUnit instances from accessing untrusted websites
- Run HtmlUnit instances with minimal privileges and in isolated environments
🔍 How to Verify
Check if Vulnerable:
Check the HtmlUnit version in your project dependencies or classpath. If version is below 3.9.0, you are vulnerable.
Check Version:
Check Maven pom.xml, Gradle build.gradle, or run: java -cp "htmlunit-*.jar" com.gargoylesoftware.htmlunit.WebClient --version
Verify Fix Applied:
Verify that HtmlUnit version is 3.9.0 or higher in your application dependencies and that the application has been rebuilt and redeployed.
📡 Detection & Monitoring
Log Indicators:
- Unusual Java process spawning, unexpected network connections from HtmlUnit processes, error logs related to XSLT processing
Network Indicators:
- Outbound connections from HtmlUnit instances to suspicious domains, unexpected command and control traffic
SIEM Query:
source="application.logs" AND ("HtmlUnit" OR "XSLT") AND ("error" OR "exception")