Skip to content

chore: Pin release-please-action to full commit SHA#27

Draft
semgrep-code-launchdarkly[bot] wants to merge 1 commit intomainfrom
semgrep-autofix/1774017250
Draft

chore: Pin release-please-action to full commit SHA#27
semgrep-code-launchdarkly[bot] wants to merge 1 commit intomainfrom
semgrep-autofix/1774017250

Conversation

@semgrep-code-launchdarkly
Copy link
Copy Markdown

Pin the googleapis/release-please-action to a full commit SHA to mitigate supply chain attack risks.

Changes

  • Pin googleapis/release-please-action@v4 to commit SHA 7987652d64b54f048af0955c00c6c20444d67d5a
  • Add version comment (# v4) for maintainability

Why

Using a version tag like v4 means the workflow references a mutable pointer that could be changed by a bad actor who gains access to the action's repository. Pinning to the full 40-character commit SHA ensures the workflow uses an immutable reference, requiring an attacker to generate a SHA-1 collision to inject malicious code.

Semgrep Finding Details

An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an 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.

@pkaeding@launchdarkly.com requested Semgrep Assistant generate this pull request to fix a finding.


⚠️ Review carefully before merging. This PR was generated by AI and may cause breaking changes or introduce new vulnerabilities.

Pin the `googleapis/release-please-action` to a full commit SHA to mitigate supply chain attack risks.

## Changes
- Pin `googleapis/release-please-action@v4` to commit SHA `7987652d64b54f048af0955c00c6c20444d67d5a`
- Add version comment (`# v4`) for maintainability

## Why
Using a version tag like `v4` means the workflow references a mutable pointer that could be changed by a bad actor who gains access to the action's repository. Pinning to the full 40-character commit SHA ensures the workflow uses an immutable reference, requiring an attacker to generate a SHA-1 collision to inject malicious code.

## Semgrep Finding Details
An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an 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.

@pkaeding@launchdarkly.com requested Semgrep Assistant generate this pull request to fix [a finding](https://semgrep.dev/orgs/launchdarkly/findings/726547317).

steps:
- uses: googleapis/release-please-action@v4
- uses: googleapis/release-please-action@7987652d64b54f048af0955c00c6c20444d67d5a # v4
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this is the same issue as the other PR. Should be 16a9c90856f42705d54a6fda1823352bdc62cf38 for the latest v4.4 release.

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.

1 participant