CVE-2019-0232 Apache Tomcat OS Command Injection vulnerability
Remote code execution in Apache Tomcat CGI Servlet on Windows when command line arguments are enabled, requiring specific configuration.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2019-0232?
CVE-2019-0232 is a high-severity command injection vulnerability in Apache Tomcat, published on 15 Apr 2019. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
When running on Windows with enableCmdLineArguments enabled, the CGI Servlet in Apache Tomcat 9.0.0.M1 to 9.0.17, 8.5.0 to 8.5.39 and 7.0.0 to 7.0.93 is vulnerable to Remote Code Execution due to a bug in the way the JRE passes command line arguments to Windows. The CGI Servlet is disabled by default. The CGI option enableCmdLineArguments is disable by default in Tomcat 9.0.x (and will be disabled by default in all versions in response to this vulnerability). For a detailed explanation of the JRE behaviour, see Markus Wulftange's blog (https://codewhitesec.blogspot.com/2016/02/java-and-command-line-injections-in-windows.html) and this archived MSDN blog (https://web.archive.org/web/20161228144344/https://blogs.msdn.microsoft.com/twistylittlepassagesallalike/2011/04/23/everyone-quotes-command-line-arguments-the-wrong-way/).
Weakness: CWE-78
Which versions are affected by CVE-2019-0232?
6 open source packages ship an affected version, including org.apache.tomcat.embed:tomcat-embed-core. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
org.apache.tomcat.embed:tomcat-embed-core Maven | From 7.0.0 | 7.0.94 |
org.apache.tomcat.embed:tomcat-embed-core Maven | From 7.0.0 | 7.0.94 |
org.apache.tomcat.embed:tomcat-embed-core Maven | From 8.0.0 | 8.5.40 |
org.apache.tomcat.embed:tomcat-embed-core Maven | From 8.0.0 | 8.5.40 |
org.apache.tomcat.embed:tomcat-embed-core Maven | From 9.0.0.M1 | 9.0.17 |
org.apache.tomcat.embed:tomcat-embed-core Maven | From 9.0.0.M1 | 9.0.17 |
Products include Apache Tomcat.
How do I fix CVE-2019-0232?
Upgrade org.apache.tomcat.embed:tomcat-embed-core to a fixed version for your release line: 7.0.94, 8.5.40 or 9.0.17.
Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.
Is CVE-2019-0232 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2019-0232 exists.
Public exploit code: 1 Metasploit module, 1 Exploit-DB entry, 1 Nuclei template and 15 proofs of concept on GitHub.
Other vulnerabilities in Apache Tomcat
Sources
Also known as GHSA-8vmx-qmch-mpqg.