CVE-2021-32643 | StaticFile.fromUrl can leak presence of a directory

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.

Published: 2021-05-27 Last update: 2024-11-21 Assigner: [email protected] Source: [email protected]

Conclusion & alert: CVE-2021-32643 is rated Moderate Risk (42.1/100): CVSS Medium severity, with medium exploitation likelihood (EPSS 0.32%). Mandatory action: Review affected assets and schedule remediation.

Risk is dynamic; we continuously reassess and refresh what is shown on this page as upstream context changes.

Exploit prediction scoring system (EPSS) score for CVE-2021-32643

EPSS lead: Daily EPSS estimates relative likelihood of exploitation; percentile ranks this CVE among scored vulnerabilities (higher = more severe relative rank).

# Date Old EPSS score New EPSS score Delta (New - Old)
1 2025-11-21 0.35% 0.32% -0.04%
2 2025-11-18 0.32% 0.35% +0.04%
3 2025-03-30 0.32%

Full EPSS history (10 records total)

Common vulnerability scoring system (CVSS) metrics for CVE-2021-32643

CVSS metrics for this CVE.

Base score Version Severity Vector Exploitability Impact Score source
5.8 3.1 MEDIUM
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:N Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Privileges required (PR:N)
No account or special rights needed—anonymous or random user is enough.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:C)
Breaking this can reach past the original component and bite other resources—bigger blast radius.
Confidentiality (C:L)
Some sensitive info could get out, but not a total data dump.
Integrity (I:N)
Data isn’t meaningfully altered or forged.
Availability (A:N)
Service keeps running; no real outage angle.
3.9 1.4 [email protected]
5.8 3.1 MEDIUM
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:N Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Privileges required (PR:N)
No account or special rights needed—anonymous or random user is enough.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:C)
Breaking this can reach past the original component and bite other resources—bigger blast radius.
Confidentiality (C:L)
Some sensitive info could get out, but not a total data dump.
Integrity (I:N)
Data isn’t meaningfully altered or forged.
Availability (A:N)
Service keeps running; no real outage angle.
3.9 1.4 [email protected]
5.0 2.0 MEDIUM
AV:N/AC:L/Au:N/C:P/I:N/A:N Click to expand
Access vector (AV:N)
Can be exploited remotely over network reachability.
Access complexity (AC:L)
Exploitation conditions are straightforward and predictable.
Authentication (AU:N)
No authentication is required.
Confidentiality impact (C:P)
Partial confidentiality impact.
Integrity impact (I:N)
No integrity impact.
Availability impact (A:N)
No availability impact.
10.0 2.9 [email protected]

Weakness enumeration for CVE-2021-32643

GitHub Security Advisory for CVE-2021-32643

GHSA-6h7w-fc84-x7p6 · Severity: medium · Ecosystem: maven — StaticFile.fromUrl can leak presence of a directory

Affected software / configurations for CVE-2021-32643

Vendor Product Version Raw CPE
typelevel http4s >= 0.21.7, < 0.21.24 cpe:2.3:a:typelevel:http4s:*:*:*:*:*:*:*:*
typelevel http4s 0.22.0 cpe:2.3:a:typelevel:http4s:0.22.0:milestone1:*:*:*:*:*:*
typelevel http4s 0.22.0 cpe:2.3:a:typelevel:http4s:0.22.0:milestone2:*:*:*:*:*:*
typelevel http4s 0.22.0 cpe:2.3:a:typelevel:http4s:0.22.0:milestone3:*:*:*:*:*:*
typelevel http4s 0.22.0 cpe:2.3:a:typelevel:http4s:0.22.0:milestone4:*:*:*:*:*:*
typelevel http4s 0.22.0 cpe:2.3:a:typelevel:http4s:0.22.0:milestone5:*:*:*:*:*:*
typelevel http4s 0.22.0 cpe:2.3:a:typelevel:http4s:0.22.0:milestone6:*:*:*:*:*:*
typelevel http4s 0.22.0 cpe:2.3:a:typelevel:http4s:0.22.0:milestone7:*:*:*:*:*:*
typelevel http4s 0.22.0 cpe:2.3:a:typelevel:http4s:0.22.0:milestone8:*:*:*:*:*:*
typelevel http4s 0.23.0 cpe:2.3:a:typelevel:http4s:0.23.0:milestone1:*:*:*:*:*:*
typelevel http4s 1.0.0 cpe:2.3:a:typelevel:http4s:1.0.0:milestone1:*:*:*:*:*:*
typelevel http4s 1.0.0 cpe:2.3:a:typelevel:http4s:1.0.0:milestone10:*:*:*:*:*:*
typelevel http4s 1.0.0 cpe:2.3:a:typelevel:http4s:1.0.0:milestone11:*:*:*:*:*:*
typelevel http4s 1.0.0 cpe:2.3:a:typelevel:http4s:1.0.0:milestone12:*:*:*:*:*:*
typelevel http4s 1.0.0 cpe:2.3:a:typelevel:http4s:1.0.0:milestone13:*:*:*:*:*:*
typelevel http4s 1.0.0 cpe:2.3:a:typelevel:http4s:1.0.0:milestone14:*:*:*:*:*:*
typelevel http4s 1.0.0 cpe:2.3:a:typelevel:http4s:1.0.0:milestone15:*:*:*:*:*:*
typelevel http4s 1.0.0 cpe:2.3:a:typelevel:http4s:1.0.0:milestone16:*:*:*:*:*:*
typelevel http4s 1.0.0 cpe:2.3:a:typelevel:http4s:1.0.0:milestone17:*:*:*:*:*:*
typelevel http4s 1.0.0 cpe:2.3:a:typelevel:http4s:1.0.0:milestone18:*:*:*:*:*:*
typelevel http4s 1.0.0 cpe:2.3:a:typelevel:http4s:1.0.0:milestone19:*:*:*:*:*:*
typelevel http4s 1.0.0 cpe:2.3:a:typelevel:http4s:1.0.0:milestone2:*:*:*:*:*:*
typelevel http4s 1.0.0 cpe:2.3:a:typelevel:http4s:1.0.0:milestone20:*:*:*:*:*:*
typelevel http4s 1.0.0 cpe:2.3:a:typelevel:http4s:1.0.0:milestone21:*:*:*:*:*:*
typelevel http4s 1.0.0 cpe:2.3:a:typelevel:http4s:1.0.0:milestone22:*:*:*:*:*:*
typelevel http4s 1.0.0 cpe:2.3:a:typelevel:http4s:1.0.0:milestone3:*:*:*:*:*:*
typelevel http4s 1.0.0 cpe:2.3:a:typelevel:http4s:1.0.0:milestone4:*:*:*:*:*:*
typelevel http4s 1.0.0 cpe:2.3:a:typelevel:http4s:1.0.0:milestone5:*:*:*:*:*:*
typelevel http4s 1.0.0 cpe:2.3:a:typelevel:http4s:1.0.0:milestone6:*:*:*:*:*:*
typelevel http4s 1.0.0 cpe:2.3:a:typelevel:http4s:1.0.0:milestone7:*:*:*:*:*:*
typelevel http4s 1.0.0 cpe:2.3:a:typelevel:http4s:1.0.0:milestone8:*:*:*:*:*:*
typelevel http4s 1.0.0 cpe:2.3:a:typelevel:http4s:1.0.0:milestone9:*:*:*:*:*:*

References for CVE-2021-32643

cvelogic Threat Intelligence