Skip to content

Commit 1676f45

Browse files
committed
Rename StepsExpression to StepOutputExpression
1 parent 795bfdf commit 1676f45

File tree

4 files changed

+19
-14
lines changed

4 files changed

+19
-14
lines changed

actions/ql/lib/codeql/actions/Ast.qll

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,12 @@ class GitHubExpression extends SimpleReferenceExpression instanceof GitHubExpres
383383

384384
class SecretsExpression extends SimpleReferenceExpression instanceof SecretsExpressionImpl { }
385385

386-
class StepsExpression extends SimpleReferenceExpression instanceof StepsExpressionImpl {
386+
/**
387+
* DEPRECATED: Use `StepOutputExpression` instead.
388+
*/
389+
deprecated class StepsExpression = StepOutputExpression;
390+
391+
class StepOutputExpression extends SimpleReferenceExpression instanceof StepsExpressionImpl {
387392
string getStepId() { result = super.getStepId() }
388393
}
389394

actions/ql/lib/codeql/actions/dataflow/TaintSteps.qll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ predicate fileDownloadToRunStep(DataFlow::Node pred, DataFlow::Node succ) {
3737
* A read of the _files field of the dorny/paths-filter action.
3838
*/
3939
predicate dornyPathsFilterTaintStep(DataFlow::Node pred, DataFlow::Node succ) {
40-
exists(StepsExpression o |
40+
exists(StepOutputExpression o |
4141
pred instanceof DornyPathsFilterSource and
4242
o.getStepId() = pred.asExpr().(UsesStep).getId() and
4343
o.getFieldName().matches("%_files") and
@@ -49,7 +49,7 @@ predicate dornyPathsFilterTaintStep(DataFlow::Node pred, DataFlow::Node succ) {
4949
* A read of user-controlled field of the tj-actions/changed-files action.
5050
*/
5151
predicate tjActionsChangedFilesTaintStep(DataFlow::Node pred, DataFlow::Node succ) {
52-
exists(StepsExpression o |
52+
exists(StepOutputExpression o |
5353
pred instanceof TJActionsChangedFilesSource and
5454
o.getTarget() = pred.asExpr() and
5555
o.getStepId() = pred.asExpr().(UsesStep).getId() and
@@ -69,7 +69,7 @@ predicate tjActionsChangedFilesTaintStep(DataFlow::Node pred, DataFlow::Node suc
6969
* A read of user-controlled field of the tj-actions/verify-changed-files action.
7070
*/
7171
predicate tjActionsVerifyChangedFilesTaintStep(DataFlow::Node pred, DataFlow::Node succ) {
72-
exists(StepsExpression o |
72+
exists(StepOutputExpression o |
7373
pred instanceof TJActionsVerifyChangedFilesSource and
7474
o.getTarget() = pred.asExpr() and
7575
o.getStepId() = pred.asExpr().(UsesStep).getId() and
@@ -82,7 +82,7 @@ predicate tjActionsVerifyChangedFilesTaintStep(DataFlow::Node pred, DataFlow::No
8282
* A read of user-controlled field of the xt0rted/slash-command-action action.
8383
*/
8484
predicate xt0rtedSlashCommandActionTaintStep(DataFlow::Node pred, DataFlow::Node succ) {
85-
exists(StepsExpression o |
85+
exists(StepOutputExpression o |
8686
pred instanceof Xt0rtedSlashCommandSource and
8787
o.getTarget() = pred.asExpr() and
8888
o.getStepId() = pred.asExpr().(UsesStep).getId() and
@@ -95,7 +95,7 @@ predicate xt0rtedSlashCommandActionTaintStep(DataFlow::Node pred, DataFlow::Node
9595
* A read of user-controlled field of the zentered/issue-forms-body-parser action.
9696
*/
9797
predicate zenteredIssueFormBodyParserSource(DataFlow::Node pred, DataFlow::Node succ) {
98-
exists(StepsExpression o |
98+
exists(StepOutputExpression o |
9999
pred instanceof ZenteredIssueFormBodyParserSource and
100100
o.getTarget() = pred.asExpr() and
101101
o.getStepId() = pred.asExpr().(UsesStep).getId() and
@@ -114,7 +114,7 @@ predicate zenteredIssueFormBodyParserSource(DataFlow::Node pred, DataFlow::Node
114114
* A read of user-controlled field of the octokit/request-action action.
115115
*/
116116
predicate octokitRequestActionTaintStep(DataFlow::Node pred, DataFlow::Node succ) {
117-
exists(StepsExpression o |
117+
exists(StepOutputExpression o |
118118
pred instanceof OctokitRequestActionSource and
119119
o.getTarget() = pred.asExpr() and
120120
o.getStepId() = pred.asExpr().(UsesStep).getId() and

actions/ql/lib/codeql/actions/dataflow/internal/DataFlowPrivate.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ newtype TContent =
150150
TFieldContent(string name) {
151151
// We only use field flow for env, steps and jobs outputs
152152
// not for accessing other context fields such as matrix or inputs
153-
name = any(StepsExpression a).getFieldName() or
153+
name = any(StepOutputExpression a).getFieldName() or
154154
name = any(NeedsExpression a).getFieldName() or
155155
name = any(JobsExpression a).getFieldName() or
156156
name = any(EnvExpression a).getFieldName()
@@ -205,7 +205,7 @@ predicate parameterMatch(ParameterPosition ppos, ArgumentPosition apos) { ppos =
205205
* field name.
206206
*/
207207
predicate stepsCtxLocalStep(Node nodeFrom, Node nodeTo) {
208-
exists(Uses astFrom, StepsExpression astTo |
208+
exists(Uses astFrom, StepOutputExpression astTo |
209209
madSource(nodeFrom, _, "output." + ["*", astTo.getFieldName()]) and
210210
astFrom = nodeFrom.asExpr() and
211211
astTo = nodeTo.asExpr() and
@@ -310,7 +310,7 @@ predicate ctxFieldReadStep(Node node1, Node node2, ContentSet c) {
310310
exists(SimpleReferenceExpression access |
311311
(
312312
access instanceof NeedsExpression or
313-
access instanceof StepsExpression or
313+
access instanceof StepOutputExpression or
314314
access instanceof JobsExpression or
315315
access instanceof EnvExpression
316316
) and

actions/ql/lib/codeql/actions/security/UntrustedCheckoutQuery.qll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ private module ActionsMutableRefCheckoutConfig implements DataFlow::ConfigSig {
3333
)
3434
or
3535
// 3rd party actions returning the PR head ref
36-
exists(StepsExpression e, UsesStep step |
36+
exists(StepOutputExpression e, UsesStep step |
3737
source.asExpr() = e and
3838
e.getStepId() = step.getId() and
3939
(
@@ -86,7 +86,7 @@ private module ActionsSHACheckoutConfig implements DataFlow::ConfigSig {
8686
)
8787
or
8888
// 3rd party actions returning the PR head sha
89-
exists(StepsExpression e, UsesStep step |
89+
exists(StepOutputExpression e, UsesStep step |
9090
source.asExpr() = e and
9191
e.getStepId() = step.getId() and
9292
(
@@ -243,7 +243,7 @@ class ActionsMutableRefCheckout extends MutableRefCheckoutStep instanceof UsesSt
243243
exists(string value, Expression expr |
244244
value.regexpMatch(".*(head|branch|ref).*") and expr = this.getArgumentExpr("ref")
245245
|
246-
expr.(StepsExpression).getStepId() = value
246+
expr.(StepOutputExpression).getStepId() = value
247247
or
248248
expr.(SimpleReferenceExpression).getFieldName() = value and
249249
not expr instanceof GitHubExpression
@@ -278,7 +278,7 @@ class ActionsSHACheckout extends SHACheckoutStep instanceof UsesStep {
278278
exists(string value, Expression expr |
279279
value.regexpMatch(".*(head|sha|commit).*") and expr = this.getArgumentExpr("ref")
280280
|
281-
expr.(StepsExpression).getStepId() = value
281+
expr.(StepOutputExpression).getStepId() = value
282282
or
283283
expr.(SimpleReferenceExpression).getFieldName() = value and
284284
not expr instanceof GitHubExpression

0 commit comments

Comments
 (0)