Skip to content

Stop interpolating release analyzer workflow inputs into shell commands #5271

Closed

Description

@petrmarinec

Summary

The release analyzer workflow interpolates workflow_dispatch string inputs directly into the shell command used in run:. Shell metacharacters in start_tag or end_tag are parsed by bash before Python starts.

Affected code

  • .github/workflows/analyze-releases-for-adk-docs-updates.yml

Problem

The workflow currently expands inputs like this inside run::
${{ github.event.inputs.start_tag && format('--start-tag {0}', github.event.inputs.start_tag) || '' }}

A value such as v1.0.0; touch /tmp/proof # becomes part of the shell command line and executes as an additional command.

Expected behavior

Workflow inputs should be treated as data and passed to Python without shell interpretation.

Proposed fix

Move the dispatch inputs into environment variables and build the Python argument list in bash using an array before invoking the analyzer.

Validation

I have a PR prepared that:

  • removes direct interpolation of start_tag and end_tag into run:
  • passes the values through environment variables and a bash array
  • reproduces command execution with the pre-patch rendered command in Linux Docker
  • confirms the patched form passes the malicious value as a single argv element and does not create the proof file

Activity

  1. added
    tools[Component] This issue is related to tools
    on Apr 10, 2026
  2. added theissue type on Apr 10, 2026
  3. sanketpatil06 commented on Apr 14, 2026

    @sanketpatil06

    Hi @petrmarinec , Thanks for reporting this.
    Directly interpolating workflow_dispatch inputs into the run block leaves the workflow vulnerable to command injection. Binding these inputs to environment variables first is the correct and safest approach to handle arbitrary strings in GitHub Actions.
    We see you have already opened a PR (#5272) to address this. Our team is currently reviewing your PR.
    thanks for your contribution.

  4. self-assigned this
    on Jun 17, 2026
  5. GWeale commented on Jun 17, 2026

    @GWeale
    Collaborator

    Fixed on main via #5272 (commit 5a129a4): the workflow_dispatch inputs are now bound to env vars instead of being interpolated into the run block, which closes the injection vector. Thanks for flagging. Closing as fixed.

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

Metadata

Metadata

Labels

tools[Component] This issue is related to tools

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions