Fix shell injection vulnerability in lint-external-links workflow#17587
Open
fix-it-felix-sentry[bot] wants to merge 1 commit intomasterfrom
Open
Fix shell injection vulnerability in lint-external-links workflow#17587fix-it-felix-sentry[bot] wants to merge 1 commit intomasterfrom
fix-it-felix-sentry[bot] wants to merge 1 commit intomasterfrom
Conversation
Move github.base_ref from inline shell interpolation to environment variable to prevent potential code injection attacks. This follows GitHub Actions security best practices for handling untrusted input. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR fixes a high severity shell injection vulnerability in the
lint-external-links.ymlGitHub Actions workflow.Problem
The workflow was using
${{ github.base_ref }}directly in a shell command, which could allow an attacker to inject malicious code if they can control the base branch name. This is a security risk as GitHub context data can contain arbitrary user input.Solution
Moved
github.base_refto an environment variable (BASE_REF) and referenced it as"${BASE_REF}"in the shell command. This prevents the shell from interpreting untrusted input as code.Changes
env:section to the "Get changed files" stepBASE_REF: ${{ github.base_ref }}as an environment variable"${BASE_REF}"instead of direct interpolationReferences