question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CVE-2022-42889 - Apache Commons Text prior to 1.10.0 allows RCE

See original GitHub issue

Description

Description

  • Package Manager: maven
  • Vulnerable module: org.liquibase:liquibase-core
  • Introduced through repackaging of commons-text transitive dependency as part of org.liquibase:liquibase-core

Detailed paths

  • liquibase.version defined as 4.16.1 in pom.xml

Overview

Repackaged transitive dependency org.apache.commons:commons-text included by org.liquibase:liquibase-core is vulnerable to CVE-2022-42889.

Apache Commons Text performs variable interpolation, allowing properties to be dynamically evaluated and expanded. The standard format for interpolation is “${prefix:name}”, where “prefix” is used to locate an instance of org.apache.commons.text.lookup.StringLookup that performs the interpolation. Starting with version 1.5 and continuing through 1.9, the set of default Lookup instances included interpolators that could result in arbitrary code execution or contact with remote servers. These lookups are: - “script” - execute expressions using the JVM script execution engine (javax.script) - “dns” - resolve dns records - “url” - load values from urls, including from remote servers Applications using the interpolation defaults in the affected versions may be vulnerable to remote code execution or unintentional contact with remote servers if untrusted configuration values are used.

Remediation

Upgrade org.liquibase:liquibase-core to version 4.17.1 or higher.

References

NVD Entry Keycloak Defined Liquibase Version Liquibase Release Including Fixed Dependency Liquibase Commit Addressing Dependency

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
sguilhencommented, Dec 9, 2022

If I’m reading right, the first release of quarkus that includes the liquibase upgrade is 2.15.0 (https://github.com/quarkusio/quarkus/commit/387578a41f0f58bd70c33f64bc6ba23d69af937e)

Given that we seem to have a way to work around this with @pedroigor 's suggestion, I think we can wait until our quarkus is upgraded to 2.15.0 or higher and then update liquibase accordingly.

1reaction
jsorahcommented, Dec 8, 2022

@pedroigor - The commons-text classes are actually repackaged within the liquibase-core JAR itself, so maven exclusions won’t help here unfortunately.

Ex:

unzip -l liquibase-core-4.8.0.redhat-00001.jar | grep commons/text | head
        0  01-22-2020 15:10   liquibase/repackaged/org/apache/commons/text/
     9212  01-22-2020 15:10   liquibase/repackaged/org/apache/commons/text/AlphabetConverter.class
      258  01-22-2020 15:10   liquibase/repackaged/org/apache/commons/text/Builder.class
     2174  01-22-2020 15:10   liquibase/repackaged/org/apache/commons/text/CaseUtils.class
      184  01-22-2020 15:10   liquibase/repackaged/org/apache/commons/text/CharacterPredicate.class
      745  01-22-2020 15:10   liquibase/repackaged/org/apache/commons/text/CharacterPredicates$1.class
      824  01-22-2020 15:10   liquibase/repackaged/org/apache/commons/text/CharacterPredicates$2.class
      819  01-22-2020 15:10   liquibase/repackaged/org/apache/commons/text/CharacterPredicates$3.class
      819  01-22-2020 15:10   liquibase/repackaged/org/apache/commons/text/CharacterPredicates$4.class
      819  01-22-2020 15:10   liquibase/repackaged/org/apache/commons/text/CharacterPredicates$5.class

EDIT:

Actually what I said is incorrect for what Keycloak is doing - this is an artifact from a different process / older version of liquibase. maven exclusion should work for Keycloak as of now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CVE-2022-42889: interpolations that allow RCE disabled in ...
Key takeaways: If you rely on software that uses a version of commons-text prior to 1.10.0, you are likely still not vulnerable: you...
Read more >
oss-sec: CVE-2022-42889: Apache Commons Text prior to ...
CVE-2022-42889 : Apache Commons Text prior to 1.10.0 allows RCE when applied to untrusted input due to insecure interpolation defaults ...
Read more >
CVE-2022-42889: Apache Commons Text prior to ... - Reddit
CVE-2022-42889 : Apache Commons Text prior to 1.10.0 allows RCE (CVSS9.8), aka "Text4Shell". lists.apache.org.
Read more >
Threat Signal Report | FortiGuard
Assigned, CVE-2022-42889, Apache Commons Text prior to 1.10.0 allows remote code execution (RCE) when applied to untrusted input due to ...
Read more >
Vulnerability In Apache Commons Text - UCSF IT
For a complete description of the vulnerabilities and affected systems go to CVE-2022-42889: Apache Commons Text prior to 1.10.0 allows RCE IT Security....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found