Conversation
Replaces mutable tag/branch references with immutable SHA hashes to prevent supply chain attacks (ref: TeamPCP/Trivy March 2026). Actions left as tags: 0
Up to standards ✅🟢 Issues
|
There was a problem hiding this comment.
Pull Request Overview
While this PR correctly implements SHA pinning for GitHub Actions, it introduces or maintains high-severity security and logic flaws that must be addressed. Specifically, the .github/workflows/comment_issue.yml file contains a script injection vulnerability due to direct context interpolation and a workflow logic error where step-level environment variables are used in 'if' conditions before they are initialized, which will result in skipped steps. Additionally, the use of deprecated runtimes and lack of error handling in regex matching should be corrected. These security and functional issues should prevent merging in their current state.
About this PR
- The hardening effort is undermined by script injection risks and invalid workflow logic. Ensure that all context data passed to scripts is handled via environment variables rather than direct string interpolation, and that step conditions rely on previous step outputs instead of local environment variables which are not yet available at evaluation time.
Test suggestions
- Verify all instances of 'actions/github-script' are updated to use the SHA hash 6e5ee1dc1cb3740e5e5e76ad668e3f526edbfe45.
- Verify all instances of 'atlassian/gajira-login' are updated to use the SHA hash 90a599561baaf8c05b080645ed73db7391c246ed.
- Verify 'atlassian/gajira-create' is updated to use the SHA hash c0a9c69ac9d6aa063fed57201e55336ada860183.
- Verify 'atlassian/gajira-comment' is updated to use the SHA hash 8ec356b5df49f1325653db7ee2da2b59a1d78203.
🗒️ Improve review quality by adding custom instructions
| if: env.JIRA_CREATE_COMMENT_AUTO == 'true' && env.GITHUB_ISSUE_TYPE == 'issue' && env.GITHUB_ISSUE_HAS_JIRA_ISSUE_LABEL == 'true' | ||
| id: login | ||
| uses: atlassian/gajira-login@v2.0.0 | ||
| uses: atlassian/gajira-login@90a599561baaf8c05b080645ed73db7391c246ed # v2.0.0 |
There was a problem hiding this comment.
🔴 HIGH RISK
The 'if' condition for this step relies on environment variables defined at the step level (e.g., env.GITHUB_ISSUE_TYPE). In GitHub Actions, 'if' conditionals are evaluated before the step-level environment is set up, meaning these variables will be undefined and the step will be skipped. Access the previous steps' outputs directly using the 'steps' context instead (e.g., 'steps.github_issue_type.outputs.result').
| if: env.JIRA_CREATE_COMMENT_AUTO == 'true' | ||
| id: github_issue_type | ||
| uses: actions/github-script@v2.0.0 | ||
| uses: actions/github-script@6e5ee1dc1cb3740e5e5e76ad668e3f526edbfe45 # v2.0.0 |
There was a problem hiding this comment.
🔴 HIGH RISK
This script block contains a high-risk code injection vulnerability by directly interpolating GitHub context values using ${{ }}. Pass context data (like labels or titles) through the 'env' block and access them via 'process.env' instead. Additionally, 'actions/github-script@v2' is deprecated as it relies on the end-of-life Node 12 runtime; consider upgrading to v7 (SHA 60a0d83039c74a4aee543508d2ff4a7df0bd5ad0) to ensure compatibility with modern runners.
| if: env.JIRA_CREATE_COMMENT_AUTO == 'true' && env.GITHUB_ISSUE_TYPE == 'issue' && env.GITHUB_ISSUE_HAS_JIRA_ISSUE_LABEL == 'true' | ||
| id: extract_jira_number | ||
| uses: actions/github-script@v2.0.0 | ||
| uses: actions/github-script@6e5ee1dc1cb3740e5e5e76ad668e3f526edbfe45 # v2.0.0 |
There was a problem hiding this comment.
🟡 MEDIUM RISK
Suggestion: Add a check to ensure the regex match is successful before accessing the capture group. Currently, if the issue title does not match the expected pattern, 'match()' will return null and the workflow will fail with a TypeError when accessing index [1].
Pins all GitHub Actions from mutable tags/branches to immutable SHA hashes.
This prevents supply chain attacks like the TeamPCP/Trivy incident (March 2026), where attackers force-pushed tags to point at malicious commits.
Auto-generated by the Codacy security audit script.