Skip to content

fix: replace default CodeQL Actions scanning with advanced setup to suppress false positives - #1405

Closed
ignaciolarranaga wants to merge 2 commits into
tetherto:mainfrom
ignaciolarranaga:fix/codeql-actions-advanced-setup
Closed

ignaciolarranaga wants to merge 2 commits into
tetherto:mainfrom
ignaciolarranaga:fix/codeql-actions-advanced-setup

Conversation

@ignaciolarranaga

Copy link
Copy Markdown

Summary

  • Adds a CodeQL configuration file (.github/codeql/codeql-config.yml) that excludes the actions/artifact-poisoning query, which produces false positives on workflow_dispatch workflows
  • Adds a CodeQL advanced setup workflow (.github/workflows/codeql-actions.yml) that scans only the actions language using the custom config

Why these alerts are false positives

The actions/artifact-poisoning/critical rule flags npm install, npm pack, and npm run commands in workflow_dispatch-triggered workflows. However, these are not exploitable because:

  1. workflow_dispatch requires write access — only trusted collaborators can trigger these workflows (unlike pull_request_target or issue_comment)
  2. Input validation is in place — the workflows validate that the package input matches ^@qvac/ before proceeding
  3. --ignore-scripts is used — npm install and npm pack commands use --ignore-scripts to prevent execution of lifecycle scripts
  4. No untrusted data flows into shell commands — the flagged steps use hardcoded matrix values, secrets, and workflow-level env vars

This matches the assessment applied when dismissing similar alerts in integration-test-qvac-lib-infer-nmtcpp.yml and integration-mobile-test-qvac-lib-infer-nmtcpp.yml.

Post-merge action required

After merging this PR, remove actions from the default CodeQL setup to avoid duplicate scanning:

Settings → Code security → Code scanning → CodeQL analysis → Default setup → Edit → uncheck "Actions" → Save

The other three languages (C/C++, JavaScript/TypeScript, Python) should remain on the default setup.

Test plan

  • Verify the CodeQL: GitHub Actions workflow runs successfully on this PR
  • After merge, verify no new artifact-poisoning alerts appear on subsequent scans
  • Remove actions from the default setup as described above

Made with Cursor

Switch the GitHub Actions language scanning from the default CodeQL
setup to an advanced setup with a custom config that excludes the
actions/artifact-poisoning query. These alerts are false positives
because the flagged workflows use workflow_dispatch (requires write
access), validate inputs, and use --ignore-scripts on npm commands.
@ignaciolarranaga
ignaciolarranaga marked this pull request as ready for review April 7, 2026 21:42
@ignaciolarranaga
ignaciolarranaga requested review from a team as code owners April 7, 2026 21:42

@0xM3R 0xM3R left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is not a good idea

Comment on lines +10 to +32
on:
push:
branches: [main]
paths:
- ".github/workflows/**"
- ".github/actions/**"
- ".github/codeql/**"
pull_request:
branches: [main]
paths:
- ".github/workflows/**"
- ".github/actions/**"
- ".github/codeql/**"
schedule:
- cron: "25 14 * * 1"

jobs:
analyze:
name: Analyze GitHub Actions
runs-on: ubuntu-latest
permissions:
security-events: write
contents: read

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is the broadest suppression: it completely removes the query from all scans. Any future workflow with a genuine vulnerability would go undetected. Although that's a false positive in this case, I'd prefer we tackle the alerts once detected with proper justification instead of discarding them altogether. https://docs.github.com/en/code-security/how-tos/manage-security-alerts/manage-code-scanning-alerts/resolving-code-scanning-alerts

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@ignaciolarranaga ignaciolarranaga closed this by deleting the head repository Apr 9, 2026
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.

2 participants