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 Wulftanges 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/).
The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.
Name | Vendor | Start Version | End Version |
---|---|---|---|
Tomcat | Apache | 7.0.0 (including) | 7.0.93 (including) |
Tomcat | Apache | 8.5.0 (including) | 8.5.39 (including) |
Tomcat | Apache | 9.0.1 (including) | 9.0.17 (including) |
Tomcat | Apache | 9.0.0-milestone1 (including) | 9.0.0-milestone1 (including) |
Tomcat | Apache | 9.0.0-milestone10 (including) | 9.0.0-milestone10 (including) |
Tomcat | Apache | 9.0.0-milestone11 (including) | 9.0.0-milestone11 (including) |
Tomcat | Apache | 9.0.0-milestone12 (including) | 9.0.0-milestone12 (including) |
Tomcat | Apache | 9.0.0-milestone13 (including) | 9.0.0-milestone13 (including) |
Tomcat | Apache | 9.0.0-milestone14 (including) | 9.0.0-milestone14 (including) |
Tomcat | Apache | 9.0.0-milestone15 (including) | 9.0.0-milestone15 (including) |
Tomcat | Apache | 9.0.0-milestone16 (including) | 9.0.0-milestone16 (including) |
Tomcat | Apache | 9.0.0-milestone17 (including) | 9.0.0-milestone17 (including) |
Tomcat | Apache | 9.0.0-milestone18 (including) | 9.0.0-milestone18 (including) |
Tomcat | Apache | 9.0.0-milestone19 (including) | 9.0.0-milestone19 (including) |
Tomcat | Apache | 9.0.0-milestone2 (including) | 9.0.0-milestone2 (including) |
Tomcat | Apache | 9.0.0-milestone20 (including) | 9.0.0-milestone20 (including) |
Tomcat | Apache | 9.0.0-milestone21 (including) | 9.0.0-milestone21 (including) |
Tomcat | Apache | 9.0.0-milestone22 (including) | 9.0.0-milestone22 (including) |
Tomcat | Apache | 9.0.0-milestone23 (including) | 9.0.0-milestone23 (including) |
Tomcat | Apache | 9.0.0-milestone24 (including) | 9.0.0-milestone24 (including) |
Tomcat | Apache | 9.0.0-milestone25 (including) | 9.0.0-milestone25 (including) |
Tomcat | Apache | 9.0.0-milestone26 (including) | 9.0.0-milestone26 (including) |
Tomcat | Apache | 9.0.0-milestone3 (including) | 9.0.0-milestone3 (including) |
Tomcat | Apache | 9.0.0-milestone4 (including) | 9.0.0-milestone4 (including) |
Tomcat | Apache | 9.0.0-milestone5 (including) | 9.0.0-milestone5 (including) |
Tomcat | Apache | 9.0.0-milestone6 (including) | 9.0.0-milestone6 (including) |
Tomcat | Apache | 9.0.0-milestone7 (including) | 9.0.0-milestone7 (including) |
Tomcat | Apache | 9.0.0-milestone8 (including) | 9.0.0-milestone8 (including) |
Tomcat | Apache | 9.0.0-milestone9 (including) | 9.0.0-milestone9 (including) |
Red Hat JBoss Web Server 3.1 | RedHat | tomcat7 | * |
Red Hat JBoss Web Server 3.1 | RedHat | tomcat8 | * |
Red Hat JBoss Web Server 5.2 on RHEL 6 | RedHat | jws5-ecj-0:4.12.0-1.redhat_1.1.el6jws | * |
Red Hat JBoss Web Server 5.2 on RHEL 6 | RedHat | jws5-javapackages-tools-0:3.4.1-5.15.11.el6jws | * |
Red Hat JBoss Web Server 5.2 on RHEL 6 | RedHat | jws5-jboss-logging-0:3.3.2-1.Final_redhat_00001.1.el6jws | * |
Red Hat JBoss Web Server 5.2 on RHEL 6 | RedHat | jws5-mod_cluster-0:1.4.1-1.Final_redhat_00001.2.el6jws | * |
Red Hat JBoss Web Server 5.2 on RHEL 6 | RedHat | jws5-tomcat-0:9.0.21-10.redhat_4.1.el6jws | * |
Red Hat JBoss Web Server 5.2 on RHEL 6 | RedHat | jws5-tomcat-native-0:1.2.21-34.redhat_34.el6jws | * |
Red Hat JBoss Web Server 5.2 on RHEL 6 | RedHat | jws5-tomcat-vault-0:1.1.8-1.Final_redhat_1.1.el6jws | * |
Red Hat JBoss Web Server 5.2 on RHEL 7 | RedHat | jws5-ecj-0:4.12.0-1.redhat_1.1.el7jws | * |
Red Hat JBoss Web Server 5.2 on RHEL 7 | RedHat | jws5-javapackages-tools-0:3.4.1-5.15.11.el7jws | * |
Red Hat JBoss Web Server 5.2 on RHEL 7 | RedHat | jws5-jboss-logging-0:3.3.2-1.Final_redhat_00001.1.el7jws | * |
Red Hat JBoss Web Server 5.2 on RHEL 7 | RedHat | jws5-mod_cluster-0:1.4.1-1.Final_redhat_00001.2.el7jws | * |
Red Hat JBoss Web Server 5.2 on RHEL 7 | RedHat | jws5-tomcat-0:9.0.21-10.redhat_4.1.el7jws | * |
Red Hat JBoss Web Server 5.2 on RHEL 7 | RedHat | jws5-tomcat-native-0:1.2.21-34.redhat_34.el7jws | * |
Red Hat JBoss Web Server 5.2 on RHEL 7 | RedHat | jws5-tomcat-vault-0:1.1.8-1.Final_redhat_1.1.el7jws | * |
Red Hat JBoss Web Server 5.2 on RHEL 8 | RedHat | jws5-ecj-0:4.12.0-1.redhat_1.1.el8jws | * |
Red Hat JBoss Web Server 5.2 on RHEL 8 | RedHat | jws5-javapackages-tools-0:3.4.1-5.15.11.el8jws | * |
Red Hat JBoss Web Server 5.2 on RHEL 8 | RedHat | jws5-jboss-logging-0:3.3.2-1.Final_redhat_00001.1.el8jws | * |
Red Hat JBoss Web Server 5.2 on RHEL 8 | RedHat | jws5-mod_cluster-0:1.4.1-1.Final_redhat_00001.2.el8jws | * |
Red Hat JBoss Web Server 5.2 on RHEL 8 | RedHat | jws5-tomcat-0:9.0.21-10.redhat_4.1.el8jws | * |
Red Hat JBoss Web Server 5.2 on RHEL 8 | RedHat | jws5-tomcat-native-0:1.2.21-34.redhat_34.el8jws | * |
Red Hat JBoss Web Server 5.2 on RHEL 8 | RedHat | jws5-tomcat-vault-0:1.1.8-1.Final_redhat_1.1.el8jws | * |
This could allow attackers to execute unexpected, dangerous commands directly on the operating system. This weakness can lead to a vulnerability in environments in which the attacker does not have direct access to the operating system, such as in web applications. Alternately, if the weakness occurs in a privileged program, it could allow the attacker to specify commands that normally would not be accessible, or to call alternate commands with privileges that the attacker does not have. The problem is exacerbated if the compromised process does not follow the principle of least privilege, because the attacker-controlled commands may run with special system privileges that increases the amount of damage. There are at least two subtypes of OS command injection:
From a weakness standpoint, these variants represent distinct programmer errors. In the first variant, the programmer clearly intends that input from untrusted parties will be part of the arguments in the command to be executed. In the second variant, the programmer does not intend for the command to be accessible to any untrusted party, but the programmer probably has not accounted for alternate ways in which malicious attackers can provide input.