Back to skill

Security audit

calorie-detective-v1

Security checks for vulnerabilities and agentic risk

Overview

The skill has a coherent food-photo calorie purpose, but its implementation can send arbitrary readable files and wrongly selected API keys to external providers if misused or misconfigured.

Review before installing. Use only with non-sensitive food images, run it with a narrowly scoped upload directory if possible, and fix image validation plus provider-specific API key selection before production use. Prefer pinned dependencies and add a clear consent notice for third-party image analysis.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
src/calorie_calculator.py:458
Finding

Arbitrary Local File Contents Can Be Transmitted to External Vision APIs

Content
View full analysis
str: """Encode the image as Base64.""" with open(image_path, 'rb') as f: return base64.b64encode(f.read()).decode('utf-8') ``` The Kimi request reads the entire supplied file and represents it as a JPEG without validating its contents: ```python with open(image_path, 'rb') as f: base64_image = base64.b64encode(f.read()).decode('utf-8') payload = { "model": self.model, "messages": [ { "role": "user", "content": [ { "type": "text", "text": """Please identify the food in this image and return JSON.""" }, { "type": "image_url", "image_url": { "url": f"data:image/jpeg;base64,{base64_image}" } } ] } ], "max_tokens": 500 } response = requests.post( "https://api.moonshot.cn/v1/chat/completions", headers=headers, json=payload, timeout=30 ) ``` The OpenAI path repeats the same behavior: ```python with open(image_path, 'rb') as f: base64_image = base64.b64encode(f.read()).decode('utf-8') # ... "image_url": { "url": f"data:image/jpeg;base64,{base64_image}" } # ... response = requests.post( "https://api.openai.com/v1/chat/completions", headers=headers, json=payload, timeout=30 ) ``` The command-line entry point checks only whether the path exists: ```python image_path = sys.argv[1] if not os.path.exists(image_path): print(f"Error: image file does not exist: {image_path}") sys.exit(1) calculator = FoodCalo ...[truncated 2650 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
src/calorie_calculator.py:370
Finding

Cross-Provider API Key Confusion Can Disclose Credentials to the Wrong Service

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
requirements.txt:2
Finding

Unpinned Third-Party Dependencies Produce Non-Reproducible and Unsafe Installations

