# CVE-2020-17518: Apache Flink directory traversal attack: remote file writing through the REST API

> Attackers can write files to arbitrary locations on the server via the REST API, potentially leading to code execution or data modification.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 5 Jan 2021
- **Updated:** 13 Feb 2025
- **Also known as:** BIT-flink-2020-17518, GHSA-7q5g-gph2-4rc6

## What is CVE-2020-17518?

CVE-2020-17518 is a high-severity path traversal vulnerability in Apache Flink, published on 5 Jan 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Apache Flink 1.5.1 introduced a REST handler that allows you to write an uploaded file to an arbitrary location on the local file system, through a maliciously modified HTTP HEADER. The files can be written to any location accessible by Flink 1.5.1. All users should upgrade to Flink 1.11.3 or 1.12.0 if their Flink instance(s) are exposed. The issue was fixed in commit a5264a6f41524afe8ceadf1d8ddc8c80f323ebc4 from apache/flink:master.

Weakness: CWE-22 (Improper Limitation of a Pathname to a Restricted Directory), CWE-23 (Relative Path Traversal)

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

3 open source packages ship an affected version, including org.apache.flink:flink-runtime and flink. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.apache.flink:flink-runtime` | Maven | From 1.5.1 | 1.11.3 |
| `org.apache.flink:flink-runtime` | Maven | From 1.5.1 | 1.11.3 |
| `flink` | Bitnami | From 1.5.1 | 1.11.3 |

Products: Apache Flink.

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

Upgrade org.apache.flink:flink-runtime to 1.11.3 or later.

## Is CVE-2020-17518 being exploited?

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

Public exploit code:

- https://github.com/QmF0c3UK/CVE-2020-17518 (github_poc): https://github.com/QmF0c3UK/CVE-2020-17518
- [CVE-2020-17518] Apache Flink RESTful API Arbitrary File Upload via Directory Traversal (github_poc): https://github.com/murataydemir/CVE-2020-17518
- 利用Apache Flink CVE-2020-17518 getshell (github_poc): https://github.com/rakjong/Flink-CVE-2020-17518-getshell
- Apache Flink 1.5.1 - Local File Inclusion (nuclei): http/cves/2020/CVE-2020-17518.yaml

## Other vulnerabilities in Apache Flink

- [CVE-2020-17519](https://insights.sbomify.com/CVE-2020-17519/): Apache Flink Improper Access Control (critical 9.1, exploited in the wild)
- [CVE-2026-35194](https://insights.sbomify.com/CVE-2026-35194/): Apache Flink: Remote code execution via SQL injection in code generation (high 8.1)
- [CVE-2020-1960](https://insights.sbomify.com/CVE-2020-1960/): Command injection in Apache Flink (medium 4.7)

## Fix prompt for AI coding agents

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

What it is: CVE-2020-17518 is a high-severity path traversal vulnerability in Apache Flink, published on 5 Jan 2021. 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-17518 exists.

Affected packages and fixed versions:
- org.apache.flink:flink-runtime (Maven): affected from 1.5.1; fixed in 1.11.3
- org.apache.flink:flink-runtime (Maven): affected from 1.5.1; fixed in 1.11.3
- flink (Bitnami): affected from 1.5.1; fixed in 1.11.3

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

## Sources

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

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