Back to skill

Security audit

WiseDiag-Calories

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it claims: it sends user-chosen food images to WiseDiag for calorie analysis and saves a local report, with privacy and hardening caveats.

Install only if you are comfortable sending selected food photos, image URLs, questions, and related metadata to WiseDiag's cloud service. Use a temporary environment variable or a credential manager for the API key when possible, avoid uploading private images, and prefer simple filename stems until the output-name validation is tightened.

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 (2)

T08 · Insecure Dependencies

Note
Location
requirements.txt:1
Finding

Unpinned Third-Party Dependency Permits Unreviewed Future Releases

Content
View full analysis
=2.28.0 ``` The documented installation process in `README.md:17-19` and `SKILL.md:49-51` installs this dependency directly: ```bash pip install -r requirements.txt ``` ### Technical Analysis The dependency specification uses an open-ended minimum-version constraint. Consequently, any future `requests` version satisfying `>=2.28.0` may be installed without being reviewed against this project. The project provides neither a lockfile nor package integrity hashes. Installation is therefore not reproducible and depends on the packages available from the configured Python package index at installation time. Although no currently malicious dependency was identified, this configuration expands the software supply-chain attack surface. ### Attack Path 1. An attacker compromises the package distribution account, package index, or another component in the dependency distribution chain. 2. A malicious or compromised future release remains compatible with the unrestricted `>=2.28.0` constraint. 3. A user follows the documented `pip install -r requirements.txt` command. 4. The package manager downloads and installs the unreviewed release. 5. Malicious installation or runtime code executes with the privileges of the user or environment performing the installation. ### Impact Assessment Successful exploitation could execute arbitrary code in the Python installation environment. The resulting privileges would be those of the user running `pip`, potentially including access to project files, user data, environment variables, and credentials such as `WISEDIAG_API_KEY`. The scope depends on the installation context. A virtual environment limits package-level modification to that environment, while installation under a privileged account could have broade ...[truncated 22 chars]
Remediation
View remediation
``` 2. Generate a reproducible lockfile that includes all transitive dependencies. 3. Require cryptographic hashes during installation: ```bash pip install --require-hashes -r requirements.txt ``` 4. Use a dependency-management process such as `pip-tools` to generate and regularly update pinned dependencies. 5. Run vulnerability and provenance checks in CI before accepting dependency upgrades. 6. Perform installation in an isolated virtual environment under a non-privileged account. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
scripts/calories.py:261
Finding

Path Traversal Through Unvalidated Output Filename

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Rogue AgentSelf-Modification, Session Persistence
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (8)

Tainted flow: 'headers' from os.environ.get (line 112, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/calories.py (reported line 151)May include surrounding context.

python
request_part = ("request", (None, json.dumps(request_data, ensure_ascii=False), "application/json"))

        try:
            resp = requests.post(
                url,
                headers=headers,
                files=[request_part] + files_list,

Tainted flow: 'headers' from os.environ.get (line 112, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/calories.py (reported line 187)May include surrounding context.

python
def _stream_response(url, headers, payload, files_arg, image_sources, question, output_dir, name) -> bool:
    """Send JSON request and parse SSE stream."""
    try:
        with requests.post(
            url, headers=headers, json=payload,
            stream=True, timeout=REQUEST_TIMEOUT,
        ) as resp:

Session Persistence

Medium
Category
Rogue Agent
Confidence
90% 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 · README.md (reported line 30)May include surrounding context.

Temporary (current terminal session)

export WISEDIAG_API_KEY=your_api_key_here

Permanent (add to ~/.zshrc or ~/.bashrc)

echo 'export WISEDIAG_API_KEY=your_api_key_here' >> ~/.zshrc source ~/.zshrc

text

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill advertises capabilities that include reading environment variables, writing files, and making network requests, but it does not declare any explicit tool scope or permissions boundary. That creates a least-privilege and transparency problem: an agent or reviewer cannot easily constrain what the skill may access, while the skill also handles sensitive inputs such as API keys and user-supplied local files that are transmitted to a remote service.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The request payload hard-codes "language": "zh", which can force Chinese-language processing/output regardless of user preference. This is not a classic security flaw, but in an agent skill it can degrade transparency and informed use by causing unexpected output language, especially for safety-relevant calorie or dietary guidance.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
93% confidence
Finding

The skill transmits user-supplied image URLs and prompts to an external third-party service, and in file mode it also uploads local image contents. In this skill context that behavior is core functionality, but it still creates a real privacy/data-exposure risk because potentially sensitive meal, health, or metadata-bearing images leave the local environment.

Content

Scanner excerpt · scripts/calories.py (reported line 187)May include surrounding context.

python
def _stream_response(url, headers, payload, files_arg, image_sources, question, output_dir, name) -> bool:
    """Send JSON request and parse SSE stream."""
    try:
        with requests.post(
            url, headers=headers, json=payload,
            stream=True, timeout=REQUEST_TIMEOUT,
        ) as resp:

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
95% confidence
Finding

The dependency is specified as requests>=2.28.0, which allows any newer version to be installed and makes builds non-reproducible. This can unintentionally pull in a vulnerable or breaking release later, and in this skill context the package is likely used for fetching remote image URLs, increasing exposure to network-facing dependency risk.

Content

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

text
requests>=2.28.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
90% confidence
Finding

Because requests is not pinned, it is impossible to verify whether deployment will use a version affected by known advisories. In a skill that may retrieve user-supplied image URLs, unresolved requests security issues can be more relevant because attacker-controlled URLs may exercise URL parsing, redirect, authentication, or TLS-related edge cases.

Content

No source excerpt is available for this finding.