CVE-2021-27850: Tapestry core Remote Code Execution Vulnerability
CRITICALCVE-2021-27850 is a CRITICAL remote code execution vulnerability (CWE-922: Insecure Storage of Sensitive Information) affecting Tapestry core libraries in the Maven ecosystem. The issue involves remote code execution in apache tapestry. Remediation is available by upgrading affected packages to version 5.6.3, 5.7.1.
CVE-2021-27850 at a Glance
How to Fix CVE-2021-27850
To remediate this vulnerability, upgrade all affected Tapestry core dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
<dependency>
<groupId>org.apache.tapestry</groupId>
<artifactId>tapestry-core</artifactId>
<version>5.6.3</version>
</dependency>
<dependency>
<groupId>org.apache.tapestry</groupId>
<artifactId>tapestry-core</artifactId>
<version>5.7.1</version>
</dependency>
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
mvn dependency:tree -Dincludes=org.apache.tapestry
How to Check if You Are Affected
To determine whether your Java application is affected by CVE-2021-27850, inspect your build dependencies using the Maven Dependency Plugin:
mvn dependency:tree -Dincludes=org.apache.tapestry
Analyze the terminal output to locate any version of Tapestry core in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.6.3), your application is affected.
Note: The mvn dependency:tree -Dincludes=org.apache.tapestry command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-922: Insecure Storage of Sensitive Information, where the product stores sensitive information without properly limiting read or write access by unauthorized actors. In Tapestry core, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2021-27850 Affected Tapestry core Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
org.apache.tapestry:tapestry-core
|
Maven |
≥ 5.4.0
< 5.6.3
|
5.6.3
|
|
org.apache.tapestry:tapestry-core
|
Maven |
≥ 5.7.0
< 5.7.1
|
5.7.1
|
References
Frequently Asked Questions
What is CVE-2021-27850?
Which Tapestry core versions are affected?
What version fixes CVE-2021-27850?
Is tapestry-core affected?
What CWE is associated with CVE-2021-27850?
How can I check Maven dependencies for CVE-2021-27850?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-mj8x-cpr8-x39h",
"modified" : "2021-04-19T21:38:56Z",
"published" : "2021-06-16T17:33:19Z",
"aliases" : [ "CVE-2021-27850" ],
"summary" : "Remote code execution in Apache Tapestry",
"details" : "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.2, upgrade to 5.6.3 or later. * For Apache Tapestry 5.7.0, upgrade to 5.7.1 or later.",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "org.apache.tapestry:tapestry-core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "5.4.0"
}, {
"fixed" : "5.6.3"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.apache.tapestry:tapestry-core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "5.7.0"
}, {
"fixed" : "5.7.1"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-27850"
}, {
"type" : "WEB",
"url" : "https://issues.apache.org/jira/browse/TAP5-2663"
}, {
"type" : "WEB",
"url" : "https://lists.apache.org/thread.html/r237ff7f286bda31682c254550c1ebf92b0ec61329b32fbeb2d1c8751%40%3Cusers.tapestry.apache.org%3E"
}, {
"type" : "WEB",
"url" : "https://security.netapp.com/advisory/ntap-20210528-0002"
}, {
"type" : "WEB",
"url" : "http://www.openwall.com/lists/oss-security/2021/04/15/1"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-502", "CWE-922" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2021-04-19T21:38:56Z",
"nvd_published_at" : "2021-04-15T08:15:00Z"
}
}