Fix ImproperAccess query

This commit is contained in:
Alvaro Muñoz
2024-08-09 17:17:18 +02:00
parent 9411fac4d0
commit 569e80b678
2 changed files with 10 additions and 5 deletions

View File

@@ -17,9 +17,14 @@ import codeql.actions.security.ControlChecks
from LocalJob job, LabelCheck check, MutableRefCheckoutStep checkout, Event event
where
job.isPrivileged() and
job.getATriggerEvent() = event and
event.getName() = "pull_request_target" and
event.getAnActivityType() = "synchronize" and
check.dominates(checkout)
job.getAStep() = checkout and
check.dominates(checkout) and
(
job.getATriggerEvent() = event and
event.getName() = "pull_request_target" and
event.getAnActivityType() = "synchronize"
or
not exists(job.getATriggerEvent())
)
select checkout, "The checked-out code can be modified after the authorization check $@.", check,
check.toString()

View File

@@ -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') |
| .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') |