# CVE-2020-5280: Local file inclusion vulnerability in http4s

> An attacker can read files outside the configured directory via path traversal in http4s static content services.

- **Severity:** High 7.6 (`CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 25 Mar 2020
- **Updated:** 4 Aug 2024
- **Also known as:** GHSA-66q9-f7ff-mmx6

## What is CVE-2020-5280?

CVE-2020-5280 is a high-severity path traversal vulnerability in http4s, published on 25 Mar 2020. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.

### Official description

http4s before versions 0.18.26, 0.20.20, and 0.21.2 has a local file inclusion vulnerability. This vulnerability applies to all users of org.http4s.server.staticcontent.FileService, org.http4s.server.staticcontent.ResourceService and org.http4s.server.staticcontent.WebjarService. URI normalization is applied incorrectly. Requests whose path info contain ../ or // can expose resources outside of the configured location. This issue is patched in versions 0.18.26, 0.20.20, and 0.21.2. Note that 0.19.0 is a deprecated release and has never been supported.

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

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

6 open source packages ship an affected version, including org.http4s:http4s-server_2.12. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.http4s:http4s-server_2.12` | Maven | All versions | 0.18.26 |
| `org.http4s:http4s-server_2.12` | Maven | All versions | 0.18.26 |
| `org.http4s:http4s-server_2.12` | Maven | From 0.19.0 | 0.20.20 |
| `org.http4s:http4s-server_2.12` | Maven | From 0.19.0 | 0.20.20 |
| `org.http4s:http4s-server_2.12` | Maven | From 0.21.0 | 0.21.2 |
| `org.http4s:http4s-server_2.12` | Maven | From 0.21.0 | 0.21.2 |

Products: Typelevel Http4s.

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

Upgrade org.http4s:http4s-server_2.12 to a fixed version for your release line: 0.18.26, 0.20.20 or 0.21.2.

## Is CVE-2020-5280 being exploited?

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

## Other vulnerabilities in http4s

- [CVE-2021-39185](https://insights.sbomify.com/CVE-2021-39185/): Default CORS config allows any origin with credentials (critical 9.1)
- [CVE-2021-41084](https://insights.sbomify.com/CVE-2021-41084/): Response Splitting from unsanitized headers in http4s (high 8.7)
- [CVE-2023-22465](https://insights.sbomify.com/CVE-2023-22465/): Http4s has fatal error parsing User-Agent and Server headers (high 7.5)
- [CVE-2021-21294](https://insights.sbomify.com/CVE-2021-21294/): Unbounded connection acceptance in http4s-blaze-server (high 7.5)
- [CVE-2025-59822](https://insights.sbomify.com/CVE-2025-59822/): Http4s vulnerable to HTTP Request Smuggling due to improper handling of HTTP trailer section (medium 6.3)

## Fix prompt for AI coding agents

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

What it is: CVE-2020-5280 is a high-severity path traversal vulnerability in http4s, published on 25 Mar 2020. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2020-5280 in the wild and no public exploit code.

Affected packages and fixed versions:
- org.http4s:http4s-server_2.12 (Maven): affected all versions; fixed in 0.18.26
- org.http4s:http4s-server_2.12 (Maven): affected all versions; fixed in 0.18.26
- org.http4s:http4s-server_2.12 (Maven): affected from 0.19.0; fixed in 0.20.20
- org.http4s:http4s-server_2.12 (Maven): affected from 0.19.0; fixed in 0.20.20
- org.http4s:http4s-server_2.12 (Maven): affected from 0.21.0; fixed in 0.21.2
- org.http4s:http4s-server_2.12 (Maven): affected from 0.21.0; fixed in 0.21.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-5280/ (Markdown: https://insights.sbomify.com/CVE-2020-5280/index.md)
```

## Sources

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

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