CVE-2022-42889 Apache Commons Text prior to 1.10.0 allows RCE when applied to untrusted input due to insecure interpolation defaults

Critical 9.8 Published Updated

Attackers can execute arbitrary code or trigger SSRF by exploiting insecure default interpolators in Apache Commons Text when processing untrusted input.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2022-42889?

CVE-2022-42889 is a critical code injection vulnerability in Apache Commons Text, published on 13 Oct 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

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. Users are recommended to upgrade to Apache Commons Text 1.10.0, which disables the problematic interpolators by default.

Weakness: CWE-94

Which versions are affected by CVE-2022-42889?

4 open source packages ship an affected version, including org.apache.commons:commons-text and com.guicedee.services:commons-text. It affects 3 products.

PackageAffectedFixed in
org.apache.commons:commons-text MavenFrom 1.51.10.0
org.apache.commons:commons-text MavenFrom 1.51.10.0
com.guicedee.services:commons-text MavenAll versions to 1.2.2.1-jre17None
com.guicedee.services:commons-text MavenAll versions to 1.2.2.1-jre17None
Linux distribution packages (2)
jenkins-2-plugins Red Hat:openshift:4.9::el8All versions0:4.9.1680069756-1.el8
apache-commons-text openSUSE:TumbleweedAll versions1.10.0-1.1

Products include Apache Commons Text, Juniper Security Threat Response Manager, Netapp Bluexp.

How do I fix CVE-2022-42889?

Upgrade org.apache.commons:commons-text to 1.10.0 or later.

Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.

Is CVE-2022-42889 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2022-42889 exists.

Public exploit code: 1 Metasploit module, 1 Exploit-DB entry and 51 proofs of concept on GitHub.

Sources

Also known as CLEANSTART-2026-ML52514, DEBIAN-CVE-2022-42889, GHSA-599f-7c49-w659, RHSA-2023:1524, ROOT-APP-MAVEN-CVE-2022-42889, UBUNTU-CVE-2022-42889 and 1 more.

Is CVE-2022-42889 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free