Skip to content
Heist/ feed
Back to feed
Medium

Security advisory

Type: advisorySources: OSVCVE: CVE-2021-32643

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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2021-32643
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 11:46 UTC · Revision 1

Source evidence

CVE-2021-32643

core-osv · Original source

Published 27 May 2021, 18:15 UTC

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.

osv:CVE-2021-32643
Complete source record
{
  "id": "680e7f7ad523b7a231f5ccd2dcb1818e19fa1e1883b24c1ce0f69f07df51a742",
  "url": "https://osv.dev/vulnerability/CVE-2021-32643",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "CVE-2021-32643",
    "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.",
    "evidence": "osv:CVE-2021-32643",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2021-32643",
      "aliases": [
        "CVE-2021-32643",
        "GHSA-6h7w-fc84-x7p6"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/http4s/http4s",
              "type": "GIT",
              "events": [
                {
                  "introduced": "6ad94f6ffeda3644321d85fcaf82d666d996e87a"
                },
                {
                  "fixed": "2d2e26171bfc2881ea4b00c42c463d801c777db0"
                },
                {
                  "introduced": "c56f915bd81c2fe19dcb04e32ad39c3972fac2e1"
                },
                {
                  "last_affected": "6676c1e24a4e32e0c6c1a36911f4e6606c10e12b"
                },
                {
                  "fixed": "52e1890665410b4385e37b96bc49c5e3c708e4e9"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:typelevel:http4s:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "0.21.7"
                      },
                      {
                        "fixed": "0.21.24"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "cpe": "cpe:2.3:a:typelevel:http4s:0.22.0:milestone1:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "0.22.0-milestone1"
                      },
                      {
                        "last_affected": "0.22.0-milestone1"
                      }
                    ],
                    "source": "CPE_STRING"
                  },
                  {
                    "cpe": "cpe:2.3:a:typelevel:http4s:0.22.0:milestone2:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "0.22.0-milestone2"
                      },
                      {
                        "last_affected": "0.22.0-milestone2"
                      }
                    ],
                    "source": "CPE_STRING"
                  },
                  {
                    "cpe": "cpe:2.3:a:typelevel:http4s:0.22.0:milestone3:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "0.22.0-milestone3"
                      },
                      {
                        "last_affected": "0.22.0-milestone3"
                      }
                    ],
                    "source": "CPE_STRING"
                  },
                  {
                    "cpe": "cpe:2.3:a:typelevel:http4s:0.22.0:milestone4:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "0.22.0-milestone4"
                      },
                      {
                        "last_affected": "0.22.0-milestone4"
                      }
                    ],
                    "source": "CPE_STRING"
                  },
                  {
                    "cpe": "cpe:2.3:a:typelevel:http4s:0.22.0:milestone5:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "0.22.0-milestone5"
                      },
                      {
                        "last_affected": "0.22.0-milestone5"
                      }
                    ],
                    "source": "CPE_STRING"
                  },
                  {
                    "cpe": "cpe:2.3:a:typelevel:http4s:0.22.0:milestone6:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "0.22.0-milestone6"
                      },
                      {
                        "last_affected": "0.22.0-milestone6"
                      }
                    ],
                    "source": "CPE_STRING"
                  },
                  {
                    "cpe": "cpe:2.3:a:typelevel:http4s:0.22.0:milestone7:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "0.22.0-milestone7"
                      },
                      {
                        "last_affected": "0.22.0-milestone7"
                      }
                    ],
                    "source": "CPE_STRING"
                  },
                  {
                    "cpe": "cpe:2.3:a:typelevel:http4s:0.22.0:milestone8:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "0.22.0-milestone8"
                      },
                      {
                        "last_affected": "0.22.0-milestone8"
                      }
                    ],
                    "source": "CPE_STRING"
                  },
                  {
                    "cpe": "cpe:2.3:a:typelevel:http4s:0.23.0:milestone1:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "0.23.0-milestone1"
                      },
                      {
                        "last_affected": "0.23.0-milestone1"
                      }
                    ],
                    "source": "CPE_STRING"
                  },
                  {
                    "cpe": "cpe:2.3:a:typelevel:http4s:1.0.0:milestone1:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "1.0.0-milestone1"
                      },
                      {
                        "last_affected": "1.0.0-milestone1"
                      }
                    ],
                    "source": "CPE_STRING"
                  },
                  {
                    "cpe": "cpe:2.3:a:typelevel:http4s:1.0.0:milestone10:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "1.0.0-milestone10"
                      },
                      {
                        "last_affected": "1.0.0-milestone10"
                      }
                    ],
                    "source": "CPE_STRING"
                  },
                  {
                    "cpe": "cpe:2.3:a:typelevel:http4s:1.0.0:milestone11:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "1.0.0-milestone11"
                      },
                      {
                        "last_affected": "1.0.0-milestone11"
                      }
                    ],
                    "source": "CPE_STRING"
                  },
                  {
                    "cpe": "cpe:2.3:a:typelevel:http4s:1.0.0:milestone12:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "1.0.0-milestone12"
                      },
                      {
                        "last_affected": "1.0.0-milestone12"
                      }
                    ],
                    "source": "CPE_STRING"
                  },
                  {
                    "cpe": "cpe:2.3:a:typelevel:http4s:1.0.0:milestone13:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "1.0.0-milestone13"
                      },
                      {
                        "last_affected": "1.0.0-milestone13"
                      }
                    ],
                    "source": "CPE_STRING"
                  },
                  {
                    "cpe": "cpe:2.3:a:typelevel:http4s:1.0.0:milestone14:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "1.0.0-milestone14"
                      },
                      {
                        "last_affected": "1.0.0-milestone14"
                      }
                    ],
                    "source": "CPE_STRING"
                  },
                  {
                    "cpe": "cpe:2.3:a:typelevel:http4s:1.0.0:milestone15:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "1.0.0-milestone15"
                      },
                      {
                        "last_affected": "1.0.0-milestone15"
                      }
                    ],
                    "source": "CPE_STRING"
                  },
                  {
                    "cpe": "cpe:2.3:a:typelevel:http4s:1.0.0:milestone16:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "1.0.0-milestone16"
                      },
                      {
                        "last_affected": "1.0.0-milestone16"
                      }
                    ],
                    "source": "CPE_STRING"
                  },
                  {
                    "cpe": "cpe:2.3:a:typelevel:http4s:1.0.0:milestone17:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "1.0.0-milestone17"
                      },
                      {
                        "last_affected": "1.0.0-milestone17"
                      }
                    ],
                    "source": "CPE_STRING"
                  },
                  {
                    "cpe": "cpe:2.3:a:typelevel:http4s:1.0.0:milestone18:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "1.0.0-milestone18"
                      },
                      {
                        "last_affected": "1.0.0-milestone18"
                      }
                    ],
                    "source": "CPE_STRING"
                  },
                  {
                    "cpe": "cpe:2.3:a:typelevel:http4s:1.0.0:milestone19:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "1.0.0-milestone19"
                      },
                      {
                        "last_affected": "1.0.0-milestone19"
                      }
                    ],
                    "source": "CPE_STRING"
                  },
                  {
                    "cpe": "cpe:2.3:a:typelevel:http4s:1.0.0:milestone2:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "1.0.0-milestone2"
                      },
                      {
                        "last_affected": "1.0.0-milestone2"
                      }
                    ],
                    "source": "CPE_STRING"
                  },
                  {
                    "cpe": "cpe:2.3:a:typelevel:http4s:1.0.0:milestone20:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "1.0.0-milestone20"
                      },
                      {
                        "last_affected": "1.0.0-milestone20"
                      }
                    ],
                    "source": "CPE_STRING"
                  },
                  {
                    "cpe": "cpe:2.3:a:typelevel:http4s:1.0.0:milestone21:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "1.0.0-milestone21"
                      },
                      {
                        "last_affected": "1.0.0-milestone21"
                      }
                    ],
                    "source": "CPE_STRING"
                  },
                  {
                    "cpe": "cpe:2.3:a:typelevel:http4s:1.0.0:milestone22:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "1.0.0-milestone22"
                      },
                      {
                        "last_affected": "1.0.0-milestone22"
                      }
                    ],
                    "source": "CPE_STRING"
                  },
                  {
                    "cpe": "cpe:2.3:a:typelevel:http4s:1.0.0:milestone3:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "1.0.0-milestone3"
                      },
                      {
                        "last_affected": "1.0.0-milestone3"
                      }
                    ],
                    "source": "CPE_STRING"
                  },
                  {
                    "cpe": "cpe:2.3:a:typelevel:http4s:1.0.0:milestone4:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "1.0.0-milestone4"
                      },
                      {
                        "last_affected": "1.0.0-milestone4"
                      }
                    ],
                    "source": "CPE_STRING"
                  },
                  {
                    "cpe": "cpe:2.3:a:typelevel:http4s:1.0.0:milestone5:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "1.0.0-milestone5"
                      },
                      {
                        "last_affected": "1.0.0-milestone5"
                      }
                    ],
                    "source": "CPE_STRING"
                  },
                  {
                    "cpe": "cpe:2.3:a:typelevel:http4s:1.0.0:milestone6:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "1.0.0-milestone6"
                      },
                      {
                        "last_affected": "1.0.0-milestone6"
                      }
                    ],
                    "source": "CPE_STRING"
                  },
                  {
                    "cpe": "cpe:2.3:a:typelevel:http4s:1.0.0:milestone7:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "1.0.0-milestone7"
                      },
                      {
                        "last_affected": "1.0.0-milestone7"
                      }
                    ],
                    "source": "CPE_STRING"
                  },
                  {
                    "cpe": "cpe:2.3:a:typelevel:http4s:1.0.0:milestone8:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "1.0.0-milestone8"
                      },
                      {
                        "last_affected": "1.0.0-milestone8"
                      }
                    ],
                    "source": "CPE_STRING"
                  },
                  {
                    "cpe": "cpe:2.3:a:typelevel:http4s:1.0.0:milestone9:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "1.0.0-milestone9"
                      },
                      {
                        "last_affected": "1.0.0-milestone9"
                      }
                    ],
                    "source": "CPE_STRING"
                  },
                  {
                    "range": [
                      {
                        "fixed": "52e1890665410b4385e37b96bc49c5e3c708e4e9"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "versions": [
            "0.22.0-milestone1",
            "0.22.0-milestone2",
            "0.22.0-milestone3",
            "0.22.0-milestone4",
            "0.22.0-milestone5",
            "0.22.0-milestone6",
            "0.22.0-milestone7",
            "0.22.0-milestone8",
            "0.23.0-milestone1",
            "1.0.0-milestone1",
            "1.0.0-milestone10",
            "1.0.0-milestone11",
            "1.0.0-milestone12",
            "1.0.0-milestone13",
            "1.0.0-milestone14",
            "1.0.0-milestone15",
            "1.0.0-milestone16",
            "1.0.0-milestone17",
            "1.0.0-milestone18",
            "1.0.0-milestone19",
            "1.0.0-milestone2",
            "1.0.0-milestone20",
            "1.0.0-milestone21",
            "1.0.0-milestone22",
            "1.0.0-milestone3",
            "1.0.0-milestone4",
            "1.0.0-milestone5",
            "1.0.0-milestone6",
            "1.0.0-milestone7",
            "1.0.0-milestone8",
            "1.0.0-milestone9",
            "v0.21.23",
            "v0.21.22",
            "v0.21.21",
            "v0.21.20",
            "v0.21.19",
            "v0.21.18",
            "v0.21.16",
            "v0.21.15",
            "v0.21.14",
            "v0.21.13",
            "v0.21.12",
            "v0.21.11",
            "v0.21.9",
            "v0.21.8",
            "v0.21.7"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-32643.json"
          }
        }
      ],
      "modified": "2026-10-20T10:54:41.954983908Z",
      "provider": "osv",
      "references": [
        "https://mvnrepository.com/artifact/org.http4s/http4s-core",
        "https://github.com/http4s/http4s/commit/52e1890665410b4385e37b96bc49c5e3c708e4e9",
        "https://github.com/http4s/http4s/security/advisories/GHSA-6h7w-fc84-x7p6"
      ],
      "provider_metadata": {}
    },
    "related_cves": [
      {
        "value": "CVE-2021-32643",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 385920,
  "published_at": "2021-05-27T18:15:07.903+00:00"
}