Skip to main content

OCaml opam CVE-2026-41082

| EUVDEUVD-2026-23288 HIGH
Path Traversal: '../filedir' (CWE-24)
2026-04-16 mitre GHSA-97q5-qf47-hvrw
7.8
CVSS 3.1 · NVD
View

Attack ChainAIDerived

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

  1. Access
    Publish or compromise opam package
  2. Delivery
    Craft .install with ../ destination
  3. Exploit
    Victim runs opam install
  4. Execution
    Traversal writes file outside prefix
  5. Persist
    Overwrite startup script or binary
  6. Impact
    Code executes as victim

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Path traversal prevention
Exploitation Conditions

Requires the victim to install a crafted opam package whose .install field contains a destination filepath with ../ traversal sequences - that malicious .install content IS the specific trigger condition. Exploitation is limited by mandatory user interaction (the victim must run an install of the attacker-supplied package), by the local attack vector (no remote/network trigger), and by the writable filesystem scope of the account running opam (a non-root install cannot reach root-owned paths). It affects all opam versions before 2.5.1 in default configuration; no special non-default feature toggle is needed beyond normal package installation.

Impact

The provided CVSS 3.1 vector (AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H, base 7.8) reflects a local, user-interaction-gated flaw rather than a remotely triggerable one - the 7.8 is driven by high C/I/A impact, not by remote reachability. This is corroborated by the CISA SSVC assessment: Exploitation 'none', Automatable 'no', Technical Impact 'partial', and by EPSS at 0.01% (0th percentile), indicating no meaningful mass-exploitation pressure. It is not on CISA KEV and no POC is referenced. Note a data inconsistency worth flagging: the tags label this 'Information Disclosure' and CVSS sets C:H, but the mechanism is fundamentally an arbitrary file WRITE (path traversal on install destinations), so integrity/availability impact is the more accurate primary consequence - verify the confidentiality rating against the actual write primitive. Realistically this is a moderate, opportunistic supply-chain risk: it requires a victim to install a malicious or compromised package, which limits blast radius but is a legitimate threat in package-manager ecosystems.

Exploit ScenarioDerived

An attacker publishes (or compromises) an opam package whose .install file specifies a destination such as ../../../../home/victim/.bashrc or a path into the user's PATH; when the victim runs opam install on that package, opam writes attacker-controlled content outside the intended prefix, potentially overwriting a startup script or a binary that later executes. Because the flaw is a file-write primitive gated by the install action, follow-on code execution occurs when the clobbered file is next used. No public POC is referenced, and the vector requires the victim to install the malicious package.

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

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

Alert me

AnalysisAIv1 – Jul 24, 2026

Arbitrary file write in OCaml opam before 2.5.1 allows a malicious package to escape its intended installation scope: a destination filepath in a package's .install field can contain ../ sequences to reach parent directories and drop files outside the target prefix. Exploitation requires a user to install a crafted opam package, so it is a supply-chain/local vector rather than a remote one. Tracked as OSEC-2026-03 and fixed in opam 2.5.1; no public exploit identified at time of analysis and EPSS is negligible (0.01%).

RemediationAI

