Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

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

Source
Associated Vulnerability
Title:Apache Commons Text prior to 1.10.0 allows RCE when applied to untrusted input due to insecure interpolation defaults (CVE-2022-42889)
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.
Description
Proof of Concept for CVE-2022-42889 (Text4Shell Vulnerability) 
Readme
# CVE-2022-42889-PoC

Proof of Concept for CVE-2022-42889 remote code execution exploit (Text4Shell Vulnerability).
<br /> Give a ⭐ for support ❤️

## About this vulnerability

CVE-2022-42889 is a new critical vulnerability similar to Spring4Shell and Log4Shell.
Its a RCE (Remote Code Execution) vulnerability with the severity score of 9.8.
This allows hacker to execute arbitary malicious code on the attacked machine.
The version 1.5 - 1.9 from Apache Commons Text are affected.

## How this works

> 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. - [cve.mitre.org](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-42889)

## How to protect against it

You just need to upgrade this service to the version =< 1.10

## Todo

- [x] Better target scan
- [x] Service detection
- [x] OS detection
- [x] Better target scan result
- [ ] Base64 payload fix
- [ ] Linux reverseshell payload obfuscation

## Prerequisites

1. python 3.9.x
2. nmap
3. ncat
4. Required Libraries

```sh
pip install python-nmap
pip install requests
pip install base64
pip instsall colorama
```

## Screenshots

![image of shell](/docs/assets/images/shell.png)

## Project Insights

![image of Project Insights](/docs/assets/images/traffic_insights_16.11.png)

## Disclaimer

**YOUR USAGE OF THIS PROJECT CONSTITUTES YOUR AGREEMENT TO THE FOLLOWING TERMS:**

- THE MISUSE OF THE DATA PROVIDED BY THIS PROJECT AND ITS EXPLOITS MAY LEAD TO CRIMINAL CHARGES AGAINST THE PERSONS CONCERNED.

- I DO NOT TAKE ANY RESPONSIBILITY FOR THE CASE. USE THIS PROJECT ONLY FOR RESEARCH PURPOSES, EDUCATIONAL PURPOSES & ETHICAL ONLY.

- Its a project related to Computer Security and for Educational Purposes and not a project that promotes illegal activities.

- Don't use this Project for any illegal activities.

- If something happens, we do not take any liability.

- It should teach people how a Malware and a complex Hack Strategie could work and also how to deal with those threats.

- THIS IS A EDUCATIONAL RESEARCH PROJECT
File Snapshot

[4.0K] /data/pocs/aa82f2369f9d90e10904c6fa6506c38c2dee1e49 ├── [4.0K] docs │   └── [4.0K] assets │   └── [4.0K] images │   ├── [ 14K] shell.png │   └── [ 67K] traffic_insights_16.11.png ├── [5.9K] main.py └── [2.8K] README.md 3 directories, 4 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →