{"id":"CVE-2021-32643","aliases":["CVE-2021-32643","GHSA-6h7w-fc84-x7p6"],"related":[],"kind":"vulnerability","state":"published","title":"StaticFile.fromUrl can leak presence of a directory","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Impact\n\n`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.\n\nThis affects http4s versions:\n* 0.21.7 through 0.21.23\n* 0.22.0-M1 through 0.22.0-M8\n* 0.23.0-M1\n* 1.0.0-M1 through 1.0.0-M22\n\n### Patches\n\nThe [patch](https://github.com/http4s/http4s/commit/52e1890665410b4385e37b96bc49c5e3c708e4e9) is available in the following versions:\n\n* v0.21.24\n* v0.22.0-RC1\n* v0.23.0-RC1\n* v1.0.0-M23\n\nNote: a previous version of this advisory incorrectly referred to 0.22.0-M9 and 0.23.0-M2.\n\n### Workarounds\n\nDon't call `StaticFile.fromUrl` with non-file URLs.\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n* Open an issue in [the http4s repository](https://github.com/http4s/http4s)\n* Disclose further vulnerabilities according to the [http4s security policy](https://github.com/http4s/http4s/blob/main/SECURITY.md)","format":"markdown","source":"ghsa"},{"lang":"es","text":"Http4s es una interfaz de Scala para servicios HTTP.&#xa0;el directorio \"StaticFile.fromUrl\" puede filtrar la presencia de un directorio en un servidor cuando el esquema \"URL\" no es \"file://\", y la URL apunta a un recurso recuperable bajo su esquema y autoridad.&#xa0;La función devuelve \"F[None]\", indicando que no hay recurso, si \"url.getFile\" es un directorio, sin comprobar primero el esquema o la autoridad de la URL.&#xa0;Si una conexión URL al esquema y la URL devolvieran una secuencia, y la ruta en la URL se presenta como un directorio en el servidor, la presencia del directorio en el servidor podría inferirse de la respuesta 404.&#xa0;No son expuestas los contenidos y otros metadatos sobre el directorio.&#xa0;Esto afecta a versiones de http4s: versiones 0.21.7 hasta 0.21.23, 0.22.0-M1 hasta 0.22.0-M8, 0.23.0-M1 y versiones 1.0.0-M1 hasta 1.0.0-M22.&#xa0;El [parche] (https://github.com/http4s/http4s/commit/52e1890665410b4385e37b96bc49c5e3c708e4e9) está disponible en las siguientes versiones: v0.21.24, v0.22.0-M9, v0.23.0-M2, v1.0.0-M23.&#xa0;Como solución alternativa, los usuarios pueden evitar llamar a \"StaticFile.fromUrl\" con URL que no sean archivos","source":"nvd"}],"published":"2021-05-27T17:15:11.000Z","modified":"2026-07-08T06:28:02.301Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:N","score":5.8,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:N","score":5.8,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:N","score":5.8,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:N","score":5.8,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:L/Au:N/C:P/I:N/A:N","score":5,"rating":"MEDIUM"}],"cwes":["CWE-22"],"affected":[{"ranges":[{"version":">= 0.21.7, < 0.21.24","status":"affected"},{"version":">= 0.22.0-M1, <= 0.22.0-M8","status":"affected"},{"version":"= 0.23.0-M1","status":"affected"},{"version":">= 1.0.0-M1, < 1.0.0-M23","status":"affected"}],"vendor":"http4s","product":"http4s","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0.21.7","status":"affected","fixed":"0.21.24"}],"ecosystem":"Maven","package":"org.http4s:http4s-core","purl":"pkg:maven/org.http4s/http4s-core","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0.22.0-M1","status":"affected","fixed":"0.22.0-RC1"}],"ecosystem":"Maven","package":"org.http4s:http4s-core","purl":"pkg:maven/org.http4s/http4s-core","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0.23.0-M1","status":"affected","fixed":"0.23.0-RC1"}],"ecosystem":"Maven","package":"org.http4s:http4s-core","purl":"pkg:maven/org.http4s/http4s-core","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"1.0.0-M1","status":"affected","fixed":"1.0.0-M23"}],"ecosystem":"Maven","package":"org.http4s:http4s-core","purl":"pkg:maven/org.http4s/http4s-core","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"0.21.7","fixed":"0.21.24"},{"status":"affected","version":"0.22.0"},{"status":"affected","version":"0.22.0"},{"status":"affected","version":"0.22.0"},{"status":"affected","version":"0.22.0"},{"status":"affected","version":"0.22.0"},{"status":"affected","version":"0.22.0"},{"status":"affected","version":"0.22.0"},{"status":"affected","version":"0.22.0"},{"status":"affected","version":"0.23.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"},{"status":"affected","version":"1.0.0"}],"vendor":"typelevel","product":"http4s","cpe":"cpe:2.3:a:typelevel:http4s:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/http4s/http4s/security/advisories/GHSA-6h7w-fc84-x7p6","tags":["patch","third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/http4s/http4s/commit/52e1890665410b4385e37b96bc49c5e3c708e4e9","tags":["patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://mvnrepository.com/artifact/org.http4s/http4s-core","tags":["third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-32643","tags":["advisory"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-32643","url":"https://www.cve.org/CVERecord?id=CVE-2021-32643","licence":"CVE Terms of Use","modified":"2024-08-03T23:25:30.936Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-6h7w-fc84-x7p6","url":"https://github.com/advisories/GHSA-6h7w-fc84-x7p6","licence":"CC-BY-4.0","modified":"2026-07-08T06:28:02.301Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-32643","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-32643","licence":"Public domain","modified":"2026-06-17T03:53:20.107Z"}],"updatedAt":"2026-11-25T22:58:01.575Z","epss":{"score":0.01395,"percentile":0.73199,"date":"2026-12-01T12:00:22.000Z"}}