Skip to content

setup-jbang pipes curl|bash with no signature/checksum verification #16

@potiuk

Description

@potiuk

Summary

action.yml installs JBang by piping a remote shell script directly into bash (and iex on Windows):

- name: 'Download JBang'
  shell: bash
  if: runner.os != 'Windows'
  run: |
    curl -Ls https://sh.jbang.dev | bash -s - app setup
    ...

- name: 'Download JBang (Windows)'
  shell: pwsh
  if: runner.os == 'Windows'
  run: |
    iex "& { $(iwr https://ps.jbang.dev) } app setup"

There's no checksum, signature, or attestation verification of either the bootstrap script or the JBang archive it ultimately downloads.

Why this matters

The Apache Software Foundation runs a security checker (verify-action-build, https://github.com/apache/infrastructure-actions) on every action used by ASF projects. For setup-jbang@v0.1.1 it raises:

  • pipe-to-shell (curl | sh) — high risk (action.yml line 28)
  • 1 unverified download (the binary that ends up at ${HOME}/.jbang/bin)

That blocks adoption from ASF infra (apache/infrastructure-actions#806) until the install path verifies what it executes.

What's already there

jbangdev/jbang releases ship the verification material we need:

  • checksums_sha256.txt + checksums_sha256.txt.asc (GPG-signed checksum file for all artifacts)
  • Per-artifact .sha256 and .asc (e.g. jbang.zip.sha256, jbang.zip.asc)
  • A versioned archive (jbang-X.Y.Z.zip / .tar) and unversioned aliases (jbang.zip / jbang.tar)

So an integrity-checked install is just a few extra lines — no new tooling needed.

Proposal

Replace the pipe-to-shell with an explicit download + verify, e.g. (Linux/macOS):

ver="${{ inputs.version }}"
curl -fsSLo jbang.zip        "https://github.com/jbangdev/jbang/releases/download/v${ver}/jbang-${ver}.zip"
curl -fsSLo jbang.zip.sha256 "https://github.com/jbangdev/jbang/releases/download/v${ver}/jbang-${ver}.zip.sha256"
sha256sum -c jbang.zip.sha256
unzip -q jbang.zip -d "${HOME}"
mv "${HOME}/jbang-${ver}" "${HOME}/.jbang"
echo "${HOME}/.jbang/bin" >> "$GITHUB_PATH"

…and the PowerShell equivalent (Get-FileHash -Algorithm SHA256 against the shipped .sha256).

For "latest", a small lookup step against the Releases API can resolve the tag first (or default inputs.version to a pinned tag rather than latest).

If you'd prefer GPG verification (gpg --verify jbang.zip.asc) or sigstore, those are also accepted by the ASF checker — happy to align on whichever path you prefer.

One more thing

This repo has no LICENSE file at the root — would be great to add one (Apache-2.0 / MIT / whatever matches the JBang project itself). It's also one of the metadata signals the ASF checker reports.

Happy to send a PR for the install-path change once you indicate which verification mechanism you'd like to standardize on.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions