From 85a7b4f8b85f752a7714747994b4b05f1d2f1ed6 Mon Sep 17 00:00:00 2001 From: turer73 Date: Sun, 31 May 2026 16:40:39 +0300 Subject: [PATCH] security(ci): prevent script injection from commit message in notify job (pass via env, not shell interpolation) --- .github/workflows/deploy.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c4e02b6..65224cd 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -150,8 +150,11 @@ jobs: TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} + # Pass untrusted commit message via env (NOT shell interpolation) to prevent + # script injection: a commit message like $(curl evil) must stay literal data. + COMMIT_MSG_RAW: ${{ github.event.head_commit.message }} run: | - COMMIT_MSG=$(echo "${{ github.event.head_commit.message }}" | head -1) + COMMIT_MSG=$(printf '%s' "$COMMIT_MSG_RAW" | head -1) STATUS="${{ needs.deploy-coolify.result }}" MSG="[Linux-AI Deploy] ${STATUS}