Skip to content

Commit 7991a7e

Browse files
committed
update URL to the security guide in error messages
1 parent e223d7d commit 7991a7e

10 files changed

+18
-18
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ test.yaml:10:28: label "linux-latest" is unknown. available labels are "windows-
6464
|
6565
10 | os: [macos-latest, linux-latest]
6666
| ^~~~~~~~~~~~~
67-
test.yaml:13:41: "github.event.head_commit.message" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions for more details [expression]
67+
test.yaml:13:41: "github.event.head_commit.message" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions for more details [expression]
6868
|
6969
13 | - run: echo "Checking commit '${{ github.event.head_commit.message }}'"
7070
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

ast.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ func (e *WorkflowCallEvent) EventName() string {
328328
}
329329

330330
// PermissionScope is struct for respective permission scope like "issues", "checks", ...
331-
// https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token
331+
// https://docs.github.com/en/actions/security-for-github-actions/security-guides/automatic-token-authentication#permissions-for-the-github_token
332332
type PermissionScope struct {
333333
// Name is name of the scope.
334334
Name *String

docs/checks.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1064,15 +1064,15 @@ jobs:
10641064
Output:
10651065
10661066
```
1067-
test.yaml:10:24: "github.event.pull_request.title" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions for more details [expression]
1067+
test.yaml:10:24: "github.event.pull_request.title" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions for more details [expression]
10681068
|
10691069
10 | run: echo '${{ github.event.pull_request.title }}'
10701070
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1071-
test.yaml:19:36: "github.event.head_commit.author.name" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions for more details [expression]
1071+
test.yaml:19:36: "github.event.head_commit.author.name" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions for more details [expression]
10721072
|
10731073
19 | script: console.log('${{ github.event.head_commit.author.name }}')
10741074
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1075-
test.yaml:22:31: object filter extracts potentially untrusted properties "github.event.comment.body", "github.event.discussion.body", "github.event.issue.body", "github.event.pull_request.body", "github.event.review.body", "github.event.review_comment.body". avoid using the value directly in inline scripts. instead, pass the value through an environment variable. see https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions for more details [expression]
1075+
test.yaml:22:31: object filter extracts potentially untrusted properties "github.event.comment.body", "github.event.discussion.body", "github.event.issue.body", "github.event.pull_request.body", "github.event.review.body", "github.event.review_comment.body". avoid using the value directly in inline scripts. instead, pass the value through an environment variable. see https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions for more details [expression]
10761076
|
10771077
22 | run: echo '${{ toJSON(github.event.*.body) }}'
10781078
| ^~~~~~~~~~~~~~~~~~~~

expr_insecure.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func (ms UntrustedInputSearchRoots) AddRoot(m *UntrustedInputMap) {
8181
// BuiltinUntrustedInputs is list of untrusted inputs. These inputs are detected as untrusted in
8282
// `run:` scripts. See the URL for more details.
8383
// - https://securitylab.github.com/research/github-actions-untrusted-input/
84-
// - https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions
84+
// - https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions
8585
// - https://github.com/github/codeql/blob/main/javascript/ql/src/experimental/Security/CWE-094/ExpressionInjection.ql
8686
var BuiltinUntrustedInputs = UntrustedInputSearchRoots{
8787
"github": NewUntrustedInputMap("github",
@@ -277,7 +277,7 @@ func (u *UntrustedInputChecker) end() {
277277
if len(inputs) == 1 {
278278
err := errorfAtExpr(
279279
u.start,
280-
"%q is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions for more details",
280+
"%q is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions for more details",
281281
inputs[0],
282282
)
283283
u.errs = append(u.errs, err)
@@ -286,7 +286,7 @@ func (u *UntrustedInputChecker) end() {
286286
// filter syntax. Show all properties in error message.
287287
err := errorfAtExpr(
288288
u.start,
289-
"object filter extracts potentially untrusted properties %s. avoid using the value directly in inline scripts. instead, pass the value through an environment variable. see https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions for more details",
289+
"object filter extracts potentially untrusted properties %s. avoid using the value directly in inline scripts. instead, pass the value through an environment variable. see https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions for more details",
290290
sortedQuotes(inputs),
291291
)
292292
u.errs = append(u.errs, err)

rule_permissions.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ var allPermissionScopes = map[string]struct{}{
1818
}
1919

2020
// RulePermissions is a rule checker to check permission configurations in a workflow.
21-
// https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token
21+
// https://docs.github.com/en/actions/security-for-github-actions/security-guides/automatic-token-authentication#permissions-for-the-github_token
2222
type RulePermissions struct {
2323
RuleBase
2424
}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
test.yaml:11:162: "github.event.head_commit.author.name" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions for more details [expression]
1+
test.yaml:11:162: "github.event.head_commit.author.name" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions for more details [expression]
+3-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
test.yaml:7:23: "github.event.pages.*.page_name" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions for more details [expression]
2-
test.yaml:7:42: "github.event.commits.*.author.name" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions for more details [expression]
3-
test.yaml:7:63: "github.event.issue.title" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions for more details [expression]
1+
test.yaml:7:23: "github.event.pages.*.page_name" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions for more details [expression]
2+
test.yaml:7:42: "github.event.commits.*.author.name" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions for more details [expression]
3+
test.yaml:7:63: "github.event.issue.title" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions for more details [expression]

testdata/err/one_error.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
test.yaml:6:41: "github.event.head_commit.message" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions for more details [expression]
1+
test.yaml:6:41: "github.event.head_commit.message" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions for more details [expression]

testdata/examples/main.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
test.yaml:3:5: unexpected key "branch" for "push" section. expected one of "branches", "branches-ignore", "paths", "paths-ignore", "tags", "tags-ignore", "types", "workflows" [syntax-check]
22
test.yaml:5:11: character '\' is invalid for branch and tag names. only special characters [, ?, +, *, \, ! can be escaped with \. see `man git-check-ref-format` for more details. note that regular expression is unavailable. note: filter pattern syntax is explained at https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet [glob]
33
/test\.yaml:10:28: label "linux-latest" is unknown\. available labels are .+\. if it is a custom label for self-hosted runner, set list of labels in actionlint\.yaml config file \[runner-label\]/
4-
test.yaml:13:41: "github.event.head_commit.message" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions for more details [expression]
4+
test.yaml:13:41: "github.event.head_commit.message" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions for more details [expression]
55
test.yaml:17:11: input "node_version" is not defined in action "actions/setup-node@v4". available inputs are "always-auth", "architecture", "cache", "cache-dependency-path", "check-latest", "node-version", "node-version-file", "registry-url", "scope", "token" [action]
66
test.yaml:21:20: property "platform" is not defined in object type {os: string} [expression]
77
test.yaml:22:17: receiver of object dereference "permissions" must be type of object but got "string" [expression]

testdata/examples/untrusted_input.out

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
test.yaml:10:24: "github.event.pull_request.title" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions for more details [expression]
2-
test.yaml:19:36: "github.event.head_commit.author.name" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions for more details [expression]
3-
test.yaml:22:31: object filter extracts potentially untrusted properties "github.event.comment.body", "github.event.discussion.body", "github.event.issue.body", "github.event.pull_request.body", "github.event.review.body", "github.event.review_comment.body". avoid using the value directly in inline scripts. instead, pass the value through an environment variable. see https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions for more details [expression]
1+
test.yaml:10:24: "github.event.pull_request.title" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions for more details [expression]
2+
test.yaml:19:36: "github.event.head_commit.author.name" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions for more details [expression]
3+
test.yaml:22:31: object filter extracts potentially untrusted properties "github.event.comment.body", "github.event.discussion.body", "github.event.issue.body", "github.event.pull_request.body", "github.event.review.body", "github.event.review_comment.body". avoid using the value directly in inline scripts. instead, pass the value through an environment variable. see https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions for more details [expression]

0 commit comments

Comments
 (0)