Actions: Fix Critical Artifact poisoning False Positive#19388
Actions: Fix Critical Artifact poisoning False Positive#19388Napalys merged 13 commits intogithub:mainfrom
Conversation
|
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 |
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>
Napalys
left a comment
There was a problem hiding this comment.
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.