Back to skill

Security audit

Feyagate

Security checks for vulnerabilities and agentic risk

Overview

This smart-home gateway skill is clearly about device control, but it combines unsafe auto-install instructions, broad network exposure, camera/account access, and persistent agent-state changes that need review before use.

Install only after reviewing the installer and binary source, prefer pinned versions with checksums, and do not let an agent run the AUTO one-line install unattended. Run the gateway on localhost only, keep it behind a firewall, avoid entering account passwords over non-loopback HTTP, and treat camera/Vision AI, schedules, memory, and skill-management tools as admin-only actions requiring explicit approval.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
Findings (4)

T03 · Remote Payload Retrieval and Execution

Error
Location
QUICKSTART.md:14
Finding

Automatic Execution of Mutable Remote Installation Scripts

Content
View full analysis
Steps marked with **[AUTO]** can be executed without asking the user. > Steps marked with **[ASK]** require user input before proceeding. ## One-Line Install [AUTO] **macOS / Linux** — installs the Python package and MCP server binary in one step: ```bash curl -fsSL https://raw.githubusercontent.com/toddpan/feyagate-skill/main/scripts/install.sh | bash ``` **Windows (PowerShell):** ```powershell iwr -useb https://raw.githubusercontent.com/toddpan/feyagate-skill/main/scripts/install.ps1 | iex ``` ``` ### Technical Analysis The installation instructions download mutable content from the `main` branch of a personal GitHub repository and immediately pass it to Bash or PowerShell. The effective code executed on a user's system can therefore change after this Skill has been reviewed. Neither installation path pins an immutable commit, verifies a cryptographic signature, checks a published digest, nor lets the user inspect the downloaded file before execution. The `-s`/`-fsSL` and `-useb` options also make this a streamlined, noninteractive execution flow. The risk is amplified by labeling the installation step as `[AUTO]` and explicitly stating that an AI assistant may execute it without asking the user. Installation of a smart-home gateway may be legitimate, but unattended execution of an unverified remote script is not the minimum privilege necessary to perform that installation. The actual remote scripts are not included in the audited artifact. Consequently, their current or future behavior—including downloaded binaries, filesystem modifications, persistence, credential access, and network activity—cannot be verified by this audit. ### Attack Path 1. An attacker compromises the GitHub account, repository, branch, or content delivery pat ...[truncated 1181 chars]
Remediation
View remediation
" sha256sum -c install.sh.sha256 less install.sh bash install.sh ``` 7. Apply the equivalent download, signature verification, inspection, and execution separation on Windows. 8. Include the installer source in the audited Skill artifact or link it to an immutable revision so reviewers can verify its behavior. 9. Document every file, executable, service, and network endpoint the installer creates or contacts. ]]>

T05 · Unauthorized Access and Privilege Escalation

Error
Location
SKILL.md:128
Finding

Privileged Smart-Home API Is Documented Without Caller Authentication and Binds to All Interfaces

Content
View full analysis
**Base URL**: `http://:` (desktop default `38080`) > **Protocol**: HTTP REST + MCP JSON-RPC 2.0 > **CORS**: Globally permits `Access-Control-Allow-Origin: *` ``` The audited file expresses these lines in Chinese; the English rendering above preserves their documented meaning. From `FeyaGate_MCP_API.md`: ```bash curl -X POST http://localhost:38080/mcp/http \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"MyClient","version":"1.0.0"}}}' curl -s -X POST http://localhost:38080/mcp/http \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}' ``` The same document states that HTTP calls require no prior handshake and that the server is stateless and issues no session identifier. No authorization header, access token, client certificate, or permission scope is documented for privileged tool calls. The exposed catalog includes, among other operations: ```text set_xiaomi_device_property execute_xiaomi_device_action xiaomi/scene_trigger xiaomi/camera_connect xiaomi/camera_snapshot xiaoai/tts xiaoai/control auth/midea_login auth/midea_logout auth/ewelink_login auth/ewelink_logout set_midea_device_property set_ewelink_device_property trigger/create schedule/add skill/create skill/update config/set_vision license/set license/clear ``` ### Technical Analysis Binding the service to `0.0 ...[truncated 3009 chars]
Remediation
View remediation

T02 · Agent Memory Poisoning

Error
Location
FeyaGate_HTTP_API.md:1038
Finding

Persistent Agent Skills, Memory, and Recurring Actions Can Be Mutated Through the Gateway

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Error
Location
QUICKSTART.md:40
Finding

Unpinned Python Package and Unverifiable Downloaded Server Binary

Content
View full analysis
Remediation
View remediation
" --require-hashes ``` 2. Publish and use a hash-locked requirements file for all transitive dependencies. 3. Clone an immutable commit or verified signed release tag instead of the default branch. 4. Publish the server binary as a versioned release artifact with: - SHA-256 or stronger digest - Detached cryptographic signature - Documented signing key - Platform and architecture metadata 5. Make `feyagate setup` fail closed when signature or digest verification fails. 6. Display the exact binary source, version, digest, and destination before installation. 7. Require user confirmation before downloading or replacing an executable. 8. Publish the server source and reproducible-build instructions so users can verify that release binaries correspond to reviewed source. 9. Include the setup/downloader implementation in the audited project. 10. Avoid automatic updates to mutable “latest” artifacts; require version selection, verification, and rollback support. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (77)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · FeyaGate_HTTP_API.md (reported line 173)May include surrounding context.

清除授权

text
DELETE /api/v1/gateway/license

响应示例:

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
94% confidence
Finding

Self-modifying capabilities are especially risky in an MCP service because they let an agent rewrite its own future behavior by changing skill content. That creates a persistence mechanism for prompt injection, policy bypass, hidden data exfiltration instructions, or later device actions that are not visible in the original request flow.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The quick-start explicitly instructs AI agents to fetch and execute remote shell/PowerShell installer scripts via curl|bash and iex. This grants arbitrary code execution on the host from mutable remote content, which is especially dangerous because the document marks it as safe for autonomous execution by agents.

Content

No source excerpt is available for this finding.

Chaining Abuse

High
Category
Tool Misuse
Confidence
99% confidence
Finding

Piping the output of a network fetch directly into bash is a classic dangerous chaining pattern that combines retrieval and execution without review. If the remote content is modified, intercepted, or the source account is compromised, the host can be fully compromised immediately.

Content

Scanner excerpt · QUICKSTART.md (reported line 27)May include surrounding context.

macOS / Linux — installs the Python package and MCP server binary in one step:

bash
curl -fsSL https://raw.githubusercontent.com/toddpan/feyagate-skill/main/scripts/install.sh | bash

Windows (PowerShell):

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · QUICKSTART.md (reported line 121)May include surrounding context.

Requires Tuya Smart or Smart Life app. User Code location: Me → Settings → Account & Security → User Code.

bash
curl -s -X POST http://localhost:38080/mcp/http \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"auth/tuya_qr","arguments":{"user_code":"USER_CODE"}}}' \
  | python3 -m json.tool

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · QUICKSTART.md (reported line 132)May include surrounding context.

Midea (Password Login)

bash
curl -s -X POST http://localhost:38080/mcp/http \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"auth/midea_login","arguments":{"account":"PHONE_OR_EMAIL","password":"PASSWORD"}}}' \
  | python3 -m json.tool

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · QUICKSTART.md (reported line 141)May include surrounding context.

eWeLink (Password Login)

bash
curl -s -X POST http://localhost:38080/mcp/http \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"auth/ewelink_login","arguments":{"email":"EMAIL","password":"PASSWORD","country_code":"+86"}}}' \
  | python3 -m json.tool

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · QUICKSTART.md (reported line 150)May include surrounding context.

Verify Authorization

bash
curl -s -X POST http://localhost:38080/mcp/http \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"auth/platforms","arguments":{}}}' \
  | python3 -m json.tool

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · QUICKSTART.md (reported line 177)May include surrounding context.

md
## Usage Examples

> These examples show how to use the MCP tools via curl.
> When using through an AI agent, the agent calls these tools automatically — no curl needed.

### List & Search Devices

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · QUICKSTART.md (reported line 189)May include surrounding context.

md
| python3 -m json.tool

# Search by keyword
curl -s -X POST http://localhost:38080/mcp/http \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"device/list","arguments":{"filter":["living room","light"]}}}' \
  | python3 -m json.tool

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · QUICKSTART.md (reported line 195)May include surrounding context.

md
| python3 -m json.tool

# Filter by platform
curl -s -X POST http://localhost:38080/mcp/http \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"device/list","arguments":{"filter":[],"platform":"xiaomi"}}}' \
  | python3 -m json.tool

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · QUICKSTART.md (reported line 209)May include surrounding context.

bash
# Query device spec
curl -s -X POST http://localhost:38080/mcp/http \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"device/specs","arguments":{"deviceId":"YOUR_DID"}}}' \
  | python3 -m json.tool

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · QUICKSTART.md (reported line 215)May include surrounding context.

md
| python3 -m json.tool

# Read property
curl -s -X POST http://localhost:38080/mcp/http \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"xiaomi/get_properties","arguments":{"device_id":"YOUR_DID","siid":2,"piids":[1]}}}' \
  | python3 -m json.tool

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · QUICKSTART.md (reported line 221)May include surrounding context.

md
| python3 -m json.tool

# Set property (turn on light)
curl -s -X POST http://localhost:38080/mcp/http \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"xiaomi/set_property","arguments":{"device_id":"YOUR_DID","siid":2,"piid":1,"value":true}}}' \
  | python3 -m json.tool

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · QUICKSTART.md (reported line 227)May include surrounding context.

md
| python3 -m json.tool

# Execute action
curl -s -X POST http://localhost:38080/mcp/http \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":4,"method":"tools/call","params":{"name":"xiaomi/execute_action","arguments":{"device_id":"YOUR_DID","siid":2,"aiid":1}}}' \
  | python3 -m json.tool

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · QUICKSTART.md (reported line 237)May include surrounding context.

bash
# List scenes
curl -s -X POST http://localhost:38080/mcp/http \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"scene/list","arguments":{"platform":"xiaomi"}}}' \
  | python3 -m json.tool

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · QUICKSTART.md (reported line 243)May include surrounding context.

md
| python3 -m json.tool

# Trigger scene
curl -s -X POST http://localhost:38080/mcp/http \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"scene/trigger","arguments":{"platform":"xiaomi","sceneId":"SCENE_ID"}}}' \
  | python3 -m json.tool

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · QUICKSTART.md (reported line 253)May include surrounding context.

bash
# TTS broadcast
curl -s -X POST http://localhost:38080/mcp/http \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"xiaoai/tts","arguments":{"device_id":"SPEAKER_DID","text":"Hello, welcome home"}}}' \
  | python3 -m json.tool

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · QUICKSTART.md (reported line 259)May include surrounding context.

md
| python3 -m json.tool

# Play music
curl -s -X POST http://localhost:38080/mcp/http \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"xiaoai/play_music","arguments":{"device_id":"SPEAKER_DID","text":"Play some pop music"}}}' \
  | python3 -m json.tool

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · QUICKSTART.md (reported line 265)May include surrounding context.

md
| python3 -m json.tool

# Voice control (silent mode)
curl -s -X POST http://localhost:38080/mcp/http \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"xiaoai/control","arguments":{"device_id":"SPEAKER_DID","command":"turn on the living room light","silence":true}}}' \
  | python3 -m json.tool

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · QUICKSTART.md (reported line 279)May include surrounding context.

md
feyagate snapshot --camera-id CAMERA_DID --connect --count 3

# API: connect → wait → snapshot → disconnect
curl -s -X POST http://localhost:38080/mcp/http \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"xiaomi/camera_connect","arguments":{"camera_id":"CAMERA_DID"}}}'
# Wait 3-5 seconds for P2P connection

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The documentation describes capturing camera frames and sending visual content to Vision AI but does not prominently warn that private images and scene details may leave the local environment and be processed by external services. In a smart-home context, this is especially sensitive because camera data can reveal occupants, routines, and interiors.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
74% confidence
Finding

A camera snapshot option that switches to subprocess-based execution signals a potentially dangerous execution path without documenting strict constraints on what is invoked. In a system already handling device and camera inputs, subprocess invocation increases the risk of command execution bugs or abuse if arguments or downstream components are not tightly controlled.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The documented configuration and deletion-style operations can change persistent system behavior or remove settings, but the document does not flag them as security-sensitive or system-affecting. In an agent-operated gateway, lack of warning increases the chance of accidental or unauthorized destructive changes with operational and privacy consequences.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The API includes Vision AI configuration, external model endpoint settings, and token-usage analytics that go beyond basic smart-home control and introduce outbound data flow to third-party AI services. Because camera-derived content may be analyzed externally and API endpoints can be reconfigured, this increases the risk of privacy leakage, data exfiltration, and misuse of stored AI credentials.

Content

No source excerpt is available for this finding.