Skip to content

Commit 569e80b

Browse files
author
Alvaro Muñoz
committed
Fix ImproperAccess query
1 parent 9411fac commit 569e80b

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

ql/src/Security/CWE-285/ImproperAccessControl.ql

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,14 @@ import codeql.actions.security.ControlChecks
1717
from LocalJob job, LabelCheck check, MutableRefCheckoutStep checkout, Event event
1818
where
1919
job.isPrivileged() and
20-
job.getATriggerEvent() = event and
21-
event.getName() = "pull_request_target" and
22-
event.getAnActivityType() = "synchronize" and
23-
check.dominates(checkout)
20+
job.getAStep() = checkout and
21+
check.dominates(checkout) and
22+
(
23+
job.getATriggerEvent() = event and
24+
event.getName() = "pull_request_target" and
25+
event.getAnActivityType() = "synchronize"
26+
or
27+
not exists(job.getATriggerEvent())
28+
)
2429
select checkout, "The checked-out code can be modified after the authorization check $@.", check,
2530
check.toString()
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
| .github/workflows/test1.yml:15:7:20:4 | Uses Step | The checked-out code can be changed after the authorization check o step $@. | .github/workflows/test1.yml:17:11:17:75 | contain ... test') | contain ... test') |
1+
| .github/workflows/test1.yml:15:7:20:4 | Uses Step | The checked-out code can be modified after the authorization check $@. | .github/workflows/test1.yml:17:11:17:75 | contain ... test') | contain ... test') |

0 commit comments

Comments
 (0)