Skip to main content
VulnerabilityPublished Updated

Cohttp.Path.resolve_local_file · Path Traversal

Affects cohttpSource GCVE Database

0

CVSS 8.7 High : upgrade to 6.3.0 or 5f5a65ec3289c1cd8072bdf0ef22c181b4f11356 soon.

Data as of 23 Aug 2026, 13:45 UTC

CVSS 4.0 base score
8.7High
How severe the flaw is on the 0–10 CVSS scale.
Patch
Available – fixed in 6.3.0, 5f5a65ec3289c1cd8072bdf0ef22c181b4f11356
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N/S:N/AU:Y/R:A/V:D/RE:M

What to do

Upgrade cohttp to 6.3.0 or 5f5a65ec3289c1cd8072bdf0ef22c181b4f11356.

Affected software

ProductAffectedFixed in
opamcohttppkg:opam/cohttpOther threatsAffected
  • <6.3.0
  • <5f5a65ec3289c1cd8072bdf0ef22c181b4f11356
Fixed in
  • 6.3.0
  • 5f5a65ec3289c1cd8072bdf0ef22c181b4f11356

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

AI-suggested

A fix is available in Cohttp version 6.3.0. Users should upgrade to version 6.3.0 or later to remediate this vulnerability. No additional mitigation steps are indicated by the vendor advisory.

Description

The issue is that the function normalizes the URI path before percent decoding it: ```OCaml let resolve_local_file ~docroot ~uri = let path = Uri.(pct_decode (path (resolve "http" (of_string "/") uri))) in ... ``` Because `%2f` is decoded after Uri.resolve, encoded separators survive dot-segment normalization. For example, a request path like: ``` /static/..%2f..%2f..%2fetc/passwd ``` is normalized as a single encoded segment, then decoded into: ``` /static/../../../etc/passwd ``` afterwards. ## Timeline - Aug 11th 2026: report to security@ocaml.org - Aug 14th 2026: PR published on <https://github.com/mirage/ocaml-cohttp/pull/1145> - Aug 20th 2026: fix released in v6.3.0 <https://github.com/ocaml/opam-repository/pull/30528>

Community reviews

Loading reviews…