Junglewise Threat Intelligence

CVE-2026-57825: opam sandbox escape using symlinks in .install files

CVE-2026-57825 · Severity: medium · CVSS 5.7 · Published 2026-09-09

Vendors: OCaml.

Executive brief

opam is a package manager for the OCaml programming language that uses sandboxing to restrict what packages can access on a system. A flaw in how it processes symlinks in .install files allows a malicious package to escape the sandbox and write files to arbitrary locations, such as a user's home directory, potentially compromising the system and user data.

Technical details

The vulnerability exists in opam's handling of .install files, which specify where package files should be placed during installation. The package manager fails to properly resolve and validate symlinks in target paths before installation, allowing an attacker to bypass sandbox restrictions. An attacker can craft a package that creates a symlink pointing outside the intended installation directory (e.g., to the user's home directory) and use .install file directives to write files through that symlink. The attack requires the user to install the malicious package but no additional privileges or user interaction beyond the install command. This flaw affects all opam versions before 2.5.2, which includes the fix.

Affected products

  • OCaml opam before 2.5.2

Timeline

  • 2026-07-07: disclosed: Vulnerability published in OSV database
  • 2026-07-08: patched: opam 2.5.2 released with fix

References

Related threats