-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Actions: Fix Critical Artifact poisoning False Positive #19388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot wasn't able to review any files in this pull request.
Files not reviewed (1)
- actions/ql/lib/codeql/actions/security/ArtifactPoisoningQuery.qll: Language not supported
Hi, I was pinged about it by Simon. @AdnaneKhan you need to add a change note, see https://github.com/github/codeql/pull/19085/files#diff-a654ec6cec8af7e22ef1dc59ec11f5095d05128d97d67cdb2cbfe98e0fec6210 for an example. @tausbn @asgerf, can we have a review to have tests run? I wonder if it breaks anything. It looks fishy to me that the original |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments above.
actions/ql/lib/codeql/actions/security/ArtifactPoisoningQuery.qll
Outdated
Show resolved
Hide resolved
Co-authored-by: Jaroslav Lobačevski <jarlob@github.com>
Thanks - I added a change note and a test workflow file but I'm not sure how to specify the test - is the ArtifactPoisoningCritical.expected file an assertion on the state of the codeql graph? |
The file is automatically generated by codeql test command. Usually I just right click on the test folder, run test, see if the changes make sense and then accept them. The fix was a little more involving, I have created the tests, but cannot push to your branch. Do you have the check allow collaboration? Or maybe it is because I not CodeQL maintainer?.. |
Alternatively you may pull from https://github.com/JarLob/codeql/tree/pr/AdnaneKhan/19388-1 |
Merged your changes in! |
actions/ql/test/query-tests/Security/CWE-829/.github/workflows/artifactpoison93.yml
Outdated
Show resolved
Hide resolved
actions/ql/lib/codeql/actions/security/ArtifactPoisoningQuery.qll
Outdated
Show resolved
Hide resolved
The CI check doesn't like the change-note filename. Which is odd, because it seems to match one of the options that it gives. Anyway, try changing it to |
I've made https://github.com/github/semmle-code/pull/53513 to fix the change note file name CI check acting differently than it says it does. |
Co-authored-by: Napalys Klicius <napalys@github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, that looks good to me.
Could you please change the change note filename to something like 2025-07-08-artifact-poisoning.md
so it would pass the current CI? Otherwise, we'll need to wait for the @owen-mc's fix to be merged.
Updated! |
The artifact poisoning CodeQL query creates a Critical false-positive under the following scenario:
${{ runner.temp }}
I believe this PR will fix it because it unless the path extraction functionality in CodeQL resolves/sanitizes the context values in some way.
Below is an example that reproduces the false positive:
This is particularly a problem because the examples for a secure workflow specifically calls out this fix.