Skip to content

ci: Replace curl-pipe-bash with getsentry/action-setup-cli for sentry-cli install - #529

Merged
runningcode merged 2 commits into
masterfrom
semgrep-autofix/1785953500
Aug 6, 2026
Merged

ci: Replace curl-pipe-bash with getsentry/action-setup-cli for sentry-cli install#529
runningcode merged 2 commits into
masterfrom
semgrep-autofix/1785953500

Conversation

@semgrep-code-getsentry

@semgrep-code-getsentry semgrep-code-getsentry Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Replace insecure curl | bash installation of sentry-cli with getsentry/action-setup-cli.

Changes

  • Removed curl -sL https://sentry.io/get-cli/ | bash from the test workflow
  • Added getsentry/action-setup-cli@70d7e587b84c2e78cf4d37cd33d7b74fb3729c1b # v1

Why

Piping curl output directly into bash allows arbitrary code execution if the remote server is compromised or the URL is hijacked. action-setup-cli downloads the sentry-cli release asset for the runner's OS/arch and verifies its sha256 against the digest GitHub recorded for that asset via the Releases API, before adding it to PATH. It only uses gh (preinstalled and pre-authenticated on GitHub-hosted runners) — no curl.

Background

This PR was originally opened by Semgrep Autofix, which suggested a getsentry/action-setup-cli@v2 reference — a plausible-looking but nonexistent action and version. That action has since been built for real and published at v1; this PR now points at it.

Finding

Semgrep finding from rule yaml.github-actions.security.gha-curl-pipe-shell.gha-curl-pipe-shell.

Refs VULN-2324

semgrep-code-getsentry Bot and others added 2 commits August 5, 2026 18:11
…-cli install

Replace insecure `curl | bash` installation of sentry-cli with the official `getsentry/action-setup-cli` GitHub Action.

## Changes
- Removed `curl -sL https://sentry.io/get-cli/ | bash` from the test workflow
- Added `getsentry/action-setup-cli@v2` as a pinned GitHub Action step

## Why
Piping curl output directly into bash allows arbitrary code execution if the remote server is compromised or the URL is hijacked. Using the official GitHub Action avoids this risk by relying on GitHub's action distribution infrastructure and pinned versions.

## Semgrep Finding Details
A `run:` step pipes the output of `curl` or `wget` directly into a shell interpreter. This is the "curl | bash" install pattern — if the remote server is compromised or the URL is hijacked, an attacker can execute arbitrary code in your CI runner. Consider downloading the file first, verifying its checksum or signature, and then executing it.

alex.tarasov@sentry.io requested this Autofix PR for [this finding](https://semgrep.dev/orgs/sentry/findings/876396253) from the detection rule [yaml.github-actions.security.gha-curl-pipe-shell.gha-curl-pipe-shell](https://semgrep.dev/r/yaml.github-actions.security.gha-curl-pipe-shell.gha-curl-pipe-shell).
getsentry/action-setup-cli@v2 doesn't resolve to any existing tag —
this action was hallucinated by Semgrep Autofix and has since been
built and published for real, at v1. Reference it by pinned SHA
(with the tag as a comment, matching the other action references in
this file) instead of the nonexistent v2.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@linear-code

linear-code Bot commented Aug 5, 2026

Copy link
Copy Markdown

VULN-2324

@oioki
oioki marked this pull request as ready for review August 6, 2026 09:06
@runningcode
runningcode merged commit fbcd3e7 into master Aug 6, 2026
22 checks passed
@runningcode
runningcode deleted the semgrep-autofix/1785953500 branch August 6, 2026 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants