fix(ci): prevent command injection in release tag workflow - #2918
Conversation
…e injection Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
|
Important Review skippedNo new commits to review since the last review. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.) Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Potential fix for https://github.com/GetStream/stream-chat-flutter/security/code-scanning/39
The safest fix is to stop embedding
${{ github.event.head_commit.message }}directly insiderun:script text. Instead, pass it through an environment variable on the step and only reference the shell variable in the script. This prevents workflow-expression content from becoming executable shell code during script generation.Best minimal change (no functional change):
.github/workflows/release_tag.yml, update the “🏷️ Extract Version Tag” step:env:block with e.g.COMMIT_MSG: ${{ github.event.head_commit.message }}.commit_msg="${{ github.event.head_commit.message }}"withcommit_msg="$COMMIT_MSG".No new methods, definitions, or imports are needed in this YAML workflow.
Suggested fixes powered by Copilot Autofix. Review carefully before merging.
Summary by CodeRabbit