Skip to main content

cohttp OCaml CVE-2026-82481

| EUVDEUVD-2026-68116 HIGH
Incorrect Behavior Order: Validate Before Canonicalize (CWE-180)
2026-08-29 mitre GHSA-qcjm-vmrx-v935
8.7
CVSS 4.0 · Vendor: mitre
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Send HTTP request with percent-encoded traversal (..%2f)
  2. Delivery
    Library validates path before decoding, traversal survives
  3. Exploit
    URI percent-decoded after sanitization
  4. Execution
    resolve_local_file maps traversal outside docroot
  5. Impact
    Arbitrary file returned in HTTP response

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Leading special element handling
Exploitation Conditions

Exploitation requires that the target server is built with the cohttp OCaml library (any version before 6.3.0) and uses Cohttp.Path.resolve_local_file to map request URIs to local files for serving. Servers that do not invoke this function - for example, those that use cohttp only as an HTTP client or that handle routing entirely in application logic without local file resolution - are not affected. The CVSS vector (AV:N/AC:L/PR:N/UI:N) confirms no authentication is required and no special client-side conditions apply. Exploitation is limited to confidentiality (file reads); the CVSS vector records no integrity or availability impact, consistent with a read-only traversal primitive. Filesystem permissions apply: files readable only by root or a privileged user will resist exfiltration if the server process runs under a restricted account.

Impact

The CVSS 4.0 score of 8.7 with vector AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N reflects a high-confidence assessment: network-reachable, no authentication, no user interaction, and high confidentiality impact. These signals are consistent with the technical description - any HTTP server using resolve_local_file is exposed with no prerequisites beyond network access. EPSS data was not provided in the intelligence feed, so exploitation probability cannot be quantified; however, the attack primitive (percent-encoded path traversal) is well-understood and trivially scriptable, making low EPSS unlikely if the library sees meaningful deployment. No KEV listing exists, and no public POC has been identified, suggesting exploitation is not yet observed at scale. The primary risk limiter is prevalence: cohttp is confined to the OCaml/MirageOS ecosystem, which is a niche deployment footprint compared to mainstream HTTP stacks. Servers not using resolve_local_file (e.g., those that handle file serving through other means) are not affected.

Exploit ScenarioDerived

An unauthenticated attacker sends an HTTP GET request to a cohttp-based static file server with a URI containing percent-encoded traversal sequences, for example GET /..%2f..%2f..%2fetc%2fpasswd HTTP/1.1. Because the library strips .. segments before decoding, the encoded form survives sanitization and is resolved against the docroot after decoding, returning the contents of /etc/passwd or any other readable file on the filesystem. No exploit code has been publicly identified, but the technique is elementary and well-documented for this class of flaw.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.5% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Aug 29, 2026

Directory traversal in the cohttp OCaml HTTP library before version 6.3.0 allows unauthenticated remote attackers to read arbitrary files outside the configured document root by supplying percent-encoded path traversal sequences such as ..%2f..%2f in HTTP request URIs. The root cause (CWE-180) is that Cohttp.Path.resolve_local_file validated and stripped . and .. segments before percent-decoding the URI, meaning encoded traversal bypassed sanitization entirely. No public exploit code or CISA KEV listing has been identified at time of analysis, but the network-accessible, zero-authentication attack surface makes this a straightforward read primitive for any server using cohttp's static file resolution.

RemediationAI

Upgrade cohttp to version 6.3.0 or later via opam (opam update && opam upgrade cohttp cohttp-mirage); v6.3.0 was released 2026-08-19 and is confirmed in the upstream CHANGES.md (https://github.com/mirage/ocaml-cohttp/pull/1145). If an immediate upgrade is not possible, servers that perform access-control decisions on path segments must apply the new Cohttp.Path.normalise function to Request.uri before any path inspection - the PR includes a worked example. As a compensating control, operators can place a reverse proxy (nginx, HAProxy) in front of the cohttp application and configure it to normalize or reject requests containing percent-encoded slash or dot sequences (%2f, %2e, %2F, %2E); note that some proxy defaults pass these through unchanged, so explicit deny rules are required. Restricting the cohttp server to non-public network segments limits exposure but does not eliminate the vulnerability for internal threat models.

Affected VersionsENISA

cohttp 0 <6.3.0

Affected Packages

euvd cohttp fix: 6.3.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

cohttp (CPE: cpe:2.3:a:mirage:cohttp:*:*:*:*:*:*:*:*) is the primary HTTP/1.x client-server library for OCaml, widely used in the MirageOS unikernel ecosystem and standard OCaml web applications. The vulnerability maps to CWE-180 (Incorrect Behavior Order: Validate Before Canonicalize): the library's Cohttp.Path.resolve_local_file function removed . and .. path segments prior to percent-decoding the URI, so a segment encoded as ..%2f survived the sanitization pass and was then decoded into a functional directory traversal component. The fix in v6.3.0 (PR #1145) reverses this order - the URI is percent-decoded exactly once before segment normalization - and introduces a new Cohttp.Path.normalise function that produces a root-confined relative path for use in access-control decisions. The cohttp-mirage static file server component was also corrected to normalize request paths before looking them up in the mirage-kv key-value store.

Know when Cohttp gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (mitre) PRIMARY 8.7 HIGH
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/AU:Y/R:A/V:D/RE:M
vuln.today AI 7.5 HIGH

Network vector, no auth, no interaction; pure read-only traversal gives high confidentiality but no integrity or availability impact.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (mitre).

CVSS VectorVendor: mitre

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
None
Vulnerable system: Availability
None
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

2
Patch available
Aug 29, 2026 - 16:01 EUVD
CVE Published
Aug 29, 2026 - 14:43 cve.org
HIGH 8.7

DescriptionCVE.org

The cohttp package before 6.3.0 for OCaml allows directory traversal.

Executive ViewAI

Why It Matters

The cohttp OCaml HTTP library contains a directory traversal vulnerability (CVSS 8.7) enabling unauthenticated remote attackers to read arbitrary files outside the configured document root via percent-encoded path sequences. Organizations operating cohttp-based web services face potential exposure of sensitive configuration files, credentials, and application source code to any attacker with network access. Immediate assessment and mitigation of affected systems is required.

Business Impact: High
Compensating Controls

No vendor-released patch identified at time of analysis. Implement these interim protections: (1) Restrict cohttp services to serve only from a minimal, hardened document root containing no sensitive files; (2) Add strict input validation that performs full percent-decoding and path canonicalization before any permission checks or file operations; (3) Deploy Web Application Firewall rules to block requests containing encoded path traversal sequences such as %2e%2e and %2f; (4) Run cohttp processes in containerized environments with minimal mounted file systems and read-only access where operationally feasible; (5) Enable comprehensive access logging on all file I/O operations with real-time alerting for suspicious path traversal patterns; (6) Deploy a hardened reverse proxy (nginx, Apache) with strict allowlist-based file serving policies in front of cohttp services.

Threat Intelligence Overview

EPSS Score
0.5%
Top 59% exploitable
Prevalence
Low
niche OCaml/MirageOS ecosystem, limited enterprise footprint
Social Media
1
Sightings
Data Quality
6 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment CIRCL GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.5%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
Yes
Human Impact
High
Technical Impact
Partial

Priority Score

45
Low Medium High Critical
KEV: 0
EPSS: +1
CVSS: +44
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy