-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sequester issue_comment triggered untrusted checkout from other triggers #18838
base: main
Are you sure you want to change the base?
Conversation
* issue_comment triggered untrusted checkouts present a security risk but mitigating the risk cannot be done wholly in the workflow relying on the event and those mitigations cannot be detected by CodeQL so these triggers should be moved to separate alerts with level warning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
} | ||
|
||
string issueCommentTriggers() { | ||
result = ["issue_comment"] |
Check warning
Code scanning / CodeQL
Singleton set literal Warning
not exists(ControlCheck check | check.protects(checkout, event, "untrusted-checkout")) and | ||
not exists(ControlCheck check | check.protects(poisonable, event, "untrusted-checkout")) | ||
select poisonable, checkout, poisonable, | ||
"Potential execution of untrusted code on a privileged workflow ($@)", event, event.getName() |
Check warning
Code scanning / CodeQL
Alert message style violation Warning
inPrivilegedContext(checkout, event) and | ||
event.getName() = issueCommentTriggers() and | ||
not exists(ControlCheck check | check.protects(checkout, event, "untrusted-checkout")) | ||
select checkout, "Potential execution of untrusted code on a privileged workflow ($@)", event, |
Check warning
Code scanning / CodeQL
Alert message style violation Warning
@@ -0,0 +1 @@ | |||
Security/CWE-829/UntrustedCheckoutIssueCommentCritical.ql |
Check warning
Code scanning / CodeQL
Query test without inline test expectations Warning test
@@ -0,0 +1 @@ | |||
Security/CWE-829/UntrustedCheckoutIssueCommentHigh.ql |
Check warning
Code scanning / CodeQL
Query test without inline test expectations Warning test
issue_comment
triggered untrusted checkouts present a security risk but mitigating the risk cannot be done wholly in the workflow relying on the event and those mitigations cannot be detected by CodeQL so these triggers should be moved to separate alerts with levelwarning
. See https://github.blog/security/application-security/how-to-secure-your-github-actions-workflows-with-codeql/#issueoops-security-pitfalls-with-issue_comment-trigger for more details.I removed the
issue_comment
trigger from the untrusted checkout high and critical and created new alerts with mitigation advice more suited towardsissue_comment
. I think it's important to warn developers about the risks of this workflow trigger, but understand it may not be possible for projects that rely heavily on IssueOps