Repository navigation
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🟠 High severity issue identified in your code:
The reusable Query Shield workflow inherits all repository and organization secrets, including the runner App ID and key. A compromised or malicious change to the external workflow could exfiltrate those credentials and use them outside the intended job.
More details about this
query-shieldcallsrazorpay/query-shield/.github/workflows/query-shield.yml@masterand passes it every secret available to this repository throughsecrets: inherit, including the organization-level runner App ID and key mentioned in the comment—not only secrets required by Query Shield.A plausible attack is:
razorpay/query-shieldrepository, or a change merged into itsmasterbranch introduces a malicious step.master/main.query-shieldworkflow can read inherited values such as the runner App ID and key, then send them to an attacker-controlled endpoint (for example, withcurlfrom a workflow step).contents: read,statuses: write,issues: write, andpull-requests: writepermissions. Because the workflow is pinned to the mutablemasterbranch, a compromised upstream workflow can receive these secrets on its next run.To resolve this comment:
✨ Commit fix suggestion
View step-by-step instructions
secrets: inheritfrom.github/workflows/query-shield.yml; do not pass every repository secret to the reusable workflow.razorpay/query-shield/.github/workflows/query-shield.yml@masterfor the declared secret names and identify the runner App ID and private key it requires.RUNNER_APP_IDandRUNNER_APP_PRIVATE_KEYwith the exact secret names used by the reusable workflow and configured as organization or repository secrets.on.workflow_call.secretsdeclaration if those secrets are not already defined there. A called workflow can only receive explicitly declared secrets, so the names in the caller and reusable workflow must match.💬 Ignore this finding
Leave a nosemgrep comment directly above or at the end of line 18 like so
// nosemgrep: yaml.github-actions.security.secrets-inherit.secrets-inheritTake care to validate that this is not a true positive finding before ignoring it.
Learn more about ignoring code, files and folders here.
You can view more details about this finding in the Semgrep AppSec Platform.