# CVE-2020-13942: Remote Code Execution in Apache Unomi

> Attackers can execute arbitrary code by injecting malicious scripts into the public context endpoint of Apache Unomi.

- **Severity:** Critical 9.8 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 24 Nov 2020
- **Updated:** 13 Feb 2025
- **Also known as:** GHSA-xp5j-wj4h-2jq9

## What is CVE-2020-13942?

CVE-2020-13942 is a critical code injection vulnerability in Apache Unomi, published on 24 Nov 2020. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official 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.

Weakness: CWE-74 (Improper Neutralization of Special Elements in Output Used by a Downstream Component), CWE-20 (Improper Input Validation)

## Which versions are affected by CVE-2020-13942?

2 open source packages ship an affected version, including org.apache.unomi:unomi. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.apache.unomi:unomi` | Maven | All versions | 1.5.2 |
| `org.apache.unomi:unomi` | Maven | All versions | 1.5.2 |

Products: Apache Unomi.

## How do I fix CVE-2020-13942?

Upgrade org.apache.unomi:unomi to 1.5.2 or later.

## Is CVE-2020-13942 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2020-13942 exists.

Public exploit code:

- CVE-2020-13942 unauthenticated RCE POC through MVEL and OGNL injection (github_poc): https://github.com/eugenebmx/CVE-2020-13942
- CVE-2020-13942 POC + Automation Script (github_poc): https://github.com/shifa123/CVE-2020-13942-POC-
- https://github.com/lp008/CVE-2020-13942 (github_poc): https://github.com/lp008/CVE-2020-13942
- CVE-2020-13942 Apache Unomi 远程代码执行漏洞脚getshell (github_poc): https://github.com/yaunsky/Unomi-CVE-2020-13942
- https://github.com/blackmarketer/CVE-2020-13942 (github_poc): https://github.com/blackmarketer/CVE-2020-13942
- Apache Unomi CVE-2020-13942: RCE Vulnerabilities (github_poc): https://github.com/dev-team-12x/apche_unomi_rce

## Other vulnerabilities in Apache Unomi

- [CVE-2020-11975](https://insights.sbomify.com/CVE-2020-11975/): Improper Input Validation in Apache Unomi (critical 9.8)
- [CVE-2021-31164](https://insights.sbomify.com/CVE-2021-31164/): Apache Unomi log injection (high 7.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2020-13942 and fix it if it is affected.

What it is: CVE-2020-13942 is a critical code injection vulnerability in Apache Unomi, published on 24 Nov 2020. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2020-13942 exists.

Affected packages and fixed versions:
- org.apache.unomi:unomi (Maven): affected all versions; fixed in 1.5.2
- org.apache.unomi:unomi (Maven): affected all versions; fixed in 1.5.2

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2020-13942/ (Markdown: https://insights.sbomify.com/CVE-2020-13942/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2020-13942
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2020-13942
- OSV: https://osv.dev/vulnerability/CVE-2020-13942

---
From sbomify Insights: https://insights.sbomify.com/CVE-2020-13942/
Summaries are generated and may contain mistakes; the official description above is the record.
