Back to skill

Security audit

麦当劳智能点餐助手

Security checks for vulnerabilities and agentic risk

Overview

This McDonald's ordering skill is transparent about its purpose, but it needs Review because a configurable endpoint can redirect the user's bearer token despite security claims that requests only go to McDonald's.

Install only if you trust the source and understand that the skill gets a McDonald's account token plus shell access. Before use, remove or tightly control any `MCD_MCP_URL` environment override, prefer network egress limited to `https://mcp.mcd.cn`, use a revocable token if available, and manually confirm coupon, address, and order actions before they run.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:48
Finding

Configurable MCP Endpoint Can Exfiltrate the API Bearer Token

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 13 and 48–51
Vulnerability Type: Arbitrary credential destination caused by an unrestricted endpoint override
Risk Level: High

Vulnerable Code

markdown
- `MCD_MCP_URL` (optional) - MCP service endpoint URL (default: https://mcp.mcd.cn)
bash
curl -s -X POST "${MCD_MCP_URL:-https://mcp.mcd.cn}" \
  -H "Authorization: Bearer ${MCD_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"TOOL_NAME","arguments":{...}},"id":1}'

The implementation also conflicts with the security claim in SECURITY.md, lines 87–91:

markdown
1. **Hardcoded API endpoint**
   - Only communicates with `mcp.mcd.cn`
   - MCD_MCP_URL has a safe default
   - No dynamic URL construction from user input

Technical Analysis

The skill places the sensitive MCD_TOKEN value in an HTTP Authorization header while allowing the request destination to be selected through the unrestricted MCD_MCP_URL environment variable. A safe default does not provide destination security because any existing value overrides that default.

There is no documented or implemented validation requiring HTTPS, checking that the parsed hostname is exactly mcp.mcd.cn, restricting the port, or otherwise allowlisting the expected origin. Consequently, any party able to influence the skill's environment can redirect authenticated requests to an attacker-controlled endpoint. The token will then be transmitted as a bearer credential before the response is processed.

This is an insecure configuration and credential-handling flaw rather than evidence that the reviewed package intentionally sets a malicious endpoint. Nevertheless, it creates a direct credential-exfiltration primitive. The inaccurate statement in SECURITY.md may also cause users to underestimate the risk because the endpoint is not actually hardcoded.

Attack Path

  1. An attacker, compromised lau ...[truncated 1289 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove the MCD_MCP_URL override if alternate service endpoints are not operationally required:

    bash
    curl --fail --silent --show-error \
      --request POST "https://mcp.mcd.cn" \
      --header "Authorization: Bearer ${MCD_TOKEN}" \
      --header "Content-Type: application/json" \
      --data "$REQUEST_BODY"
    
  2. If endpoint configurability is required, validate the parsed URL before attaching credentials:

    • Require the https scheme.
    • Require the exact hostname mcp.mcd.cn.
    • Reject embedded credentials, fragments, unexpected ports, and deceptive suffixes such as mcp.mcd.cn.attacker.example.
    • Compare parsed URL components rather than using substring or prefix checks.
    • Prefer an explicit allowlist of complete origins.
  3. Prevent cross-origin credential forwarding:

    • Disable redirects with --max-redirs 0, or strictly validate every redirect destination before following it.
    • Do not attach the authorization header until endpoint validation succeeds.
  4. Apply defense in depth:

    • Use narrowly scoped, short-lived, and revocable tokens where supported.
    • Run the skill with a restricted execution environment and network egress allowlisting for mcp.mcd.cn.
    • Avoid inheriting endpoint configuration from untrusted parent processes or project-local environment files.
  5. Correct SECURITY.md and README.md so they accurately describe endpoint configurability and its trust assumptions. Do not claim that the destination is hardcoded while an environment variable can override it.

  6. Add negative security tests that verify requests are rejected for HTTP endpoints, alternate hosts, deceptive hostnames, unexpected ports, malformed URLs, and cross-origin redirects.

Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (12)

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README explicitly states the skill requires shell access even though McDonald's ordering, coupons, and nutrition lookup can be implemented through scoped API/tool calls alone. Granting arbitrary command execution alongside an account token materially expands the attack surface and could enable token theft, local file access, or command-and-control behavior if the skill implementation is compromised or overly broad.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
72% confidence
Finding

The README describes transmitting a sensitive bearer token to an external remote service and even warns reviewers to verify the target host, confirming outbound credential use. External transmission is expected for an ordering skill, but it still creates real security exposure because compromise of the endpoint, DNS/URL substitution, or hidden alternate destinations in implementation could leak account credentials and order data.

Content

Scanner excerpt · README.md (reported line 13)May include surrounding context.

md
1. ✅ Review the source code in SKILL.md
2. ✅ Read [SECURITY.md](SECURITY.md) for detailed security considerations
3. ✅ Only install from trusted sources (official Anthropic repository)
4. ✅ Verify all curl commands only target `mcp.mcd.cn`

**Risk**: If this skill is from an untrusted source, it could potentially exfiltrate your API token or execute malicious commands.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill documentation is predominantly written in Chinese, including core usage, safety, and workflow instructions, with no indication that users may choose another language. The policy requires flagging language or locale constraints when a specific language is imposed without user opt-in or clear justification.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
77% confidence
Finding

The documentation claims all write actions require explicit user confirmation, but the listed operation name auto-bind-coupons implies direct state-changing behavior such as claiming or binding coupons. That mismatch is dangerous because users and reviewers may rely on the stated confirmation guarantee while the actual workflow could perform account-modifying actions earlier than expected.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
86% confidence
Finding

The document explicitly states that the skill requires execute_bash to run curl with a bearer token, which means the skill design depends on a powerful shell primitive plus sensitive credentials. Even though the text claims the endpoint is limited to McDonald's MCP, this combination materially increases the blast radius if the skill logic is modified, compromised, or tricked into issuing unintended commands.

Content

Scanner excerpt · SECURITY.md (reported line 10)May include surrounding context.

md
## Required Permissions

### 1. execute_bash Tool
**What it does**: Executes shell commands to make API calls via curl

**Why needed**: The skill uses curl to communicate with McDonald's MCP API

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
80% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

Scanner excerpt · SECURITY.md (reported line 63)May include surrounding context.

  1. Review the source code
    bash
    cat ~/.kiro/skills/mcdonald-order/SKILL.md
    
    • Check all curl commands only target mcp.mcd.cn
    • Verify no suspicious bash commands

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · SECURITY.md (reported line 114)May include surrounding context.

md
4. **User confirmation required**
   - All write operations require explicit user approval
   - Read-only queries can proceed without confirmation
   - Clear indication of what each operation does

## Reporting Security Issues

Rp1

Medium
Category
MCP Rug Pull
Confidence
75% confidence
Finding

Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SECURITY.md (reported line 144)May include surrounding context.

  1. Monitor network traffic
    bash
    # Use tcpdump or wireshark to verify connections
    sudo tcpdump -i any host mcp.mcd.cn
    

Conclusion

External Transmission

Medium
Category
Data Exfiltration
Confidence
90% confidence
Finding

The skill directs the agent to transmit sensitive user data and an authorization bearer token to an external endpoint via curl. In this skill's context, later workflows include addresses, phone numbers, order details, and account-linked coupon actions, so the external transmission is real and can expose credentials or personal data if the endpoint is misconfigured, overridden via MCD_MCP_URL, or insufficiently trusted.

Content

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

API Call Pattern

All tools are invoked via curl to the MCP endpoint:

bash
curl -s -X POST "${MCD_MCP_URL:-https://mcp.mcd.cn}" \

Excessive Permissions

Low
Category
Privilege Escalation
Confidence
84% confidence
Finding

The README acknowledges sensitive permissions including an account token and shell access, which is broader than necessary for the described consumer ordering use case. Even if disclosed transparently, excessive privilege increases the blast radius of any prompt injection, implementation bug, or malicious modification of the skill.

Content

Scanner excerpt · README.md (reported line 5)May include surrounding context.

md
## ⚠️ SECURITY WARNING

**This skill requires sensitive permissions:**
- 🔑 **API Token** (MCD_TOKEN) - Access to your McDonald's account
- 💻 **Shell Access** (execute_bash) - Can run system commands

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The communication guideline says to 'Use friendly, conversational Chinese,' which imposes a specific language on all interactions. Under the policy, forcing a language or locale without user opt-in is a natural-language policy violation unless the constraint is explicitly justified or optional.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.