Vendor-released patch: opam 2.5.1 - upgrade to 2.5.1 or later, which invalidates .install fields whose destination filepaths escape their scope (PR https://github.com/ocaml/opam/pull/6897, release https://github.com/ocaml/opam/releases/tag/2.5.1). For distribution installs, apply the Debian LTS update (https://lists.debian.org/debian-lts-announce/2026/04/msg00021.html) or the Red Hat fix once shipped (https://access.redhat.com/security/cve/CVE-2026-41082). Until upgraded, the practical compensating control is to install only packages from trusted repositories and pinned sources and to avoid installing untrusted or unaudited opam packages, since the vulnerability triggers during package installation; where feasible, run installs under an unprivileged user and in isolated/containerized switches so that a traversal write cannot reach sensitive system paths - the trade-off is added workflow friction and it does not prevent damage within the reachable filesystem scope of that user.

Affected VersionsENISA

opam 0 <2.5.1

Affected Packages

euvd opam fix: 2.5.1

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

opam is the standard package manager for the OCaml ecosystem. When installing a package, opam processes the .install file, which declares source-to-destination file mappings that place build artifacts (binaries, libraries, docs, config) into the switch or system prefix. The root cause is CWE-24 (Path Traversal: '../filedir'): opam did not properly validate or normalize destination paths, so a ../ component in a declared destination allowed the resolved write target to escape the intended scope. The fix (#6897) invalidates .install fields whose destination filepaths attempt to escape their scope and hardens OpamFilename.might_escape, including correct treatment of / as a separator on Windows. The affected CPE is cpe:2.3:a:ocaml:opam:*:*:*:*:*:*:*:* for all versions prior to 2.5.1.

Know when Ocaml 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

NVD PRIMARY 7.8 HIGH
AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
vuln.today AI 7.3 HIGH

Local install-time file-write primitive needing victim interaction (UI:R, AV:L); high integrity/availability impact from arbitrary writes, only limited confidentiality since it is a write, not a read.

3.1 AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:H/A:H
4.0 AV:L/AC:L/AT:N/PR:N/UI:A/VC:L/VI:H/VA:H/SC:N/SI:N/SA:N
SUSE 7.3 HIGH
AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:L
Red Hat 7.1 HIGH

Primary rating from NVD.

CVSS VectorNVD

Attack Vector
Local
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

5
CVSS changed
Jul 08, 2026 - 03:37 NVD
7.3 (HIGH) 7.8 (HIGH)
Patch released
Apr 21, 2026 - 10:16 nvd
Patch available
Patch available
Apr 16, 2026 - 19:16 EUVD
CVE Published
Apr 16, 2026 - 17:32 nvd
HIGH 7.8
CVE Published
Apr 16, 2026 - 17:32 nvd
HIGH 7.3

DescriptionNVD

In OCaml opam before 2.5.1, a .install field containing a destination filepath can use ../ to reach a parent directory.

Executive ViewAI

Why It Matters

OCaml's opam package manager (versions before 2.5.1) allows malicious packages to write files outside their intended installation directories, creating a supply-chain attack vector that can compromise development systems when users install affected packages. Development teams relying on opam face risk of system compromise through the software dependency chain. Immediate upgrade to opam 2.5.1 is required to restore installation boundary enforcement.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.0%
Top 100% exploitable
Prevalence
Low
standard OCaml package manager, but OCaml is a niche-language ecosystem
Data Quality
8 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment Vendor 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.0%
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
Small
Automatable
No
Human Impact
High
Technical Impact
Partial

Priority Score

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

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

More in Ocaml

View all
CVE-2017-9772 CRITICAL
9.8 Jun 23

Insufficient sanitisation in the OCaml compiler versions 4.04.0 and 4.04.1 allows external code to be executed with rais

CVE-2015-8869 CRITICAL
9.1 Jun 13

OCaml before 4.03.0 does not properly handle sign extensions, which allows remote attackers to conduct buffer overflow a

CVE-2018-9838 CRITICAL
9.8 Apr 06

The caml_ba_deserialize function in byterun/bigarray.c in the standard library in OCaml 4.06.0 has an integer overflow w

CVE-2026-89086 CRITICAL
9.1 Sep 10

Signature verification bypass in the OCaml jose library (ulrikstrid/ocaml-jose) before 0.11.0 lets attackers forge valid

CVE-2017-9779 HIGH
7.8 Sep 07

OCaml compiler allows attackers to have unspecified impact via unknown vectors, a similar issue to CVE-2017-9772 "but wi

CVE-2026-28364 HIGH
7.8 Feb 27

Heap memory corruption in the OCaml runtime (before 4.14.3 and 5.x before 5.4.1) lets an attacker who can feed crafted M

CVE-2026-87734 HIGH
7.5 Sep 09

Remote denial of service in the utcp OCaml TCP userspace library before version 0.0.6 is possible via crafted out-of-ord

CVE-2026-89087 HIGH
7.3 Sep 10

Index mishandling in the OCaml cstruct library before 6.3.0 allows network-reachable attackers to trigger partial confid

CVE-2026-96609 HIGH
7.1 Sep 23

Denial of service in Robur Albatross (specifically the albatross-console component) versions 1.0.0 through 2.x before 2.

CVE-2026-87733 MEDIUM
6.2 Sep 09

ECDSA signature forgery is possible in mirage-crypto-ec before 2.2.0 for OCaml because the P256, P384, and P521 pub_of_o

CVE-2026-87732 MEDIUM
6.2 Sep 09

Authenticated decryption in mirage-crypto before 2.2.0 for OCaml violates the security invariant of AEAD schemes by writ

CVE-2026-87737 MEDIUM
5.9 Sep 09

Timing side-channel in mirage-crypto-ec before 2.4.0 for OCaml enables remote cryptographic key recovery by exploiting s

Vendor StatusVendor

SUSE

Severity: High
Product Status
openSUSE Tumbleweed Fixed

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