CVE-2022-42889: Apache commons_text(CVE-2022-42889) and commons_configuration (CVE-2022-33980) vulnerability
A flaw was found in Apache Commons Text packages 1.5 through 1.9. The affected versions allow an attacker to benefit from a variable interpolation process contained in Apache Commons Text, which can cause properties to be dynamically defined. Server applications are vulnerable to remote code execution (RCE) and unintentional contact with untrusted remote servers.
Other sources
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.
The StringSubstitutor default interpolators may lead to unsafe script evaluation and arbitrary code execution
— GitHub Security Lab
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
redhat/jenkinsto a version that resolves this vulnerability.Fixed in 2-plugins-0:4.11.1683009941-1.el8 - Upgrade
Upgrade
redhat/jenkinsto a version that resolves this vulnerability.Fixed in 2-plugins-0:4.12.1683009955-1.el8 - Upgrade
Upgrade
redhat/jenkinsto a version that resolves this vulnerability.Fixed in 2-plugins-0:4.13.1684911916-1.el8 - Upgrade
Upgrade
redhat/jenkinsto a version that resolves this vulnerability.Fixed in 2-plugins-0:4.10.1680703106-1.el8 - Upgrade
Upgrade
redhat/jenkinsto a version that resolves this vulnerability.Fixed in 2-plugins-0:4.9.1680069756-1.el8 - Upgrade
Upgrade
redhat/candlepinto a version that resolves this vulnerability.Fixed in 0:4.1.18-1.el8 - Upgrade
Upgrade
redhat/candlepinto a version that resolves this vulnerability.Fixed in 0:4.2.13-1.el8 - Upgrade
Upgrade
maven/org.apache.commons:commons-textto a version that resolves this vulnerability.Fixed in 1.10.0 - Upgrade
Upgrade
redhat/commons-textto a version that resolves this vulnerability.Fixed in 1.10.0 - Upgrade
Upgrade
Apache Commons Textto a version that resolves this vulnerability.Fixed in 1.10.0Patch CVE-2022-42889 - Upgrade
Upgrade
Apache Commons Configurationto a version that resolves this vulnerability.Fixed in 2.8.0Patch CVE-2022-33980 - Compensating control
Avoid using untrusted configuration values with Commons Text variable interpolation defaults; ensure any external inputs used with Commons-Text lookup methods are thoroughly sanitized before use to prevent remote code execution or unintentional contact with remote servers.
Event History
Parent advisories
This vulnerability appears in the following advisories.
Frequently Asked Questions
What is CVE-2022-42889?
CVE-2022-42889 is a vulnerability in Apache Commons Text that could allow a remote attacker to execute arbitrary code on the system.
What is the severity of CVE-2022-42889?
CVE-2022-42889 has a severity keyword of 'critical' and a severity value of 9.8.
How does CVE-2022-42889 affect Apache Commons Text?
CVE-2022-42889 affects Apache Commons Text by allowing properties to be dynamically evaluated and expanded, which can be exploited by an attacker to execute arbitrary code on the system.
How can I fix CVE-2022-42889 in Apache Commons Text?
To fix CVE-2022-42889 in Apache Commons Text, update to version 1.10.0 or later.
Where can I find more information about CVE-2022-42889?
You can find more information about CVE-2022-42889 on the GitHub page and the Red Hat security advisories linked in the references.