Skip to content

Fix shell injection vulnerability in lint-external-links workflow#17587

Open
fix-it-felix-sentry[bot] wants to merge 1 commit intomasterfrom
fix/di-1913-shell-injection-vulnerability
Open

Fix shell injection vulnerability in lint-external-links workflow#17587
fix-it-felix-sentry[bot] wants to merge 1 commit intomasterfrom
fix/di-1913-shell-injection-vulnerability

Conversation

@fix-it-felix-sentry
Copy link
Copy Markdown

Summary

This PR fixes a high severity shell injection vulnerability in the lint-external-links.yml GitHub 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_ref to 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

  • Added env: section to the "Get changed files" step
  • Set BASE_REF: ${{ github.base_ref }} as an environment variable
  • Updated shell command to use "${BASE_REF}" instead of direct interpolation

References

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>
@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 2, 2026

@vercel
Copy link
Copy Markdown

vercel Bot commented May 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
develop-docs Ready Ready Preview, Comment May 2, 2026 4:18am
sentry-docs Ready Ready Preview, Comment May 2, 2026 4:18am

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants