T08 · Insecure Dependencies
Warning
- Location
- README.md:226
- Finding
- Mutable Third-Party GitHub Action Receives an API Secret## Vulnerability Details **File Location**: `README.md`, lines 226–230 **Vulnerability Type**: Supply-chain risk from dependencies referenced by mutable tags **Risk Level**: Medium ### Vulnerable Code ```yaml - uses: actions/checkout@v3 - name: AI Code Review uses: clawhub/ai-code-reviewer@v1 with: api-key: ${{ secrets.OPENROUTER_API_KEY }} ``` ### Technical Analysis The documented GitHub Actions workflow references both `actions/checkout@v3` and `clawhub/ai-code-reviewer@v1` by mutable major-version tags rather than immutable, reviewed commit SHA values. The third-party `clawhub/ai-code-reviewer@v1` action is explicitly given the `OPENROUTER_API_KEY` secret. A mutable tag can be changed to identify different action code after the workflow has been reviewed. If the upstream repository, publisher account, release process, or tag is compromised, a subsequent workflow run could execute modified code with access to the supplied secret and the checked-out repository. This is a documented integration example rather than an active workflow in the audited package. Exploitation therefore requires a user to copy or otherwise deploy this example. ### Attack Path 1. A user adopts the workflow shown in `README.md`. 2. An attacker compromises the third-party action repository, publisher account, or mutable `v1` tag. 3. The attacker changes the tag to reference malicious action code. 4. GitHub Actions retrieves and executes that code during a later workflow run. 5. The malicious action reads the supplied `OPENROUTER_API_KEY`, repository files, and any other data available to the job. 6. The action exfiltrates the accessible data or abuses the API credential. ### Impact Assessment Successful exploitation could disclose the OpenRouter API key and source code available in the runner workspace. The stolen key could be used within its configured account limits, potentially causing unauthorized API usage and financial loss. The effective privileges are bounded by ...[truncated 299 chars]
- Remediation
- ## Remediation Suggestions - Pin every GitHub Action to a reviewed, immutable full commit SHA rather than a mutable version tag. - Verify the action publisher, repository ownership, source code, release provenance, and referenced commit before adoption. - Use automated dependency monitoring to identify security advisories and intentionally update pinned SHAs. - Configure explicit least-privilege workflow permissions, starting with: ```yaml permissions: contents: read ``` - Grant additional permissions only to the specific job or step that requires them. - Do not pass API keys to third-party actions unless strictly necessary. Prefer a reviewed local action or a narrowly scoped integration. - Scope, rotate, and monitor the OpenRouter credential. Apply spending limits and other provider-side restrictions where supported. - Avoid exposing secrets to workflows triggered from untrusted pull requests or attacker-controlled code. - Document the action's required permissions, secret access, trust assumptions, and verified immutable version.
