cve.bz

CVE-2021-32643 typelevel http4s: Path traversal

5.8 mediumEPSS 1.4%Fix available

Medium (5.8) in typelevel http4s. EPSS 1.4% estimated probability of exploitation activity in the next 30 days. Fixed in org.http4s:http4s-core 0.21.24, 0.22.0-RC1, 0.23.0-RC1.

On this page
Http4s is a Scala interface for HTTP services. `StaticFile.fromUrl` can leak the presence of a directory on a server when the `URL` scheme is not `file://`, and the URL points to a fetchable resource under its scheme and authority. The function returns `F[None]`, indicating no resource, if `url.getFile` is a directory, without first checking the scheme or authority of the URL. If a URL connection to the scheme and URL would return a stream, and the path in the URL exists as a directory on the server, the presence of the directory on the server could be inferred from the 404 response. The contents and other metadata about the directory are not exposed. This affects http4s versions: 0.21.7 through 0.21.23, 0.22.0-M1 through 0.22.0-M8, 0.23.0-M1, and 1.0.0-M1 through 1.0.0-M22. The [patch](https://github.com/http4s/http4s/commit/52e1890665410b4385e37b96bc49c5e3c708e4e9) is available in the following versions: v0.21.24, v0.22.0-M9, v0.23.0-M2, v1.0.0-M23. As a workaround users can avoid calling `StaticFile.fromUrl` with non-file URLs.

Severity

CVSS 3.1

5.8 medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:N
EPSS
1.4% (unchanged from 1.4% a week ago; 1.4% 30 days ago) estimated probability of exploitation activity in the next 30 days; 73rd percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CWE
CWE-22 Improper Limitation of a Pathname to a Restricted Directory (Path traversal)
OWASP Top 10
A01:2025 Broken Access Control
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2021-32643 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2021-32643?via=ask-ai-copy and https://cve.bz/cve/CVE-2021-32643?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2021-32643 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
typelevel:http4sfrom 0.21.7 before 0.21.24
typelevel:http4s0.22.0:milestone1
typelevel:http4s0.22.0:milestone2
typelevel:http4s0.22.0:milestone3
typelevel:http4s0.22.0:milestone4
typelevel:http4s0.22.0:milestone5
typelevel:http4s0.22.0:milestone6
typelevel:http4s0.22.0:milestone7
typelevel:http4s0.22.0:milestone8
typelevel:http4s0.23.0:milestone1
typelevel:http4s1.0.0:milestone1
typelevel:http4s1.0.0:milestone10
typelevel:http4s1.0.0:milestone11
typelevel:http4s1.0.0:milestone12
typelevel:http4s1.0.0:milestone13
typelevel:http4s1.0.0:milestone14
typelevel:http4s1.0.0:milestone15
typelevel:http4s1.0.0:milestone16
typelevel:http4s1.0.0:milestone17
typelevel:http4s1.0.0:milestone18
typelevel:http4s1.0.0:milestone19
typelevel:http4s1.0.0:milestone2
typelevel:http4s1.0.0:milestone20
typelevel:http4s1.0.0:milestone21
typelevel:http4s1.0.0:milestone22
typelevel:http4s1.0.0:milestone3
typelevel:http4s1.0.0:milestone4
typelevel:http4s1.0.0:milestone5
typelevel:http4s1.0.0:milestone6
typelevel:http4s1.0.0:milestone7
typelevel:http4s1.0.0:milestone8
typelevel:http4s1.0.0:milestone9

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-6h7w-fc84-x7p6Mavenorg.http4s:http4s-core>=0.21.7 <0.21.240.21.24
GHSA-6h7w-fc84-x7p6Mavenorg.http4s:http4s-core>=0.22.0-M1 <0.22.0-RC10.22.0-RC1
GHSA-6h7w-fc84-x7p6Mavenorg.http4s:http4s-core>=0.23.0-M1 <0.23.0-RC10.23.0-RC1
GHSA-6h7w-fc84-x7p6Mavenorg.http4s:http4s-core>=1.0.0-M1 <1.0.0-M231.0.0-M23

Attack patterns (CAPEC)

  • CAPEC-64 Using Slashes and URL Encoding Combined to Bypass Validation Logic Likelihood: High · Severity: High
  • CAPEC-76 Manipulating Web Input to File System Calls Likelihood: High · Severity: Very High
  • CAPEC-78 Using Escaped Slashes in Alternate Encoding Likelihood: High · Severity: High
  • CAPEC-79 Using Slashes in Alternate Encoding Likelihood: High · Severity: High
  • CAPEC-126 Path Traversal Likelihood: High · Severity: Very High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON