What to do2 steps
Upgrade commons-text to 1.10.0.
It turns the script, DNS and URL lookups off by default.
Until then, keep untrusted input out of
StringSubstitutor.Do not pass it to
StringSubstitutor.replace()orreplaceIn()with the default interpolator.
Are you affected?only if all are true
- commons-text 1.5 to 1.9.
- The app passes untrusted input to StringSubstitutor.replace() or replaceIn() with the default interpolator (StringSubstitutor.createInterpolator()).
Check your version
- Maven, in the project directory
mvn dependency:tree -Dincludes=org.apache.commons:commons-text - JARs on disk
find / -name 'commons-text-*.jar' 2>/dev/null - Prompt for your own agent, read-onlyAm I affected by Text4Shell?
Read the prompt
Check whether the systems I am authorized to inspect are affected by Text4Shell (CVE-2022-42889). Apache Commons Text's default string interpolation includes script, DNS and URL lookups, so untrusted input passed to StringSubstitutor can run code. It is exploitable under these conditions: - commons-text 1.5 to 1.9. - The app passes untrusted input to StringSubstitutor.replace() or replaceIn() with the default interpolator (StringSubstitutor.createInterpolator()). Fixed releases: - commons-text: 1.10.0 (branch 1.10); before 1.5 is not affected Commands the catalog lists to find the version or the setting (read each one before you run it): - Maven, in the project directory: mvn dependency:tree -Dincludes=org.apache.commons:commons-text - JARs on disk: find / -name 'commons-text-*.jar' 2>/dev/null What the catalog says to do on an affected system (report these, do not carry them out): 1. Upgrade commons-text to 1.10.0. 2. Until then, keep untrusted input out of StringSubstitutor. For each host, container image or application, report affected, not affected, fixed or unknown, with the evidence, and list anything you could not access. Work read-only: do not change configuration, restart services or send exploit input. More: https://commons-text.2shell.wtf/text4shell
Affected versions1 branch
| commons-text branch | Fixed in |
|---|---|
| 1.10 | 1.10.0 |
commons-text before 1.5 is not affected.
Proof of concept1 public PoC
For testing systems you own or are authorized to test. A PoC repository can be fake or carry malware: read it before you run it.
- Open the PoC
Dockerized public PoC for the Text4Shell RCE
Timeline3 events
Reported to the vendor
GitHub Security Lab reports it to Apache Commons
Patched
commons-text 1.10.0
Public PoC
Dockerized public PoC for the Text4Shell RCE
Sources3 links
Sources checked on . This page tells you how to check and what to install. It cannot tell you that you are safe.
4 changes since it was published
- Linked a public dockerized PoC.
- 'Found by' now shows one finder, GitHub Security Lab (GHSL-2022-018); Ruilin, an independent reporter on the Apache page, is recorded as a reporter.
- Remediation steps got short titles; no fact changed.
- Credited Ruilin, who Apache says reported the issue independently.
