{"id":"MSF-multi--http--apache_commons_text4shell","name":"Apache Commons Text RCE","description":"This exploit takes advantage of the StringSubstitutor interpolator class, which is included in the Commons Text library. A default interpolator allows for string lookups that can lead to Remote Code Execution. This is due to a logic flaw that makes the \"script\", \"dns\" and \"url\" lookup keys interpolated by default, as opposed to what it should be, according to the documentation of the StringLookupFactory class. Those keys allow an attacker to execute arbitrary code via lookups primarily using the \"script\" key. In order to exploit the vulnerabilities, the following requirements must be met: Run a version of Apache Commons Text from version 1.5 to 1.9 Use the StringSubstitutor interpolator Target should run JDK < 15","cves":["CVE-2022-42889"],"author":"Alvaro Muñoz, Karthik UJ, Gaurav Jain","published":"2022-10-13","platform":"Java,Linux,Unix,Windows","type":"remote","language":"Ruby","source":"metasploit","sourceUrl":"https://github.com/rapid7/metasploit-framework/blob/ab00b9e7e08b1fdc68bdba12de6db2aa4436815e/modules/exploits/multi/http/apache_commons_text4shell.rb","path":"modules/exploits/multi/http/apache_commons_text4shell.rb","revision":"ab00b9e7e08b1fdc68bdba12de6db2aa4436815e","filename":"apache_commons_text4shell.rb","vulnerabilities":[{"id":"CVE-2022-42889","state":"PUBLISHED","title":"Apache Commons Text prior to 1.10.0 allows RCE when applied to untrusted input due to insecure interpolation defaults","titleSource":"CVE Program","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.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2022-42889","cvss":{"version":"3.1","baseScore":9.8,"severity":"critical","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2022-42889"},"updatedAt":"2024-11-20T16:19:41.416Z","retrievedAt":"2026-11-27T04:19:49.223Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/MSF-multi--http--apache_commons_text4shell.png?v=2","url":"https://exploitbin.com/exploits/MSF-multi--http--apache_commons_text4shell","downloadUrl":"https://exploitbin.com/api/v1/exploits/MSF-multi--http--apache_commons_text4shell/download","codeUrl":"https://exploitbin.com/api/v1/exploits/MSF-multi--http--apache_commons_text4shell/code","licenseUrl":"https://exploitbin.com/sources#metasploit"}