Skip to content

Commit

Permalink
whitelist @actions/exec/lib/toolrunner
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Brignull committed Sep 1, 2020
1 parent 4c00c68 commit b4d142e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions queries/unguarded-action-lib.ql
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import javascript
* Although these libraries are designed for use on actions they
* have been deemed safe to use outside of actions as well.
*/
class SafeActionLibs extends string {
SafeActionLibs() {
this = "@actions/http-client" or
this = "@actions/exec"
}
bindingset[lib]
predicate isSafeActionLib(string lib) {
lib = "@actions/http-client" or
lib = "@actions/exec" or
lib.matches("@actions/exec/%")
}

/**
Expand All @@ -26,7 +26,7 @@ class SafeActionLibs extends string {
class ActionsLibImport extends ImportDeclaration {
ActionsLibImport() {
getImportedPath().getValue().matches("@actions/%") and
not getImportedPath().getValue() instanceof SafeActionLibs
not isSafeActionLib(getImportedPath().getValue())
}

string getName() {
Expand Down

0 comments on commit b4d142e

Please sign in to comment.