CVE-2023-49093

Remote Code Execution
Affects
HtmlUnit
in
HtmlUnit
No items found.
Versions
<=2.70.0, <3.9.0

Patch Available.

Exclamation circle icon
Patch Available

This Vulnerability has been fixed in the Never-Ending Support (NES) version offered by HeroDevs.

Overview

HtmlUnit is a browser library for Java programs that operates without a graphical interface. It models HTML documents and lets applications load pages, fill forms, follow links, and execute JavaScript with configurable browser behavior. It is used for automated web testing and retrieving information from websites.

A remote code execution vulnerability (CVE-2023-49093) has been identified in the MSXML XSLProcessor of HtmlUnit's Internet Explorer emulation, which allows attackers to run arbitrary Java code on the host when HtmlUnit loads an attacker-controlled page.

Per OWASP: Code Injection is the general term for attack types which consist of injecting code that is then interpreted/executed by the application.

This issue affects multiple versions of HtmlUnit.

Details

Module Info

Vulnerability Info

This Critical-severity vulnerability is found in the net.sourceforge.htmlunit:htmlunit and org.htmlunit:htmlunit packages in multiple versions of HtmlUnit. When a WebClient emulates Internet Explorer, page scripts can create MSXML ActiveX objects such as Msxml2.XSLTemplate and Msxml2.FreeThreadedDOMDocument, load an XSLT stylesheet of their choosing, and run it through the processor returned by createProcessor(). The processor's transform() call ends in XSLProcessor.transform(XMLDOMNode), which compiles the page-supplied stylesheet with a default JAXP TransformerFactory:

final DOMResult result = new DOMResult(containerElement);

final Transformer transformer = TransformerFactory.newInstance().newTransformer(xsltSource);
for (final Map.Entry<String, Object> entry : parameters_.entrySet()) {
    transformer.setParameter(entry.getKey(), entry.getValue());
}
transformer.transform(xmlSource, result);

The JDK enables XMLConstants.FEATURE_SECURE_PROCESSING by default for DOM and SAX parsers, but not for transformers, and nothing in this code turns it on. Without secure processing, the XSLT engine resolves Xalan Java extension namespaces such as http://xml.apache.org/xalan/java/java.lang.Runtime, so a stylesheet can call arbitrary Java methods, including Runtime.exec, while it is being transformed. A page that HtmlUnit loads with Internet Explorer emulation can therefore execute commands with the privileges of the Java process running HtmlUnit.

Mitigation

HtmlUnit security fixes are made on the current development branch on a best-effort basis. Older releases should be migrated to a current release that contains the fix. For more information, see here.

Users of the affected components should apply one of the following mitigations:

  • Upgrade affected applications to a current version of HtmlUnit that contains the fix.
  • Leverage a commercial support partner like HeroDevs for post-EOL security support.
Vulnerability Details
Severity
Level
CVSS Assessment
Low
>=0 <4
Medium
>=4 <6
High
>=6 <8
Critical
>=8 <10
Critical
ID
CVE-2023-49093
PROJECT Affected
HtmlUnit
Versions Affected
<=2.70.0, <3.9.0
NES Versions Affected
Published date
November 5, 2026
≈ Fix date
November 5, 2026
Category
Remote Code Execution
Vex Document
Download VEXHow do I use it?
Sign up for the latest vulnerability alerts fixed in
NES for HtmlUnit
Rss feed icon
Subscribe via RSS
or

By submitting the form I acknowledge receipt of our Privacy Policy.

Thanks for signing up for our Newsletter! We look forward to connecting with you.
Oops! Something went wrong while submitting the form.