Text4Shell
Also tracked as: Act4Shell
Disclosed Oct 13, 2022
Updated Dec 1, 2026
Arbitrary code execution in Apache Commons Text when untrusted user input is passed to StringSubstitutor using its default interpolator, which enabled script, dns, and url lookups by default.
Component
Apache Commons Text StringSubstitutor
Attack Vector & Class
Conditional RCE
Injection
Exploitation Status
No confirmed wild attacks
Public PoC available
CVSS & Ecosystems
9.8 (v3.1)
Java, Apache Commons
Affected Versions
- Apache Commons Text 1.5 through 1.9
Fixed / Recommended Versions
- Apache Commons Text 1.10.0+
Technical Root Cause
Apache Commons Text 1.5 through 1.9 included script, dns, and url lookups in its default StringSubstitutor interpolator set. Applications passing untrusted input to StringSubstitutor.createInterpolator().replace() allowed attackers to inject expressions such as ${script:javascript:...} to execute arbitrary code or trigger SSRF.
Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Remediation & Hardening
- 1Upgrade org.apache.commons:commons-text to 1.10.0 or later, which disables the dangerous script, dns, and url lookups by default.
- 2Audit codebases for direct or transitive usage of StringSubstitutor.createInterpolator() on untrusted input.