Skip to content

Commit b71f88a

Browse files
committed
secrets-inherit: soften to best-practice recommendation
1 parent 78c3aba commit b71f88a

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

actions/ql/src/experimental/Security/CWE-200/SecretsInherit.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
## Overview
22

3-
When calling a reusable workflow with `secrets: inherit`, all organization, repository, and environment secrets from the parent workflow are forwarded to the called workflow. This violates the principle of least privilege and increases the impact of a potential vulnerability in the reusable workflow.
3+
When calling a reusable workflow with `secrets: inherit`, every secret the calling workflow can access (organization, repository, and environment secrets) is forwarded to the callee. This is convenient but broader than most callees require. If the reusable workflow has a vulnerability — for example, a template-injection flaw — the blast radius includes every inherited secret rather than just the ones it actually uses.
44

55
## Recommendation
66

7-
Instead of using `secrets: inherit`, explicitly pass only the secrets that the reusable workflow actually needs via a `secrets:` block.
7+
As a defense-in-depth measure, prefer passing only the secrets the reusable workflow needs via an explicit `secrets:` block.
88

99
## Example
1010

actions/ql/src/experimental/Security/CWE-200/SecretsInherit.ql

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/**
22
* @name Secrets inherited by reusable workflow
3-
* @description Using `secrets: inherit` passes all parent secrets to a reusable workflow,
4-
* violating the principle of least privilege.
3+
* @description Using `secrets: inherit` passes every secret the calling workflow can access
4+
* to a reusable workflow, which is more than most callees need.
55
* @kind problem
6-
* @precision high
7-
* @security-severity 5.0
8-
* @problem.severity warning
6+
* @precision medium
7+
* @security-severity 3.0
8+
* @problem.severity recommendation
99
* @id actions/secrets-inherit
1010
* @tags actions
1111
* security
@@ -22,5 +22,5 @@ where
2222
secretsNode = job.(ExternalJobImpl).getNode().lookup("secrets") and
2323
secretsNode.getValue() = "inherit"
2424
select secretsNode,
25-
"All parent secrets are unconditionally inherited by the reusable workflow $@. Pass only the secrets that are needed.",
25+
"Every secret accessible to the calling workflow is forwarded to $@. Consider passing only the secrets it actually needs.",
2626
job.(Uses).getCalleeNode(), job.(Uses).getCallee()

0 commit comments

Comments
 (0)