Skip to content

Invalidate .install fields containing destination filepath trying to escape their scope#6897

Merged
kit-ty-kate merged 3 commits intoocaml:masterfrom
kit-ty-kate:fix-dotinstall-escape
Apr 15, 2026
Merged

Invalidate .install fields containing destination filepath trying to escape their scope#6897
kit-ty-kate merged 3 commits intoocaml:masterfrom
kit-ty-kate:fix-dotinstall-escape

Conversation

@kit-ty-kate
Copy link
Copy Markdown
Member

@kit-ty-kate kit-ty-kate commented Apr 15, 2026

Absolute filepaths and paths containing '..' were already forbidden by the opam manual.

Per the <pkgname>.install section:

Absolute paths, or paths referencing the parent directory (..), are not allowed.

The following dangerous pattern was previously possible:

bin: [
  "payload.sh" {"../../../.bashrc"}
]

Absolute pathname though act as if they were starting from %{bin}% so no real issue with them.

Backported to 2.5 in #6898

@kit-ty-kate kit-ty-kate added this to the 2.6.0~alpha1 milestone Apr 15, 2026
…escape their scope

Absolute filepaths and paths containing '..' were already forbidden by
the opam manual.

Per the <pkgname>.install section:
> Absolute paths, or paths referencing the parent directory (..), are not allowed.
@kit-ty-kate kit-ty-kate force-pushed the fix-dotinstall-escape branch from a996e3e to ae877c0 Compare April 15, 2026 16:50
@kit-ty-kate kit-ty-kate merged commit d7283e3 into ocaml:master Apr 15, 2026
39 checks passed
@kit-ty-kate kit-ty-kate deleted the fix-dotinstall-escape branch April 15, 2026 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants