Back to skill

Security audit

Kagi Fastgpt

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it says, but its wrapper can download and run an unverified latest GitHub release binary, which is high-impact enough to require review before installation.

Install only if you are comfortable with a first-run path that may execute a prebuilt binary from the publisher's GitHub releases. Prefer building from the included Go source or independently verifying a pinned release artifact before running it, and do not send secrets, credentials, private URLs, or confidential internal text as FastGPT queries.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (1)

T03 · Remote Payload Retrieval and Execution

Error
Location
kagi-fastgpt.sh:43
Finding

Unverified Remote Binary Download and Execution

Content
View full analysis
/dev/null 2>&1; then RELEASE_META="$(curl -fsSL "https://api.github.com/repos/joelazar/kagi-skills/releases/latest")" elif command -v wget >/dev/null 2>&1; then RELEASE_META="$(wget -qO- "https://api.github.com/repos/joelazar/kagi-skills/releases/latest")" else echo "Error: Neither curl nor wget found. Please download the binary manually from:" >&2 echo " https://github.com/joelazar/kagi-skills/releases/latest" >&2 exit 1 fi TAG="$(printf '%s\n' "$RELEASE_META" | grep -m1 '"tag_name"' | cut -d'"' -f4 || true)" if [[ -z "$TAG" ]]; then echo "Error: Could not resolve latest release tag from GitHub API." >&2 echo "Please download manually from: https://github.com/joelazar/kagi-skills/releases/latest" >&2 exit 1 fi BINARY="kagi-fastgpt_${TAG}_${OS}_${ARCH}" URL="https://github.com/joelazar/kagi-skills/releases/download/${TAG}/${BINARY}" echo "kagi-fastgpt binary not found. Download pre-built binary from GitHub releases?" >&2 echo " $URL" >&2 read -r -p "Download? [Y/n] " reply >&2 &2 echo " $URL" >&2 exit 1 ;; esac if command -v curl >/dev/null 2>&1; then curl -fsSL "$URL" -o "$BIN" else wget -qO "$BIN" "$URL" fi chmod +x "$BIN" fi fi exec "$BIN" "$@" ``` ### Technical Analysis When a suitable Go compiler or an existing executable is unavailable, the wrapper queries the mutable GitHub `latest` release endpoint, downloads the corresponding executable, grants it execution permission, and subsequently executes it. The downloaded artif ...[truncated 2544 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (9)

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

A question-answering skill is expected to call Kagi or process local inputs, but this wrapper also has the capability to retrieve and execute remote code from GitHub. That expands the trust boundary far beyond the stated purpose and means a simple invocation can become arbitrary code execution if the remote release is malicious or substituted.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill explicitly relies on shell execution and environment secrets (KAGI_API_KEY), yet the manifest does not declare any tool scope such as permissions or allowed-tools. That omission weakens least-privilege controls and can cause the host agent to expose broader capabilities than users expect when running installation or wrapper commands.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill says it provides AI-generated answers with web sources, but it does not prominently warn that user prompts are sent to Kagi's external FastGPT service and trigger live web searches. Users may unknowingly transmit sensitive prompts, internal URLs, or proprietary data to a third party, creating a privacy and data-handling risk.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · SKILL.md (reported line 16)May include surrounding context.

md
Requires a Kagi account with API access enabled. Uses the same `KAGI_API_KEY` as the `kagi-search` skill.

1. Create an account at https://kagi.com/signup
2. Navigate to Settings → Advanced → API portal: https://kagi.com/settings/api
3. Generate an API Token
4. Add funds at: https://kagi.com/settings/billing_api

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script can fetch a release artifact from GitHub at runtime and then immediately mark it executable and run it. That creates a software supply-chain risk because the downloaded binary is not pinned to a trusted digest or signature, so compromise of the GitHub account, release pipeline, network trust, or release selection path could result in arbitrary code execution.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 95)May include surrounding context.

md
esac

    if command -v curl >/dev/null 2>&1; then
      RELEASE_META="$(curl -fsSL "https://api.github.com/repos/joelazar/kagi-skills/releases/latest")"
    elif command -v wget >/dev/null 2>&1; then
      RELEASE_META="$(wget -qO- "https://api.github.com/repos/joelazar/kagi-skills/releases/latest")"
    else

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · kagi-fastgpt.sh (reported line 48)May include surrounding context.

sh
esac

    if command -v curl >/dev/null 2>&1; then
      RELEASE_META="$(curl -fsSL "https://api.github.com/repos/joelazar/kagi-skills/releases/latest")"
    elif command -v wget >/dev/null 2>&1; then
      RELEASE_META="$(wget -qO- "https://api.github.com/repos/joelazar/kagi-skills/releases/latest")"
    else

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · kagi-fastgpt.sh (reported line 50)May include surrounding context.

sh
esac

    if command -v curl >/dev/null 2>&1; then
      RELEASE_META="$(curl -fsSL "https://api.github.com/repos/joelazar/kagi-skills/releases/latest")"
    elif command -v wget >/dev/null 2>&1; then
      RELEASE_META="$(wget -qO- "https://api.github.com/repos/joelazar/kagi-skills/releases/latest")"
    else

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

The manifest frames this skill as a FastGPT-based question-answering tool and does not mention handling local credentials or environment access. While the API key is needed to call Kagi, reading from environment variables is an additional capability that is not justified by the stated purpose alone under this rule set.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.