CVE-2022-42889
Arbitrary code execution in Apache Commons Text
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.
Affected Maven artifacts (2)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| com.guicedee.services » commons-text | <= 1.2.2.1-jre17 | - |
| org.apache.commons » commons-text | >= 1.5, < 1.10.0 | 1.10.0 |
Blast radius
40% of the dependent artifacts (8,128) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 115,859 |
| 2 hops | 264,141 |
| 3 hops | 349,611 |
| 4 hops | 291,527 |
| 5 hops | 134,687 |
| 6 hops | 106,206 |
Most used dependents
- org.apache.maven.plugins » maven-javadoc-plugin84,916 usages
- org.apache.maven.plugins » maven-site-plugin9,107 usages
- org.apache.hadoop » hadoop-common3,482 usages
- com.github.spotbugs » spotbugs-maven-plugin3,264 usages
- org.apache.spark » spark-sql3,174 usages
- org.apache.spark » spark-core2,899 usages
- org.apache.velocity » velocity2,223 usages
- com.typesafe.play » play-test1,902 usages
- org.apache.hadoop » hadoop-client1,796 usages
- org.apache.hadoop » hadoop-mapreduce-client-core1,366 usages
- org.liquibase » liquibase-core1,306 usages
- org.owasp » dependency-check-maven1,289 usages
- org.scalatestplus.play » scalatestplus-play1,286 usages
- org.apache.commons » commons-configuration21,278 usages
- org.codehaus.mojo » gwt-maven-plugin1,170 usages
Computed from the dependency graph of build 20261124.0621 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.
References
- Advisoryhttps://nvd.nist.gov/vuln/detail/CVE-2022-42889
- Webhttps://arxiv.org/pdf/2306.05534
- Packagehttps://github.com/apache/commons-text
- Webhttps://lists.apache.org/thread/n2bd4vdsgkqh2tm14l1wyc3jyol7s1om
- Webhttps://psirt.global.sonicwall.com/vuln-detail/SNWLID-2022-0022
- Webhttps://security.gentoo.org/glsa/202301-05
- Webhttps://security.netapp.com/advisory/ntap-20221020-0004
- Advisoryhttps://securitylab.github.com/advisories/GHSL-2022-018_Apache_Commons_Text
- Webhttp://packetstormsecurity.com/files/171003/OX-App-Suite-Cross-Site-Scripting-Server-Side-Request-Forgery.html
- Webhttp://packetstormsecurity.com/files/176650/Apache-Commons-Text-1.9-Remote-Code-Execution.html
- Webhttp://seclists.org/fulldisclosure/2023/Feb/3
- Webhttp://www.openwall.com/lists/oss-security/2022/10/13/4
- Webhttp://www.openwall.com/lists/oss-security/2022/10/18/1
