CVE-2021-27850Bypass of the fix for CVE-2019-0195
- 9.8CriticalCVSS base score
- 93.6%Exploitation in 30 daysEPSS · top 0.2% of all CVEs
- NoKnown exploitednot in CISA's KEV catalog
- 2Public exploitsMetasploit, Nuclei and Exploit-DB
Description
A critical unauthenticated remote code execution vulnerability was found all recent versions of Apache Tapestry. The affected versions include 5.4.5, 5.5.0, 5.6.2 and 5.7.0. The vulnerability I have found is a bypass of the fix for CVE-2019-0195. Recap: Before the fix of CVE-2019-0195 it was possible to download arbitrary class files from the classpath by providing a crafted asset file URL. An attacker was able to download the file `AppModule.class` by requesting the URL `http://localhost:8080/assets/something/services/AppModule.class` which contains a HMAC secret key. The fix for that bug was a blacklist filter that checks if the URL ends with `.class`, `.properties` or `.xml`. Bypass: Unfortunately, the blacklist solution can simply be bypassed by appending a `/` at the end of the URL: `http://localhost:8080/assets/something/services/AppModule.class/` The slash is stripped after the blacklist check and the file `AppModule.class` is loaded into the response. This class usually contains the HMAC secret key which is used to sign serialized Java objects. With the knowledge of that key an attacker can sign a Java gadget chain that leads to RCE (e.g. CommonsBeanUtils1 from ysoserial). Solution for this vulnerability: * For Apache Tapestry 5.4.0 to 5.6.1, upgrade to 5.6.2 or later. * For Apache Tapestry 5.7.0, upgrade to 5.7.1 or later.
Public exploit
An exploit or proof of concept is public: anyone can try it against an unpatched system. The public collections list a Metasploit module and a Nuclei template for it.
Show the exploits2
Metasploit modules1 module
- Apache Tapestry HMAC secret key leak (Metasploit module) (opens in a new tab)
auxiliary/gather/cve_2021_27850_apache_tapestry_hmac_keyRank normaldisclosed 15 Apr 2021
Nuclei templates1 template
- Apache Tapestry - Remote Code Execution (Nuclei template) (opens in a new tab)
http/cves/2021/CVE-2021-27850.yamlSeverity critical
Modules, templates and exploits as listed by the Metasploit Framework (BSD-3-Clause), ProjectDiscovery's Nuclei templates (MIT) and the Exploit Database (GPLv2), read once a day. Where the data comes from
Timeline
ID reserved
By apache
- 45 days later
· 45 days later
Published
- 3 years later
· 3 years later
Record updated
Changes after publication (a new score, a public exploit, EPSS crossing 1, 10 or 50 %, leaving KEV) are kept since November 2026; earlier ones are not known.
Scores
| Scored by | CVSS | Score | Vector |
|---|---|---|---|
| NVDNVD · Modified | 3.1 | Critical9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
- EPSS (exploitation in 30 days)
- 93.6% · top 0.2% of all CVEs (19 Nov 2026)
The list uses the assigner's score when there is one, then CISA's, then NVD's: Critical 9.8.
Affected products
Apache Software Foundation · Apache Tapestry
- affected Apache Tapestry 5.5.0
- affected Apache Tapestry 5.7.0
- affected Apache Tapestry 5.4.5 – < Apache Tapestry 5.4.0*
- affected Apache Tapestry 5.6.2 – < Apache Tapestry 5.6.0*
Affected packages
From reviewed advisories of the GitHub Advisory Database.
- Mavenorg.apache.tapestry:tapestry-coreGHSA-mj8x-cpr8-x39h (opens in a new tab)
References
References3
- https://lists.apache.org/thread.html/r237ff7f286bda31682c254550c1ebf92b0ec61329b32fbeb2d1c8751%40%3Cusers.tapestry.apache.org%3E (opens in a new tab)x_refsource_MISCx_transferred
- [oss-security] 20210414 CVE-2021-27850: Apache Tapestry: Bypass of the fix for CVE-2019-0195 (opens in a new tab)mailing-listx_refsource_MLISTx_transferred
- https://security.netapp.com/advisory/ntap-20210528-0002/ (opens in a new tab)x_refsource_CONFIRMx_transferred
Sources
The same CVE in the primary databases and aggregators, to check against.
- CVE.org record (opens in a new tab)
- CVE List JSON (GitHub) (opens in a new tab)
- NVD (opens in a new tab)
- FIRST EPSS (opens in a new tab)
- EUVD EUVD-2021-1359 (opens in a new tab)
- OSV.dev (opens in a new tab)
- GitHub Advisory GHSA-mj8x-cpr8-x39h (opens in a new tab)
- CIRCL Vulnerability-Lookup (opens in a new tab)
Badge for a README or a ticket
[](https://cveledger.app/cve/CVE-2021-27850)Record last updated .