Skip to content

Compose provider extensions/plugins can only execute ".exe" on windows #14157

Description

@phr34k

The Windows plugin discovery currently appears to restrict plugins to .exe files. I'm not sure this is desirable behavior.

return s + ".exe"

On Windows, executable command resolution normally respects PATHEXT, which allows extensions such as .CMD, .BAT, and potentially .PY (depending on the environment) to be invoked without explicitly specifying the extension.

Restricting Compose plugins to .exe therefore prevents lightweight script-based plugins. For example, a plugin could be implemented as a Python, batch, or other script rather than requiring a compiled executable.

I think plugin discovery should probably respect PATHEXT (or otherwise use the same executable-resolution semantics as Windows), rather than hard-coding .exe.

This would also make Compose plugin behavior more consistent with how commands are normally resolved on Windows.

Activity

  1. changed the title [-]Compose provider extensions/pplugins can only execute ".exe" on windows[/-] [+]Compose provider extensions/plugins can only execute ".exe" on windows[/+] on Sep 1, 2026
  2. self-assigned this
    on Sep 1, 2026
  3. ndeloof commented on Sep 1, 2026

    @ndeloof
    Contributor

    You're right — thanks for the report. The hardcoded .exe in the PATH fallback was actually redundant even for compiled binaries: exec.LookPath already implements Windows executable resolution and tries each PATHEXT extension (.com/.exe/.bat/.cmd by default), so appending the suffix only narrowed the lookup. Fix: #14159 drops it and looks up the bare provider name.

    Two caveats worth stating:

    • This only affects the PATH fallback of provider discovery. The docker CLI plugin channel (docker-<name> in cli-plugins) keeps requiring .exe on Windows — that convention belongs to docker/cli.
    • .py (or anything relying on a file association) still won't work even when listed in PATHEXT: providers are spawned via CreateProcess, which does not honor associations. In practice this enables what Windows can execute directly — .exe, .com, and batch files. For batch files, the Go runtime mitigates the cmd.exe argument-injection class (BatBadBut) by refusing arguments it cannot safely escape. A script-based provider is best shipped as a .cmd shim or a compiled launcher.
  4. added a commit that references this issue on Sep 1, 2026
    2be4e2d
  5. phr34k commented on Sep 2, 2026

    @phr34k
    Author

    @ndeloof wouldn't it be possible to support file associations on Windows e.g. instead of CreateProcess to use ShellExecute? Of course a shim works, but it imposes some additional frictions you need to go through for support both platforms. So if you use ShellExecute and have a more faithful adaption, wouldn't that be overall better?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions