Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
category: minorAnalysis
---
* The `job.workflow_ref`, `job.workflow_sha`, `job.workflow_repository` and `job.workflow_file_path` context properties are no longer treated as untrusted input in a reusable workflow with no known caller, which removes `actions/untrusted-checkout/medium` false positives on a reusable workflow that checks out its own source.
4 changes: 3 additions & 1 deletion actions/ql/lib/codeql/actions/dataflow/FlowSources.qll
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,9 @@ class GitHubEventJsonSource extends RemoteFlowSource {
or
not exists(e.getATriggerEvent()) and
event = "unknown" and
untrustedEventPropertiesDataModel(_, _)
untrustedEventPropertiesDataModel(_, _) and
not normalizeExpr(e.getExpression())
.regexpMatch("(?i)job\\.workflow_(ref|sha|repository|file_path)")
) and
flag = "json"
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
on:
workflow_call:

jobs:
checkout:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: ${{ job.workflow_repository }}
ref: ${{ job.workflow_sha }}