mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
Improve Artifact Poisoning query
This commit is contained in:
@@ -14,13 +14,10 @@
|
||||
import actions
|
||||
import codeql.actions.security.ArtifactPoisoningQuery
|
||||
|
||||
from LocalJob job, ArtifactDownloadStep download, Step run
|
||||
from LocalJob job, ArtifactDownloadStep downloadStep, PoisonableStep step
|
||||
where
|
||||
// Workflow is privileged
|
||||
job.getWorkflow().isPrivileged() and
|
||||
(run instanceof Run or run instanceof UsesStep) and
|
||||
exists(int i, int j |
|
||||
job.getStep(i) = download and
|
||||
job.getStep(j) = run and
|
||||
i < j
|
||||
)
|
||||
select download, "Potential artifact poisoning."
|
||||
// Download step is followed by a step that may be poisoned by the download
|
||||
downloadStep.getAFollowingStep() = step
|
||||
select downloadStep, "Potential artifact poisoning."
|
||||
|
||||
Reference in New Issue
Block a user