Skip to content

Commit 4c6711d

Browse files
committed
JS: Clarify the difference between context and input sources
1 parent bdcda7f commit 4c6711d

File tree

1 file changed

+25
-6
lines changed

1 file changed

+25
-6
lines changed

javascript/ql/lib/semmle/javascript/frameworks/ActionsLib.qll

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,34 @@ private API::Node taintSource() {
3737
result = commitObj().getMember("message")
3838
or
3939
result = commitObj().getMember(["author", "committer"]).getMember(["name", "email"])
40-
or
41-
result =
42-
API::moduleImport("@actions/core").getMember(["getInput", "getMultilineInput"]).getReturn()
4340
}
4441

45-
private class GitHubActionsSource extends RemoteFlowSource {
46-
GitHubActionsSource() { this = taintSource().asSource() }
42+
/**
43+
* A source of taint originating from the context.
44+
*/
45+
private class GitHubActionsContextSource extends RemoteFlowSource {
46+
GitHubActionsContextSource() { this = taintSource().asSource() }
47+
48+
override string getSourceType() { result = "GitHub Actions context" }
49+
}
50+
51+
/**
52+
* A source of taint originating from user input.
53+
*
54+
* At the momemnt this is treated as a remote flow source, although it is not
55+
* always possible for an attacker to control this. In the future we might classify
56+
* this differently.
57+
*/
58+
private class GitHubActionsInputSource extends RemoteFlowSource {
59+
GitHubActionsInputSource() {
60+
this =
61+
API::moduleImport("@actions/core")
62+
.getMember(["getInput", "getMultilineInput"])
63+
.getReturn()
64+
.asSource()
65+
}
4766

48-
override string getSourceType() { result = "GitHub Actions input" }
67+
override string getSourceType() { result = "GitHub Actions user input" }
4968
}
5069

5170
private class ExecActionsCall extends SystemCommandExecution, DataFlow::CallNode {

0 commit comments

Comments
 (0)