Patchfirst
CVE-2021-27850 Public exploit EPSS 93.6%

Bypass of the fix for CVE-2019-0195

Apache Software Foundation · Apache Tapestry

Official description · CVE.org

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.

Breakdown
60.0 / 100
Exploited
Yes, in VulnCheck KEV
Reports
0
Tactics
0/15

First seen exploited 3 years after disclosure. Public exploit code (Metasploit) was available the same day.

  1. DisclosedPublic exploit codeMetasploitday 0
  2. First seen exploitedVulnCheck KEV evidence+3 yrs

A fix was bypassed or incomplete once over 19 months. The latest fix listed for tapestry-core is 5.8.2.

Linked vulnerabilitiesLinked by evidence that a fix failed or the same code was patched again. Oldest first.

  1. CVE-2019-0195Manipulating classpath asset file URLs, an attacker could guess…16 Sep 2019
  2. bypassed the fixHigh

    Why these are linked:

    • Stated in the CVE textThe vulnerability I have found is a bypass of the fix for CVE-2019-0195.
    This CVECVE-2021-27850Bypass of the fix for CVE-⁠2019-⁠019515 Apr 2021

Fixes in tapestry-coreMaven package, by fixed version. Earlier and later fixes in the same package, not necessarily the same bug.

  1. 5.4.5CVE-2019-020716 Sep 2019
  2. 5.4.5CVE-2019-1007116 Sep 2019
  3. 5.6.0CVE-2020-1395330 Sep 2020
  4. 5.7.1CVE-2021-2785015 Apr 2021
  5. 5.7.2CVE-2021-3063827 Apr 2021
  6. 5.8.2CVE-2022-3178113 Jul 2022Latest listed

techniques

No techniques linked

No ATT&CK techniques are linked to this CVE yet. MITRE CTID has not mapped it, and no report passage in the corpus ties it to a technique.

Am I affected? What do I upgrade to?

From GitHub Security Advisories and OSV

1 package in 1 ecosystem. Main package: org.apache.tapestry:tapestry-core.

Mavenorg.apache.tapestry:tapestry-coreGHSA-mj8x-cpr8-x39h

Upgrade to 5.7.1 or later

Set the version to 5.7.1 or later in your pom.xml or build.gradle.

The first fix for CVE-2021-27850. No other CVE tracked by Patchfirst affects this package.

Affected versions, by release line

If you runUpgrade to
5.7.0 up to 5.7.15.7.1
5.4.0 up to 5.6.35.6.3

“Up to” means the second version is the fix and is not affected.

Check your lockfile against all CVEs

What security researchers reported

Not named in any threat report yet

References

3 links, grouped by NVD tag
↑ ↓ chooseEnter openEsc close