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

Goal: 1000 CNY · Raised: 1110 CNY

100%

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
ClusterImagePolicy demo for cve-2022-42889 text4shell  
Readme
# Text4Shell Demo
This demo shows how you can use Sigstore to validate your signed SBOMs against text4shell policies in Kubernetes or on the command line

## Option 1: Check if your remote OCI image is affected using cue with cosign 2.0
```
cosign verify-attestation --policy policy/text4shell.cue --type https://cyclonedx.org/bom --certificate-identity-regexp=.* --certificate-oidc-issuer-regexp=.* ghcr.io/chainguard-dev/text4shell-policy:main
```

## Option 2: Check using Enforce for Kubernetes with image built from this repo
```
chainctl policies create --group $DEMO_GROUP -f policy/text4shell-policy.yaml
kubectl label ns default policy.sigstore.dev/include=true --overwrite
kubectl run text4shell --image=ghcr.io/chainguard-dev/text4shell-policy:main
```
![text4shell diagnostic](https://user-images.githubusercontent.com/9351962/196332575-2ac25720-0262-4768-8854-615fb6f3c686.png)

### Clean Up
```
kubectl delete pod text4shell --grace-period=0
chainctl policy delete -y $(chainctl policy list -o json | jq -r '[.items[] | select(.name == "vuln-cve-2022-42889-text4shell")][0].id')
kubectl label ns default policy.sigstore.dev/include-
```
File Snapshot

[4.0K] /data/pocs/2cad68456c86436001c1f3bcbffd225b86bac3ab ├── [ 230] Dockerfile ├── [ 11K] LICENSE ├── [4.0K] policy │   ├── [ 473] text4shell.cue │   └── [1.0K] text4shell-policy.yaml ├── [4.5K] pom.xml ├── [1.1K] README.md ├── [ 730] slsa.csv ├── [4.0K] src │   └── [4.0K] main │   └── [4.0K] java │   └── [1.2K] Text4Shell.java └── [4.0K] target ├── [ 24K] bom.json ├── [ 20K] bom.xml ├── [4.0K] classes │   └── [2.0K] Text4Shell.class ├── [4.0K] lib │   ├── [241K] commons-beanutils-1.9.4.jar │   ├── [575K] commons-collections-3.2.2.jar │   ├── [734K] commons-collections4-4.4.jar │   ├── [319K] commons-io-2.11.0.jar │   ├── [574K] commons-lang3-3.12.0.jar │   ├── [ 60K] commons-logging-1.2.jar │   ├── [211K] commons-text-1.9.jar │   └── [233K] opencsv-5.7.0.jar ├── [4.0K] maven-archiver │   └── [ 68] pom.properties ├── [4.0K] maven-status │   └── [4.0K] maven-compiler-plugin │   └── [4.0K] compile │   └── [4.0K] default-compile │   ├── [ 17] createdFiles.lst │   └── [ 94] inputFiles.lst └── [3.4K] text4shell-1.0.0-SNAPSHOT.jar 12 directories, 23 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 →