{"id":"OSEC-2026-03","summary":"opam install sandbox escape","details":"## Summary\n\n`.install` files do not validate whether they are inside the package area, and so can bypass sandboxing.\n\n## Exploit\n\nIn a `package.install` file, this installs a file as ``~/.bashrc`:\n```\nbin: [\n  \"payload.sh\" {\"../../../.bashrc\"}\n]\n```\n\n## Timeline\n\n- 2026-04-11: Anil forwarded the issue from Andrew Nesbitt to the OCaml security team\n- 2026-04-11: Kate developed a fix\n- 2026-04-15: opam 2.5.1 was released with the fix","aliases":["CVE-2026-41082"],"modified":"2026-04-16T21:00:00Z","published":"2026-04-15T22:00:00Z","database_specific":{"human_link":"https://github.com/ocaml/security-advisories/tree/main/advisories/2026/OSEC-2026-03.md","osv":"https://github.com/ocaml/security-advisories/tree/generated-osv/2026/OSEC-2026-03.json","cwe":["CWE-693"]},"references":[{"type":"FIX","url":"https://github.com/ocaml/opam/pull/6897"},{"type":"FIX","url":"https://github.com/ocaml/opam/pull/6898"}],"affected":[{"package":{"name":"opam-devel","ecosystem":"opam","purl":"pkg:opam/opam-devel"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.5.1"}]},{"type":"GIT","repo":"https://github.com/ocaml/opam","events":[{"introduced":"0"},{"fixed":"d7283e3b5845447ee618794d87cfe224dd980c8f"}]},{"type":"GIT","repo":"https://github.com/ocaml/opam","events":[{"introduced":"0"},{"fixed":"c8fcf65779fe7048f9b5ef59886bfa9c5d102d84"}]}],"versions":["2.0~alpha5","2.0.0~beta","2.0.0~beta3","2.0.0~beta3.1","2.0.0~beta5","2.0.0~rc","2.0.0~rc2","2.0.0~rc3","2.0.0","2.0.1","2.0.2","2.0.3","2.0.4","2.0.5","2.0.6","2.0.7","2.0.8","2.0.9","2.0.10","2.1.0~beta2","2.1.0~beta4","2.1.0~rc","2.1.0~rc2","2.1.0","2.1.1","2.1.2","2.1.3","2.1.4","2.1.5","2.1.6","2.2.0~alpha","2.2.0~alpha2","2.2.0~alpha3","2.2.0~beta1","2.2.0~beta2","2.2.0~beta3","2.2.0~rc1","2.2.0","2.2.1","2.3.0~alpha1","2.3.0~beta1","2.3.0~beta2","2.3.0~rc1","2.3.0","2.4.0~alpha1","2.4.0~alpha2","2.4.0~beta1","2.4.0~rc1","2.4.0","2.4.1","2.5.0~alpha1","2.5.0~beta1","2.5.0~rc1","2.5.0"],"ecosystem_specific":{"opam_constraint":"opam-devel {\u003c \"2.5.1\"}"},"database_specific":{"source":"https://github.com/ocaml/security-advisories/blob/generated-osv/2026/OSEC-2026-03.json"}}],"schema_version":"1.7.5","severity":[{"type":"CVSS_V3","score":"CVSS:3.0/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:H/A:N"}],"credits":[{"name":"Andrew Nesbitt","type":"REPORTER"},{"name":"Kate","type":"REMEDIATION_DEVELOPER"},{"name":"Raja Boujbel","type":"REMEDIATION_REVIEWER"},{"name":"Hannes Mehnert","type":"COORDINATOR"}]}