Skip to content

bug: Unpinned tag for a non-immutable Action in workflow #156

Description

@fantonangeli

Describe the Bug

Note: I have this security alert on my fork but I cannot see it in this fork, probably due to a lack of permissions

Unpinned tag for a non-immutable Action in workflow

Severity: warning
State: fixed
Tool: CodeQL

Description

Overview

Using a tag for a 3rd party Action that is not pinned to a commit can lead to executing an untrusted Action through a supply chain attack.

Recommendation

Pinning an action to a full length commit SHA is currently the only way to use a non-immutable action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a
backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload. When selecting a SHA, you should verify it is from the action's repository and not a
repository fork.

Example

Incorrect Usage

- uses: tj-actions/changed-files@v44

Correct Usage

- uses: tj-actions/changed-files@c65cd883420fd2eb864698a825fc4162dd94482c # v44

References

- GitHub Docs: Using third-party actions.

Instance

File: .github/workflows/ci_build.yaml
Lines: 54-54
Message: Unpinned 3rd party Action 'CI :: Build' step Uses Step uses 'pnpm/action-setup' with ref 'v6', not a pinned commit hash

Code

# Line 54
# Unpinned 3rd party Action 'CI :: Build' step Uses Step uses 'pnpm/action-setup' with ref 'v6', not a pinned commit hash

### Steps to reproduce

NA

### Expected Behavior

NA

### Editor Version

_No response_

### Platform

Other

### Additional Context

_No response_

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No fields configured for Bug.

Projects

Status
Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions