Apache Tomcat on Windows Remote Code Execution
CVE-2017-12615 is a high-severity unrestricted upload of file with dangerous type vulnerability in Apache Tomcat from Apache, with a CVSS 3.1 base score of 8.1 out of 10. It can be exploited remotely over the network by an unauthenticated attacker, without any action from a user. Affected Apache Tomcat versions: 7.0.0 to 7.0.79. The record does not name a fixed version, so check the vendor advisory. CISA added it to the Known Exploited Vulnerabilities catalogue on March 25, 2022, which means attacks have been observed in the wild, including in ransomware campaigns.
Attackers are already exploiting this vulnerability, according to CISA.
What to do
- Check which version of Apache Tomcat you run against the affected versions below, and install the vendor's latest release.
- CISA's required action: Apply updates per vendor instructions.
- Until you can update, restrict network access to the affected service so it is not reachable from untrusted networks.
Affected products and versions
Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.
How the severity score breaks down
- Attack vector
- NetworkCan be exploited remotely over a network, including the internet.
- Attack complexity
- HighSuccess depends on conditions outside the attacker's control.
- Privileges required
- NoneNo account or login is needed.
- User interaction
- NoneNo action by a victim is required.
- Scope
- UnchangedImpact stays within the vulnerable component.
- Confidentiality
- HighAll data handled by the component can be read.
- Integrity
- HighData or code can be modified at will.
- Availability
- HighThe component can be taken down completely.
Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H. Scored by NVD.
| Scoring system | Score | Severity | Scored by |
|---|---|---|---|
| CVSS 3.1 | 8.1 | High | NVD |
| CVSS 3.1 | 8.1 | High | CISA (ADP) |
| CVSS 2.0 | 6.8 | Medium | NVD |
Official description
When running Apache Tomcat 7.0.0 to 7.0.79 on Windows with HTTP PUTs enabled (e.g. via setting the readonly initialisation parameter of the Default to false) it was possible to upload a JSP file to the server via a specially crafted request. This JSP could then be requested and any code it contained would be executed by the server.
Source: the CVE record as published by its numbering authority, via NVD and CVE.org.
The underlying weakness: Unrestricted Upload of File with Dangerous Type
The product allows the upload or transfer of dangerous file types that are automatically processed within its environment.
How developers prevent this class of flaw
- Generate a new, unique filename for an uploaded file instead of using the user-supplied filename, so that no external input is used at all.
- When the set of acceptable objects, such as filenames or URLs, is limited or known, create a mapping from a set of fixed input values (such as numeric IDs) to the actual filenames or URLs, and reject all other inputs.
- Consider storing the uploaded files outside of the web document root entirely. Then, use other mechanisms to deliver the files dynamically.
More Unrestricted Upload of File with Dangerous Type vulnerabilities (CWE-434)
Timeline
- CVE record published.
- CISA published its SSVC assessment (exploitation: active, automatable: no, technical impact: total).
- Added to CISA's Known Exploited Vulnerabilities catalogue.
- Deadline for US federal agencies to remediate, set by CISA.
- Record last changed materially (score, affected products, status or references).
References
Patches and release notes
- lists.apache.org/thread.html/388a323769f1dff84c9ec905455aa73fbcb20338e3c7eb131457f708%40%3Cdev.tomcat.apache…Mailing List
- lists.apache.org/thread.html/3d19773b4cf0377db62d1e9328bf9160bf1819f04f988315086931d7%40%3Cdev.tomcat.apache…Mailing List
- lists.apache.org/thread.html/845312a10aabbe2c499fca94003881d2c79fc993d85f34c1f5c77424%40%3Cdev.tomcat.apache…Mailing List
- lists.apache.org/thread.html/r9136ff5b13e4f1941360b5a309efee2c114a14855578c3a2cbe5d19c%40%3Cdev.tomcat.apache…Mailing List
Third-party and government advisories
- access.redhat.com/errata/RHSA-2017:3080Third Party Advisory
- access.redhat.com/errata/RHSA-2017:3081Third Party Advisory
- access.redhat.com/errata/RHSA-2017:3113Third Party Advisory
- access.redhat.com/errata/RHSA-2017:3114Third Party Advisory
- access.redhat.com/errata/RHSA-2018:0465Third Party Advisory
- access.redhat.com/errata/RHSA-2018:0466Third Party Advisory
- security.netapp.com/advisory/ntap-20171018-0001/Third Party Advisory
- exploit-db.com/exploits/42953/Third Party Advisory, VDB Entry
- synology.com/support/security/Synology_SA_17_54_TomcatThird Party Advisory
- cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2017-12615US Government Resource
Technical write-ups (may include proof of concept)
- breaktoprotect.blogspot.com/2017/09/the-case-of-cve-2017-12615-tomcat-7-put.htmlExploit
- github.com/breaktoprotect/CVE-2017-12615Exploit, Third Party Advisory
Other references
Other vulnerabilities in Apache Tomcat
- 7.5 High severity
- 7.5 High severity
- 8.1 High severity
- 9.1 Critical severity
- 9.1 Critical severity
- 8.1 High severity
Recent Unrestricted Upload of File with Dangerous Type vulnerabilities
- 9.8 Critical severity
- 9.8 Critical severity
Spotted an error? Tell us.