CVE-2026-41082

ocaml-opam: path traversal via the .install field

Published Apr 16, 2026 CVSS 3.1 · 7.3 High EPSS < 1% KEV · Not listed
Description
In OCaml opam before 2.5.1, a .install field containing a destination filepath can use ../ to reach a parent directory.

Analysis

AI-generated

Technical impact

In prior to version 2.5.1 of OCaml's opam package manager, the installer script field named ".install" allows a package author to specify a destination path for an installed file. A malicious package can insert the string "../" into this path, causing opam to write the file outside the intended package directory and potentially into system-wide locations. The effect is unauthorized modification of files that may lead to privilege escalation, configuration tampering, or denial of service if critical files are overwritten. This flaw corresponds to CWE-22 and CWE-24.

Affected Systems

The affected product is OCaml's opam, with all releases preceding 2.5.1 impacted. Packages that contain a malicious ".install" field within these versions pose the risk.

Risk and Exploitability

The vulnerability carries a CVSS score of 7.3, indicating high severity, and is not currently listed in the CISA Known Exploited Vulnerabilities catalog. The EPSS score of 0.00205 indicates a very low probability of exploitation. The likely attack vector is misuse of a malicious package either through a local repository or by convincing a user to install a compromised package. Successful exploitation requires the ability to supply or run an opam install command with the tainted package.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Apply the latest opam release 2.5.1 or newer, which removes the directory traversal flaw.
  • Limit opam to trusted package sources or use opam's "--trusted" flag when installing very carefully vetted packages.
  • Implement file system or opam environment restrictions (e.g., chroot or sandbox) to isolate installation directories when working with untrusted packages.

Generated by OpenCVE AI on August 14, 2026 at 04:09 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Debian DLA Debian DLA DLA-4541-1 opam security update
Debian DSA Debian DSA DSA-6216-1 opam security update
Ubuntu USN Ubuntu USN USN-8256-1 opam vulnerability
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Title Path Traversal in opam .install Files Enables Arbitrary File Modification ocaml-opam: path traversal via the .install field
References
Metrics threat_severity

None

threat_severity

Important

Type Values Removed Values Added
First Time appeared Ocaml
Ocaml ocaml
Vendors & Products Ocaml
Ocaml ocaml
Type Values Removed Values Added
Title Path Traversal in opam .install Files Enables Arbitrary File Modification
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description In OCaml opam before 2.5.1, a .install field containing a destination filepath can use ../ to reach a parent directory.
Weaknesses CWE-24
References
Metrics cvssV3_1

{'score': 7.3, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:L'}

Weaknesses
  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

  • CWE-24

    Path Traversal: '../filedir'

Sources

Status
PUBLISHED
Assigner
mitre
Published
Updated
Jul 15, 2026, 1:00 AM
Reserved
Apr 16, 2026, 5:32 PM
Status
Analyzed
Published
Apr 16, 2026, 6:16 PM
Modified
Oct 26, 2026, 9:10 PM
Severity
Important
Public date
Apr 16, 2026, 5:32 PM