|
| 1 | +/** |
| 2 | + * @name Use of known vulnerable 3rd party action. |
| 3 | + * @description The workflow is using a known vulnerable 3rd party action. |
| 4 | + * @kind problem |
| 5 | + * @problem.severity error |
| 6 | + * @security-severity 7.5 |
| 7 | + * @precision high |
| 8 | + * @id actions/vulnerable-action |
| 9 | + * @tags actions |
| 10 | + * security |
| 11 | + * external/cwe/cwe-1395 |
| 12 | + */ |
| 13 | + |
| 14 | +import actions |
| 15 | + |
| 16 | +// gh api /repos/actions/download-artifact/tags --jq 'map({name: .name, sha: .commit.sha})' --paginate |
| 17 | +from UsesStep step |
| 18 | +where |
| 19 | + step.getCallee() = "actions/download-artifact" and |
| 20 | + ( |
| 21 | + step.getVersion() = |
| 22 | + [ |
| 23 | + "4.1.6", "4.1.5", "4.1.4", "4.1.3", "4.1.2", "4.1.1", "4.1.0", "4.0.0", "3.0.2", "3.0.1", |
| 24 | + "3.0.0", "3", "3-node20", "2.1.1", "2.1.0", "2.0.10", "2.0.9", "2.0.8", "2.0.7", "2.0.6", |
| 25 | + "2.0.5", "2.0.4", "2.0.3", "2.0.2", "2.0.1", "2.0", "2", "1.0.0", "1", "1.0.0", |
| 26 | + ] |
| 27 | + or |
| 28 | + step.getVersion() |
| 29 | + .matches([ |
| 30 | + "9c19ed7f", "8caf195a", "c850b930", "87c55149", "eaceaf80", "6b208ae0", "f44cd7b4", |
| 31 | + "7a1cd321", "9bc31d5c", "9782bd6a", "fb598a63", "9bc31d5c", "246d7188", "cbed621e", |
| 32 | + "f023be2c", "3be87be1", "158ca71f", "4a7a7112", "f144d3c3", "f8e41fbf", "c3f5d00c", |
| 33 | + "b3cedea9", "80d2d402", "381af06b", "1ac47ba4", "1de1dea8", "cbed621e", "18f0f591", |
| 34 | + "18f0f591", "18f0f591", |
| 35 | + ] + "%") |
| 36 | + ) |
| 37 | +select step, "The workflow is using a known vulnerable version ($@) of the $@ action.", step, |
| 38 | + step.getVersion(), step, step.getCallee() |
0 commit comments