CI: pin mcp-publisher version by direct download (impossible with brew) - #318
Conversation
Replace Homebrew install with direct binary download from GitHub releases to avoid running an untrusted version.
WalkthroughThe workflow in 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/build.yml:
- Line 69: Replace the raw curl|tar download of the mcp-publisher binary with a
guarded download-and-verify flow: fetch the release artifact and its checksum or
signature (e.g., mcp-publisher_linux_amd64.tar.gz and
mcp-publisher_linux_amd64.tar.gz.sha256 or .asc) using the same release URL,
verify the downloaded file with sha256sum (or gpg --verify against a trusted
public key) and abort the job if verification fails, then extract and install
mcp-publisher only after a successful checksum/signature validation; update the
step that runs the curl | tar pipeline (the command that downloads
mcp-publisher) to perform these verification checks and exit non‑zero on
mismatch.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b92082c0-d971-4954-a958-aa88c79a2602
📒 Files selected for processing (1)
.github/workflows/build.yml
| # get homebrew in path | ||
| eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" | ||
| brew install mcp-publisher@1.5.0 | ||
| curl -fsSL https://github.com/modelcontextprotocol/registry/releases/download/v1.5.0/mcp-publisher_linux_amd64.tar.gz | tar xz -C /usr/local/bin mcp-publisher |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Verify whether mcp-publisher is downloaded without an integrity check in workflow.
if rg -n 'mcp-publisher_linux_amd64\.tar\.gz' .github/workflows/build.yml >/dev/null; then
if ! rg -n 'sha256sum|shasum|cosign|gpg|checksums' .github/workflows/build.yml >/dev/null; then
echo "FAIL: mcp-publisher artifact is downloaded without integrity verification."
exit 1
fi
fi
echo "PASS: Integrity verification marker found."Repository: mobile-next/mobile-mcp
Length of output: 140
🏁 Script executed:
# Examine the workflow file around line 69 to understand the full context
cat -n .github/workflows/build.yml | sed -n '50,90p'Repository: mobile-next/mobile-mcp
Length of output: 1023
🏁 Script executed:
# Check if there are any checksums or verification files in the repository
find . -name "*checksum*" -o -name "*sha*" -o -name "*CHECKSUMS*" 2>/dev/null | head -20Repository: mobile-next/mobile-mcp
Length of output: 80
🏁 Script executed:
# Look for any existing security practices in workflows
rg -n "sha256sum|shasum|cosign|gpg|integrity|verify" .github/workflows/ | head -20Repository: mobile-next/mobile-mcp
Length of output: 48
Add integrity verification for downloaded mcp-publisher before execution.
Line 69 downloads an external release artifact in a privileged release pipeline and immediately uses it without checksum or signature verification. The binary is then authenticated to GitHub via OIDC (line 70) and used to publish artifacts (line 73), creating a critical supply-chain attack vector.
🔒 Suggested hardening diff
- curl -fsSL https://github.com/modelcontextprotocol/registry/releases/download/v1.5.0/mcp-publisher_linux_amd64.tar.gz | tar xz -C /usr/local/bin mcp-publisher
+ curl -fsSLo /tmp/mcp-publisher_linux_amd64.tar.gz https://github.com/modelcontextprotocol/registry/releases/download/v1.5.0/mcp-publisher_linux_amd64.tar.gz
+ # Pin this to the official SHA256 published with the v1.5.0 release artifacts.
+ echo "<PINNED_SHA256> /tmp/mcp-publisher_linux_amd64.tar.gz" | sha256sum -c -
+ tar -xzf /tmp/mcp-publisher_linux_amd64.tar.gz -C /usr/local/bin mcp-publisher🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.github/workflows/build.yml at line 69, Replace the raw curl|tar download of
the mcp-publisher binary with a guarded download-and-verify flow: fetch the
release artifact and its checksum or signature (e.g.,
mcp-publisher_linux_amd64.tar.gz and mcp-publisher_linux_amd64.tar.gz.sha256 or
.asc) using the same release URL, verify the downloaded file with sha256sum (or
gpg --verify against a trusted public key) and abort the job if verification
fails, then extract and install mcp-publisher only after a successful
checksum/signature validation; update the step that runs the curl | tar pipeline
(the command that downloads mcp-publisher) to perform these verification checks
and exit non‑zero on mismatch.
No description provided.