Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/opencode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
persist-credentials: false

- name: Run opencode
uses: anomalyco/opencode/github@cd9a14a6b688d4021bee381dfd39d2cef9c0f862 # v2.0.18
uses: anomalyco/opencode/github@a6b15d33daf6ab7d35569f6d711fdb630b9f04e7 # v2.3.0

Check failure on line 32 in .github/workflows/opencode.yml

View check run for this annotation

Secuarden AI / secuarden/scan

Unpinned/Unverified Third-Party GitHub Action by Mutable Tag [high]

The workflow pins the action `anomalyco/opencode/github` to a full-length SHA commit (`a6b15d33daf6ab7d35569f6d711fdb630b9f04e7`), which is better than a mutable tag alone. However, the comment `# v2.3.0` is an unverified annotation — there is no cryptographic guarantee that this SHA actually corresponds to the official v2.3.0 release. More critically, the action runs with access to `secrets.OPENCODE_API_KEY` and executes in a privileged CI context. If the SHA was obtained from a compromised registry, a typosquatted namespace (`anomalyco` vs. the legitimate vendor), or an attacker-controlled fork, the action could exfiltrate secrets or tamper with the build pipeline. The previous pin (`cd9a14a6b688d4021bee381dfd39d2cef9c0f862`) was replaced without evidence of independent verification (e.g., SLSA provenance, sigstore/cosign signature). The repository context flags this workflow path (`infra/ci/.github/workflows/`) as high-risk (score 74) for secrets/pipeline exposure. Remediation: 1. Independently verify that `a6b15d33daf6ab7d35569f6d711fdb630b9f04e7` matches the official release tag `v2.3.0` on the canonical `anomalyco/opencode` repository (check the upstream tag annotation, not just the comment). 2. If the action publisher provides SLSA provenance or sigstore attestations, validate them in CI. 3. Confirm `anomalyco` is the legitimate, expected publisher and not a typosquat or fork. 4. Restrict the permissions of the workflow job to the minimum required (e.g., `permissions: contents: read`) to limit blast radius if the action is malicious. 5. Consider mirroring the action into an internal/trusted namespace under your organization's control.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ High: Unpinned/Unverified Third-Party GitHub Action by Mutable Tag

🎟️ Issue Explanation

The workflow pins the action anomalyco/opencode/github to a full-length SHA commit (a6b15d33daf6ab7d35569f6d711fdb630b9f04e7), which is better than a mutable tag alone. However, the comment # v2.3.0 is an unverified annotation — there is no cryptographic guarantee that this SHA actually corresponds to the official v2.3.0 release. More critically, the action runs with access to secrets.OPENCODE_API_KEY and executes in a privileged CI context. If the SHA was obtained from a compromised registry, a typosquatted namespace (anomalyco vs. the legitimate vendor), or an attacker-controlled fork, the action could exfiltrate secrets or tamper with the build pipeline. The previous pin (cd9a14a6b688d4021bee381dfd39d2cef9c0f862) was replaced without evidence of independent verification (e.g., SLSA provenance, sigstore/cosign signature). The repository context flags this workflow path (infra/ci/.github/workflows/) as high-risk (score 74) for secrets/pipeline exposure.

🛠️ Actions

  • @secuarden-ai /fix - Generate remediation code for this issue
  • @secuarden-ai /explain - Learn why this matters and potential impact
  • @secuarden-ai /ignore [reason] - Dismiss this finding
  • @secuarden-ai /review - Submit a reasoned assessment and request a rescan

🔐 Secuarden Security Review • Finding: SEC_ce8382e712df

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 This pin is broken: upstream deleted github/action.yml in v2.2.0 (PR #59032), and the tagged a6b15d33 commit has no github/ directory at all, so GitHub Actions will fail to resolve the action and this workflow will stop responding to /oc / /opencode comments. Dependabot followed the repo-wide v* tags; this action is published under dedicated github-v1.x.y tags. I'd close this PR rather than merge it.

Technical details
# Bump targets a tag with no action definition

## Affected sites
- `.github/workflows/opencode.yml:32` — `uses: anomalyco/opencode/github@a6b15d33daf6ab7d35569f6d711fdb630b9f04e7 # v2.3.0`

## Required outcome
- Do not merge: the pinned ref has no runnable action, so the step fails at resolution before `OPENCODE_API_KEY` is used.
- Retire/replace the workflow per upstream guidance, or repin to the last published action tag if maintainers accept depending on a removed action.

## Evidence
- `v2.3.0` resolves to `a6b15d33daf6ab7d35569f6d711fdb630b9f04e7`; `github/action.yml` returns 404 at that ref via the contents API, git tree API (12,511 entries, not truncated), and raw.githubusercontent.com.
- Commit `1743d1a24e23` "Remove the OpenCode GitHub Action (#59032)" (2026-10-25) deleted `github/` and both publish/release workflows. The v2.3.0 changelog records it under `v2.2.0 — 2026-10-27`: "The OpenCode GitHub Action is no longer published. Remove it from your workflows."
- The action's real tags are `github-v1.0.0` … `github-v1.2.28`; the last (`17b79f4e0c`, 2026-10-24) still contains `github/action.yml`. The current `v2.0.18` pin also still contains it, which is why the workflow works today.
- This workflow triggers only on `issue_comment` / `pull_request_review_comment`, so no PR check exercises it and CI will not catch the break.

env:
OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }}
with:
Expand Down
Loading