mirror of
https://github.com/actions/checkout.git
synced 2026-06-16 17:27:14 +00:00
Compare commits
5 Commits
c12eb249cb
...
921dc8dd24
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
921dc8dd24 | ||
|
|
baaeba4a5e | ||
|
|
cb140b4908 | ||
|
|
678aa28ba1 | ||
|
|
c2edb9a740 |
@@ -162,8 +162,11 @@ Please refer to the [release page](https://github.com/actions/checkout/releases/
|
||||
github-server-url: ''
|
||||
|
||||
# Required to check out fork pull request code from a workflow triggered by
|
||||
# `pull_request_target` or `workflow_run`. See [Pwn Requests](todo:need-link) for
|
||||
# the risks. Set to `true` only after reviewing the risks.
|
||||
# `pull_request_target` or `workflow_run`. These workflows run with the base
|
||||
# repository's GITHUB_TOKEN, secrets, default-branch cache scope, and runner
|
||||
# access; fetching and executing a fork's code in that trusted context commonly
|
||||
# leads to "pwn request" vulnerabilities. Set to `true` only after reviewing the
|
||||
# risks at https://gh.io/securely-using-pull_request_target.
|
||||
# Default: false
|
||||
allow-unsafe-pr-checkout: ''
|
||||
```
|
||||
|
||||
@@ -101,8 +101,11 @@ inputs:
|
||||
allow-unsafe-pr-checkout:
|
||||
description: >
|
||||
Required to check out fork pull request code from a workflow triggered by
|
||||
`pull_request_target` or `workflow_run`. See [Pwn Requests](todo:need-link)
|
||||
for the risks. Set to `true` only after reviewing the risks.
|
||||
`pull_request_target` or `workflow_run`. These workflows run with the
|
||||
base repository's GITHUB_TOKEN, secrets, default-branch cache scope, and
|
||||
runner access; fetching and executing a fork's code in that trusted
|
||||
context commonly leads to "pwn request" vulnerabilities. Set to `true`
|
||||
only after reviewing the risks at https://gh.io/securely-using-pull_request_target.
|
||||
default: false
|
||||
outputs:
|
||||
ref:
|
||||
|
||||
8
dist/index.js
vendored
8
dist/index.js
vendored
@@ -2822,8 +2822,7 @@ function assertSafePrCheckout(input) {
|
||||
// (B) We cannot check for all fork PR refs so check to see
|
||||
// if the resolved input points to the fork PR sha we have in the payload
|
||||
const repositoryMatchesPrHead = typeof prHeadRepoFullName === 'string' &&
|
||||
input.qualifiedRepository.toLowerCase() ===
|
||||
prHeadRepoFullName.toLowerCase();
|
||||
input.qualifiedRepository.toLowerCase() === prHeadRepoFullName.toLowerCase();
|
||||
const refMatchesPullPattern = PR_REF_PATTERN.test(input.ref);
|
||||
const commitMatchesPrHeadSha = !!input.commit && prShas.includes(input.commit.toLowerCase());
|
||||
if (!repositoryMatchesPrHead &&
|
||||
@@ -2833,8 +2832,9 @@ function assertSafePrCheckout(input) {
|
||||
}
|
||||
throw new Error(`Refusing to check out fork pull request code from a '${eventName}' workflow. ` +
|
||||
`This workflow runs with the base repository's GITHUB_TOKEN, secrets, default-branch ` +
|
||||
`cache scope, and runner access. Fetching fork's code in that trusted context is a ` +
|
||||
`"pwn request" supply-chain attack pattern. To opt in after reviewing the risk, set ` +
|
||||
`cache scope, and runner access. Fetching and executing a fork's code in that trusted ` +
|
||||
`context commonly leads to "pwn request" vulnerabilities. To opt in after reviewing ` +
|
||||
`the risks at https://gh.io/securely-using-pull_request_target, set ` +
|
||||
`'allow-unsafe-pr-checkout: true' on the actions/checkout step.`);
|
||||
}
|
||||
function pushIfSha(target, value) {
|
||||
|
||||
@@ -74,8 +74,9 @@ export function assertSafePrCheckout(input: IUnsafePrCheckoutInput): void {
|
||||
throw new Error(
|
||||
`Refusing to check out fork pull request code from a '${eventName}' workflow. ` +
|
||||
`This workflow runs with the base repository's GITHUB_TOKEN, secrets, default-branch ` +
|
||||
`cache scope, and runner access. Fetching fork's code in that trusted context is a ` +
|
||||
`"pwn request" supply-chain attack pattern. To opt in after reviewing the risk, set ` +
|
||||
`cache scope, and runner access. Fetching and executing a fork's code in that trusted ` +
|
||||
`context commonly leads to "pwn request" vulnerabilities. To opt in after reviewing ` +
|
||||
`the risks at https://gh.io/securely-using-pull_request_target, set ` +
|
||||
`'allow-unsafe-pr-checkout: true' on the actions/checkout step.`
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user