# CVE-2020-27216: Local Temp Directory Hijacking Vulnerability

> A local attacker can exploit a race condition in temporary directory creation to gain read/write access to web application files, potentially leading to privilege escalation.

- **Severity:** High 7.0 (`CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 23 Oct 2020
- **Updated:** 4 Aug 2024
- **Also known as:** CLEANSTART-2026-RM27801, DEBIAN-CVE-2020-27216, GHSA-g3wg-6mcf-8jj6, OESA-2021-1052, RHSA-2020:5168, UBUNTU-CVE-2020-27216

## What is CVE-2020-27216?

CVE-2020-27216 is a high-severity vulnerability in Debian Debian Linux, published on 23 Oct 2020. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

In Eclipse Jetty versions 1.0 thru 9.4.32.v20200930, 10.0.0.alpha1 thru 10.0.0.beta2, and 11.0.0.alpha1 thru 11.0.0.beta2O, on Unix like systems, the system's temporary directory is shared between all users on that system. A collocated user can observe the process of creating a temporary sub directory in the shared temporary directory and race to complete the creation of the temporary subdirectory. If the attacker wins the race then they will have read and write permission to the subdirectory used to unpack web applications, including their WEB-INF/lib jar files and JSP files. If any code is ever executed out of this temporary directory, this can lead to a local privilege escalation vulnerability.

Weakness: CWE-379 (Creation of Temporary File in Directory with Insecure Permissions), CWE-378 (Creation of Temporary File With Insecure Permissions)

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

12 open source packages ship an affected version, including org.eclipse.jetty:jetty-webapp and org.mortbay.jetty:jetty-webapp. It affects 18 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.eclipse.jetty:jetty-webapp` | Maven | All versions | 9.4.33.v20201020 |
| `org.eclipse.jetty:jetty-webapp` | Maven | All versions | 9.4.33.v20201020 |
| `org.eclipse.jetty:jetty-webapp` | Maven | From 10.0.0.beta1 | 10.0.0.beta3 |
| `org.eclipse.jetty:jetty-webapp` | Maven | From 10.0.0.beta1 | 10.0.0.beta3 |
| `org.eclipse.jetty:jetty-webapp` | Maven | From 11.0.0.beta1 | 11.0.0.beta3 |
| `org.eclipse.jetty:jetty-webapp` | Maven | From 11.0.0.beta1 | 11.0.0.beta3 |
| `org.mortbay.jetty:jetty-webapp` | Maven | All versions | 9.4.33 |
| `org.mortbay.jetty:jetty-webapp` | Maven | All versions | 9.4.33 |
| `org.mortbay.jetty:jetty-webapp` | Maven | From 10.0.0.beta1 | 10.0.0.beta3 |
| `org.mortbay.jetty:jetty-webapp` | Maven | From 10.0.0.beta1 | 10.0.0.beta3 |
| `org.mortbay.jetty:jetty-webapp` | Maven | From 11.0.0.beta1 | 11.0.0.beta3 |
| `org.mortbay.jetty:jetty-webapp` | Maven | From 11.0.0.beta1 | 11.0.0.beta3 |
| `rh-eclipse` | Red Hat:devtools:2020 | All versions | 1:4.17-6.el7_9 |
| `rh-eclipse-ant` | Red Hat:devtools:2020 | All versions | 0:1.10.9-1.2.el7 |
| `rh-eclipse-ant-antlr` | Red Hat:devtools:2020 | All versions | 0:1.10.9-1.2.el7 |
| `rh-eclipse-ant-apache-bcel` | Red Hat:devtools:2020 | All versions | 0:1.10.9-1.2.el7 |
| `rh-eclipse-ant-apache-bsf` | Red Hat:devtools:2020 | All versions | 0:1.10.9-1.2.el7 |
| `rh-eclipse-ant-apache-log4j` | Red Hat:devtools:2020 | All versions | 0:1.10.9-1.2.el7 |
| `rh-eclipse-ant-apache-oro` | Red Hat:devtools:2020 | All versions | 0:1.10.9-1.2.el7 |
| `rh-eclipse-ant-apache-regexp` | Red Hat:devtools:2020 | All versions | 0:1.10.9-1.2.el7 |
| `rh-eclipse-ant-apache-resolver` | Red Hat:devtools:2020 | All versions | 0:1.10.9-1.2.el7 |
| `rh-eclipse-ant-apache-xalan2` | Red Hat:devtools:2020 | All versions | 0:1.10.9-1.2.el7 |
| `rh-eclipse-ant-commons-logging` | Red Hat:devtools:2020 | All versions | 0:1.10.9-1.2.el7 |
| `rh-eclipse-ant-commons-net` | Red Hat:devtools:2020 | All versions | 0:1.10.9-1.2.el7 |
| `rh-eclipse-ant-imageio` | Red Hat:devtools:2020 | All versions | 0:1.10.9-1.2.el7 |
| `rh-eclipse-ant-javadoc` | Red Hat:devtools:2020 | All versions | 0:1.10.9-1.2.el7 |
| `rh-eclipse-ant-javamail` | Red Hat:devtools:2020 | All versions | 0:1.10.9-1.2.el7 |
| `rh-eclipse-ant-jdepend` | Red Hat:devtools:2020 | All versions | 0:1.10.9-1.2.el7 |
| `rh-eclipse-ant-jmf` | Red Hat:devtools:2020 | All versions | 0:1.10.9-1.2.el7 |
| `rh-eclipse-ant-jsch` | Red Hat:devtools:2020 | All versions | 0:1.10.9-1.2.el7 |
| `rh-eclipse-ant-junit` | Red Hat:devtools:2020 | All versions | 0:1.10.9-1.2.el7 |
| `rh-eclipse-ant-junit5` | Red Hat:devtools:2020 | All versions | 0:1.10.9-1.2.el7 |
| `rh-eclipse-ant-lib` | Red Hat:devtools:2020 | All versions | 0:1.10.9-1.2.el7 |
| `rh-eclipse-ant-manual` | Red Hat:devtools:2020 | All versions | 0:1.10.9-1.2.el7 |
| `rh-eclipse-ant-swing` | Red Hat:devtools:2020 | All versions | 0:1.10.9-1.2.el7 |
| `rh-eclipse-ant-testutil` | Red Hat:devtools:2020 | All versions | 0:1.10.9-1.2.el7 |
| `rh-eclipse-ant-xz` | Red Hat:devtools:2020 | All versions | 0:1.10.9-1.2.el7 |
| `rh-eclipse-antlr32` | Red Hat:devtools:2020 | All versions | 0:3.2-28.1.el7 |
| `rh-eclipse-antlr32-java` | Red Hat:devtools:2020 | All versions | 0:3.2-28.1.el7 |
| `rh-eclipse-antlr32-javadoc` | Red Hat:devtools:2020 | All versions | 0:3.2-28.1.el7 |

Products: Apache Beam, Debian Debian Linux, Eclipse Jetty, Netapp Snap Creator Framework, Netapp Snapcenter, Netapp Storage Replication Adapter, Netapp Vasa Provider, Netapp Virtual Storage Console, Oracle Communications Application Session Controller, Oracle Communications Converged Application Server - Service Controller, Oracle Communications Element Manager, Oracle Communications Offline Mediation Controller, Oracle Communications Pricing Design Center, Oracle Communications Services Gatekeeper, Oracle Flexcube Core Banking, Oracle Flexcube Private Banking, Oracle Jd Edwards Enterpriseone Tools, Oracle Siebel Core - Automation.

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

Upgrade org.eclipse.jetty:jetty-webapp to a fixed version for your release line: 9.4.33.v20201020, 10.0.0.beta3 or 11.0.0.beta3.

## Is CVE-2020-27216 being exploited?

There is no known exploitation of CVE-2020-27216 in the wild and no public exploit code.

## Other vulnerabilities in Debian Debian Linux

- [CVE-2020-1929](https://insights.sbomify.com/CVE-2020-1929/): Improper Certificate Validation in Apache Beam (high 7.5)

## Fix prompt for AI coding agents

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

What it is: CVE-2020-27216 is a high-severity vulnerability in Debian Debian Linux, published on 23 Oct 2020. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2020-27216 in the wild and no public exploit code.

Affected packages and fixed versions:
- org.eclipse.jetty:jetty-webapp (Maven): affected all versions; fixed in 9.4.33.v20201020
- org.eclipse.jetty:jetty-webapp (Maven): affected all versions; fixed in 9.4.33.v20201020
- org.eclipse.jetty:jetty-webapp (Maven): affected from 10.0.0.beta1; fixed in 10.0.0.beta3
- org.eclipse.jetty:jetty-webapp (Maven): affected from 10.0.0.beta1; fixed in 10.0.0.beta3
- org.eclipse.jetty:jetty-webapp (Maven): affected from 11.0.0.beta1; fixed in 11.0.0.beta3
- org.eclipse.jetty:jetty-webapp (Maven): affected from 11.0.0.beta1; fixed in 11.0.0.beta3
- org.mortbay.jetty:jetty-webapp (Maven): affected all versions; fixed in 9.4.33
- org.mortbay.jetty:jetty-webapp (Maven): affected all versions; fixed in 9.4.33
- org.mortbay.jetty:jetty-webapp (Maven): affected from 10.0.0.beta1; fixed in 10.0.0.beta3
- org.mortbay.jetty:jetty-webapp (Maven): affected from 10.0.0.beta1; fixed in 10.0.0.beta3
- org.mortbay.jetty:jetty-webapp (Maven): affected from 11.0.0.beta1; fixed in 11.0.0.beta3
- org.mortbay.jetty:jetty-webapp (Maven): affected from 11.0.0.beta1; fixed in 11.0.0.beta3

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-27216/ (Markdown: https://insights.sbomify.com/CVE-2020-27216/index.md)
```

## Sources

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

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