Skip to content

Fix code injection alerts; Remove phpstan-command#44

Merged
tangrufus merged 1 commit intomainfrom
inject
Apr 11, 2026
Merged

Fix code injection alerts; Remove phpstan-command#44
tangrufus merged 1 commit intomainfrom
inject

Conversation

@tangrufus
Copy link
Copy Markdown
Member

No description provided.

@tangrufus tangrufus added enhancement New feature or request breaking and removed enhancement New feature or request labels Apr 11, 2026
@tangrufus tangrufus marked this pull request as ready for review April 11, 2026 18:49
Copilot AI review requested due to automatic review settings April 11, 2026 18:49
@tangrufus tangrufus merged commit 090a06b into main Apr 11, 2026
3 checks passed
@tangrufus tangrufus deleted the inject branch April 11, 2026 18:49
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses GitHub Actions code-injection alerts by removing or hardening workflow inputs that were previously interpolated directly into run: commands.

Changes:

  • Removed the reusable-workflow input that allowed an arbitrary phpstan command to be executed.
  • Replaced direct ${{ github.* }} interpolation in go list commands with quoted GitHub-provided environment variables.
  • Routed pint-extra-paths through an environment variable to avoid direct expression interpolation in the run: line.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/lint-php.yml Removes phpstan-command input and hardcodes the phpstan invocation to avoid command injection.
.github/workflows/go-proxy.yml Uses $GITHUB_* env vars (quoted) instead of ${{ }} interpolation in run: commands.
.github/workflows/format-php.yml Passes pint-extra-paths via env var and references it in the shell command to mitigate injection.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +60 to +64
- run: pint "$PINT_EXTRA_PATHS"
if: ${{ inputs.pint-extra-paths != '' }}
shell: bash
env:
PINT_EXTRA_PATHS: ${{ inputs.pint-extra-paths }}
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pint "$PINT_EXTRA_PATHS" changes behavior compared to the previous pint ${{ inputs.pint-extra-paths }}: quoting prevents word-splitting and glob expansion, so callers can no longer pass multiple paths/patterns (e.g., space-separated paths or globs). If multi-path support is needed, consider expanding the env var into a bash array (or otherwise parsing/validating) and passing the resulting arguments to pint without re-introducing expression interpolation.

Copilot uses AI. Check for mistakes.
Comment on lines 4 to 10
workflow_call:
inputs:
# phpstan
phpstan:
description: Whether to run phpstan
default: true
type: boolean
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the phpstan-command input is a breaking change for this reusable workflow: any existing callers passing that input will now fail validation with an “unexpected input” error. If backward compatibility matters, consider keeping the input but mapping it to a constrained/allowlisted set of commands (or document the breaking change and require callers to update).

Copilot uses AI. Check for mistakes.
@tangrufus tangrufus changed the title Fix code injection alerts Fix code injection alerts; Remove phpstan-command Apr 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants