# OSEC-2026-16: Path traversal in Cohttp.Path.resolve_local_file

- Severity: not scored yet
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2026-08-20T18:15:00.000Z
- Modified: 2026-11-06T13:45:03.048Z

## 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>

(As written by OCaml Security Advisories.)

## Affected

- cohttp (opam): before 6.3.0
- https://github.com/mirage/ocaml-cohttp.git: before 5f5a65ec3289c1cd8072bdf0ef22c181b4f11356

## Sources

- OCaml Security Advisories: [OSEC-2026-16](https://osv.dev/vulnerability/OSEC-2026-16), CC0-1.0, modified 2026-11-06

---

Page: https://cve.day/OSEC-2026-16 · Whole record: https://cve.day/OSEC-2026-16.json · Rebuilt by cve.day 2026-11-25T22:56:18.361Z
