Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
uses: dtolnay/rust-toolchain@stable

- name: Cache cargo registry and build
uses: actions/cache@v4
uses: actions/cache@v5

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# Check the release.yaml workflow around lines 27 and 50
echo "=== release.yaml around line 27 ==="
sed -n '20,35p' .github/workflows/release.yaml

echo -e "\n=== release.yaml around line 50 ==="
sed -n '45,55p' .github/workflows/release.yaml

echo -e "\n=== testing.yaml around line 29 ==="
sed -n '20,35p' .github/workflows/testing.yaml

Repository: gmr/libpgfmt

Length of output: 1451


🏁 Script executed:

# Search for any SHA-pinned actions in workflow files
echo "=== Looking for any SHA-pinned actions in workflows ==="
rg 'uses:.*@[a-f0-9]{40}' .github/workflows/

# Also check if there are any policy documents or security guidelines
echo -e "\n=== Checking for policy or security docs ==="
fd -e md -e txt | xargs rg -l "pin\|action\|security" | head -20

# Count total unpinned actions in all workflows
echo -e "\n=== All unpinned action references in workflows ==="
rg 'uses:\s*\w+/[\w-]+@(?!master|main)' .github/workflows/

Repository: gmr/libpgfmt

Length of output: 486


🏁 Script executed:

# Find all action references more simply
echo "=== All 'uses:' lines in workflow files ==="
rg 'uses:' .github/workflows/ -A 0

# Check if there are YAML files with specific pattern
echo -e "\n=== Total count of unpinned actions ==="
rg 'uses: .*@(v[0-9]|[a-zA-Z])' .github/workflows/ | wc -l

Repository: gmr/libpgfmt

Length of output: 631


Pin all GitHub Actions to immutable commit SHAs to prevent supply chain attacks through retaggable action versions.

All action references in the workflow files currently use mutable version tags (@v5, @v1.0.4, @master, @stable) instead of pinning to specific commit SHAs. Replace with full commit SHAs:

  • .github/workflows/testing.yaml#L25: Replace actions/checkout@v5
  • .github/workflows/testing.yaml#L28: Replace dtolnay/rust-toolchain@master (currently uses branch ref—most critical)
  • .github/workflows/testing.yaml#L29: Replace actions/cache@v5
  • .github/workflows/release.yaml#L25: Replace actions/checkout@v5
  • .github/workflows/release.yaml#L28: Replace dtolnay/rust-toolchain@stable
  • .github/workflows/release.yaml#L27: Replace actions/cache@v5
  • .github/workflows/release.yaml#L50: Replace rust-lang/crates-io-auth-action@v1.0.4
🧰 Tools
🪛 zizmor (1.25.2)

[error] 27-27: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)


[error] 27-27: runtime artifacts potentially vulnerable to a cache poisoning attack (cache-poisoning): enables caching by default

(cache-poisoning)

📍 Affects 2 files
  • .github/workflows/release.yaml#L27-L27 (this comment)
  • .github/workflows/release.yaml#L50-L50
  • .github/workflows/testing.yaml#L29-L29
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/release.yaml at line 27, GitHub Actions across your
workflows are using mutable version tags which pose security risks. Replace all
mutable action references with specific commit SHAs: At
`.github/workflows/release.yaml` lines 27 and 50, replace `actions/cache@v5` and
`rust-lang/crates-io-auth-action@v1.0.4` respectively with their full commit
SHAs. At `.github/workflows/testing.yaml` line 29, replace `actions/cache@v5`
with its commit SHA. Additionally, address the other mutable references
mentioned in the content: in `.github/workflows/testing.yaml` at lines 25 and 29
replace `actions/checkout@v5` and `actions/cache@v5` with commit SHAs, at line
28 replace `dtolnay/rust-toolchain@master` with a specific commit SHA (this is
critical since it uses a branch ref), and in `.github/workflows/release.yaml` at
lines 25 and 28 replace `actions/checkout@v5` and
`dtolnay/rust-toolchain@stable` with commit SHAs. Look up the latest commit SHA
for each action version and pin each action to its corresponding immutable
commit hash to prevent supply chain attacks.

Source: Linters/SAST tools

with:
path: |
~/.cargo/registry
Expand All @@ -47,7 +47,7 @@ jobs:
fi

- name: Get crates.io token via trusted publishing
uses: rust-lang/crates-io-auth-action@v1
uses: rust-lang/crates-io-auth-action@v1.0.4
id: auth

- name: Publish to crates.io
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
components: clippy, rustfmt

- name: Cache cargo registry and build
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: |
~/.cargo/registry
Expand Down