Content
View full analysis
=2.28.0 pyyaml>=6.0 Pillow>=9.0.0 ``` The deployment documentation also installs a command-line package without a reviewed version or hash: ```bash pip install kimi-claw ``` ### Technical Analysis Python package installation may execute package build or installation logic with the privileges of the invoking user. Open-ended version constraints permit future package releases to be selected without further review. The unversioned `kimi-claw` installation has the same problem and introduces an executable deployment tool into the environment. The identified package names are not demonstrated to be malicious, and no dependency-confusion or typosquatting package was confirmed. The vulnerability is the absence of version locking and integrity verification, which creates a supply-chain exposure and prevents reproducible builds. The deployment command is documentation rather than an automatic action in `run.sh`; exploitation therefore requires an operator to follow the installation instructions. ### Attack Path 1. An operator follows the deployment guide or installs `requirements.txt`. 2. `pip` resolves the newest versions that satisfy the open-ended constraints, or the newest available `kimi-claw` release. 3. A future compromised release, malicious maintainer update, compromised package account, or manipulated package source supplies altered code. 4. `pip` downloads the package without checking a project-maintained cryptographic hash. 5. Package build or installation code executes with the operator's privileges. 6. The installed code subsequently runs as part of deployment or normal Skill execution. ### Impact Assessment The maximum impact depends on ...[truncated 635 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (30)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The usage instructions tell users to upload food photos for analysis but do not warn that those images will be sent to a remote third-party AI service. This creates a privacy and consent risk because food photos may contain sensitive contextual information such as location, other people, documents, or health-related dietary data.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The deployment guide explicitly encourages custom natural-language triggers such as "自定义触发词" without any constraints, namespace guidance, or negative examples. Broad triggers can cause accidental activation on unrelated user messages, increasing unintended image processing and data transfer to the remote model service, especially in a consumer chat environment.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill documentation describes capabilities that require environment variable access, local file access, and outbound network access, but it does not declare any explicit tool scope or permissions. This creates an under-specified trust boundary where deployers may enable broader access than intended, increasing the chance of accidental over-privilege and misuse of secrets or local files.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The feature description promotes photo upload and AI vision analysis but does not warn that user food images may be sent to external providers. Because photos can contain sensitive incidental data such as location clues, people, or private surroundings, failing to disclose this external transmission creates a privacy and consent risk.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill claims support for natural-language triggering without defining exact invocation phrases, allowed contexts, or boundaries. Broad activation semantics can cause unintended invocation or prompt-capture by unrelated user text, especially in assistant environments where tool routing is automatic.

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 215)May include surrounding context.

bash
# 测试 API Key
curl https://api.moonshot.cn/v1/chat/completions \
  -H "Authorization: Bearer $KIMI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "moonshot-v1-auto", "messages": [{"role": "user", "content": "Hello"}]}'

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest sets OUTPUT_LANGUAGE: "zh", which imposes a specific language choice in the skill configuration. Under the policy, locale or language constraints should either be user-selectable or clearly justified as region-specific; neither is indicated here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The prompt literal explicitly instructs the model to answer in Chinese, and the file-level description/reporting is likewise Chinese-only. This forces a specific language/locale without offering the user a choice or documenting a justified region-specific restriction.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
92% confidence
Finding

This request sends user-supplied image data to an external network endpoint, which is a genuine data exposure boundary. In this skill's context, that matters because uploaded photos may include more than food alone, and the transfer occurs automatically as part of recognition without any apparent minimization or consent enforcement in code.

Content

Scanner excerpt · src/calorie_calculator.py (reported line 103)May include surrounding context.

python
"max_tokens": 500
        }
        
        response = requests.post(
            "https://api.moonshot.cn/v1/chat/completions",
            headers=headers,
            json=payload,

External Transmission

Medium
Category
Data Exfiltration
Confidence
92% confidence
Finding

This request sends user-supplied image data to an external network endpoint, which is a genuine data exposure boundary. In this skill's context, that matters because uploaded photos may include more than food alone, and the transfer occurs automatically as part of recognition without any apparent minimization or consent enforcement in code.

Content

Scanner excerpt · src/calorie_calculator.py (reported line 103)May include surrounding context.

python
"max_tokens": 500
        }
        
        response = requests.post(
            "https://api.moonshot.cn/v1/chat/completions",
            headers=headers,
            json=payload,

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The code base64-encodes the local image and sends it to Moonshot/Kimi's external API for processing, but there is no explicit user-facing consent, privacy notice, or data-handling disclosure in the code path. This is a real privacy/security weakness because food photos may contain sensitive incidental data such as faces, location clues, medical/dietary information, or metadata that users may not expect to leave the local environment.

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 215)May include surrounding context.

md
}
        
        response = requests.post(
            "https://api.moonshot.cn/v1/chat/completions",
            headers=headers,
            json=payload,
            timeout=30

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 · src/calorie_calculator.py (reported line 104)May include surrounding context.

python
}
        
        response = requests.post(
            "https://api.moonshot.cn/v1/chat/completions",
            headers=headers,
            json=payload,
            timeout=30

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This second provider path repeats the instruction to answer in Chinese, creating the same language-policy issue across providers. Users are not offered a locale selection or opt-in despite the skill enforcing a specific language.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
93% confidence
Finding

The OpenAI request is an external transmission of potentially sensitive user image data and therefore represents a real privacy/security concern. While external API use is expected for vision features, the absence of safeguards around notice, consent, and minimization makes this a valid issue rather than a false positive.

Content

Scanner excerpt · src/calorie_calculator.py (reported line 176)May include surrounding context.

python
"max_tokens": 500
        }
        
        response = requests.post(
            "https://api.openai.com/v1/chat/completions",
            headers=headers,
            json=payload,

External Transmission

Medium
Category
Data Exfiltration
Confidence
93% confidence
Finding

The OpenAI request is an external transmission of potentially sensitive user image data and therefore represents a real privacy/security concern. While external API use is expected for vision features, the absence of safeguards around notice, consent, and minimization makes this a valid issue rather than a false positive.

Content

Scanner excerpt · src/calorie_calculator.py (reported line 176)May include surrounding context.

python
"max_tokens": 500
        }
        
        response = requests.post(
            "https://api.openai.com/v1/chat/completions",
            headers=headers,
            json=payload,

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The OpenAI path transmits the full image contents to api.openai.com without any visible consent or warning mechanism. This is dangerous in context because users of a calorie calculator may assume simple local analysis, while uploaded meal images can expose private surroundings, health-related habits, or other personal data to a third party.

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 · src/calorie_calculator.py (reported line 177)May include surrounding context.

python
}
        
        response = requests.post(
            "https://api.openai.com/v1/chat/completions",
            headers=headers,
            json=payload,
            timeout=30

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The file consistently uses Chinese for the skill name, description, commands, and instructions, but does not indicate that the Chinese-only experience is intentional or provide an opt-in language choice. This can be a language-policy issue when a skill effectively forces a specific language without user selection.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The documentation introduces cron-based scheduled task management even though the stated purpose is on-demand food-photo calorie analysis. Unnecessary scheduling expands the operational surface area and could enable unattended execution, repeated network calls, or background processing that users did not expect.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The display name and slogan are entirely in Chinese, which signals a fixed language/locale presentation in the skill metadata. There is no indication in this file that users can opt into that language or that the skill is intentionally limited to a Chinese-speaking region, so this may violate a language/locale choice policy.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The config sets output.language: zh, which imposes a specific language/locale in the skill's behavior. Under the policy, forcing a language without user opt-in can be a natural-language policy violation, and this file does not indicate that users can choose their preferred language at runtime.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
95% confidence
Finding

The dependency is specified with a lower bound only, which allows future installs to resolve to different versions over time. This undermines reproducible builds and can unintentionally introduce vulnerable or incompatible releases, especially for a package like requests with a history of security advisories.

Content

Scanner excerpt · requirements.txt (reported line 2)May include surrounding context.

text
# Food Calorie Calculator Dependencies
requests>=2.28.0
pyyaml>=6.0
Pillow>=9.0.0

Unverifiable Dependency: requests has 16 known advisory(ies) (CVE-2014-1830 (Exposure of Sensitive Information to an Unauthorized Actor in Requests); CVE-2024-47081 (Requests vulnerable to .netrc credentials leak via malicious URLs); CVE-2024-35195 (Requests `Session` object does not verify requests after making first request wi) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
91% confidence
Finding

Because requests is not pinned, it is impossible to verify from this manifest whether deployments will use a version affected by known CVEs. In a skill that likely makes outbound API calls for vision recognition, an affected HTTP client could expose credentials or weaken transport security depending on runtime behavior.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
96% confidence
Finding

Using pyyaml>=6.0 leaves the actual installed version unconstrained above the minimum, so environments may pull different releases. Because PyYAML has had multiple security issues, lack of pinning increases supply-chain and patch-verification risk.

Content

Scanner excerpt · requirements.txt (reported line 3)May include surrounding context.

text
# Food Calorie Calculator Dependencies
requests>=2.28.0
pyyaml>=6.0
Pillow>=9.0.0