Remote code execution via default script interpolation
Published Oct 13, 2022 · Updated Nov 20, 2024
Code injection in Apache Commons Text 1.5 through 1.9 allows remote attackers to execute arbitrary code through unsafe interpolation. StringSubstitutor.createInterpolator() enables ScriptStringLookup by default, and replace() or replaceIn() evaluates attacker-controlled expressions with the JVM scripting engine. Exploitation requires an application to pass unsanitized untrusted input to those methods; DNS and URL lookups can instead trigger outbound requests.
Summary
What happened
Code injection in Apache Commons Text 1.5 through 1.9 allows remote attackers to execute arbitrary code through unsafe interpolation. StringSubstitutor.createInterpolator() enables ScriptStringLookup by default, and replace() or replaceIn() evaluates attacker-controlled expressions with the JVM scripting engine. Exploitation requires an application to pass unsanitized untrusted input to those methods; DNS and URL lookups can instead trigger outbound requests.
The record
- CVE
- CVE-2022-42889
- Published
- Oct 13, 2022
- Updated
- Nov 20, 2024
- Vendor
- The Apache Software Foundation
- Product
- Apache Commons Text
- Classifications
- CWE-94, T1059.007
- Attack vector
- network
- Privileges
- unauthenticated
Timeline
How it unfolded
- Oct 13, 2022CVE publishedPublication date reported by the CVE source.
- Oct 17, 2022Exploitation reportedWordfence Text4Shell exploit-attempt telemetry
- Nov 20, 2024Record updatedLatest update available in the CVE record.
Exploitability
Present is not the same as exploitable
Compare your product and version with the public record. A matching version still requires validation against your environment.
Is a vulnerable build present?
Compare these published version ranges with your installed build and any vendor patches.
- Affected versionversion=1.5 <Apache Commons Text*
- Affected versionversion=unspecified <=1.9
What conditions does exploitation require?
What is affected?
Published CVSS scores
CVSS describes severity. EPSS estimates exploitation probability.
Attacks
What attackers are doing with it
Daily unique IPs observed by Shadowserver honeypots for known exploited vulnerabilities (KEVs). Missing observations do not establish an absence of attacks.
Weakness, pattern, technique
Public exploit references
- java-CTF Text4Shell proof of conceptfunctional · demonstrated
Labels summarize the accepted research assessment. They do not indicate a test against your environment.
Reported exploitation
Technologies
Your stack
See the directory against your own environment.
Your stack
Check the software in your environment
Book a demo to see how Hinoki identifies affected software and validates exploitability in your environment.
Book a demo