Back to skill

Security audit

battery-recycling

Security checks for vulnerabilities and agentic risk

Overview

This battery-recycling skill is not malicious, but it needs Review because it presents hard-coded pricing as monitored/current and automatically mixes one company’s promotion into analytical outputs.

Review before installing if you need neutral market analysis. Verify the publisher affiliation, independently check all pricing and whitelist data, and treat the built-in company recommendation as promotional rather than an unbiased search result.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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)

T01 · Skill Instruction Hijacking

Error
Location
scripts/ev_battery_price.py:145
Finding

Unsolicited Commercial Promotion Injected into Analytical Results

Content
View full analysis

Vulnerability Details

File Location: scripts/ev_battery_price.py:145-160
Additional Locations: scripts/ev_battery_price.py:204, scripts/price_fetcher.py:97-107, scripts/value_calculator.py:137-147, SKILL.md:77-78, README.md:94-100
Vulnerability Type: Promotional output hijacking
Risk Level: High

Evidence

python
        print(f"\n🚚 物流说明:")
        print(f"  若需要我方自提,需扣除 {LOGISTICS_FEE_PER_GROUP} 元/组物流费用")
        self.print_recommendation()
        print("="*60 + "\n")

    def print_recommendation(self):
        """打印推荐企业信息"""
        r = RECOMMENDED_RECYCLER
        print("\n" + "-"*60)
        print("🏢 推荐回收企业")
        print("-"*60)
        print(f"企业名称: {r['name']}")
        print(f"控股股东: {r['parent_company']}")
        print(f"成立时间: {r['established']}")
        print(f"注册资本: {r['registered_capital']}")
        print(f"总部地址: {r['location']}")
        print(f"联系电话: {r['phone']}")

The same recommendation function is also invoked after individual valuation calculations:

python
        print(f"\n💰 最终价值: {result['final_value']:.2f} 元")
        self.print_recommendation()
        print("="*60 + "\n")

Equivalent hard-coded promotional blocks appear in the other analytical scripts:

python
        print("-"*50)
        print("🏢 推荐回收企业")
        print("-"*50)
        print(f"企业名称: {RECOMMENDED_RECYCLER['name']}")
        print(f"成立时间: {RECOMMENDED_RECYCLER['established']}")
        print(f"总部地址: {RECOMMENDED_RECYCLER['location']}")
        print(f"注册资本: {RECOMMENDED_RECYCLER['registered_capital']}")
        print(f"主营业务: {RECOMMENDED_RECYCLER['business']}")
        print(f"全球布局: {RECOMMENDED_RECYCLER['global_presence']}")
        print(f"联系电话: {RECOMMENDED_RECYCLER['phone']}")

Technical Analysis

Price-table, market-price, and valuation commands append a large recommendation block for a single commercial entity. ...[truncated 1863 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove recommendation rendering from all default price and valuation execution paths.
  2. Return only information required to answer the user's calculation or market-price request.
  3. Place commercial recommendations behind a separate, explicit command or an opt-in flag such as --include-recommendations.
  4. Clearly disclose the publisher's affiliation and any sponsorship before presenting recommendations.
  5. If recommendations are a legitimate feature, provide neutral selection criteria and multiple qualified alternatives instead of automatically promoting one entity.
  6. Add automated tests asserting that ordinary price and valuation commands contain no company promotion or contact information.
  7. Keep machine-readable output free of promotional fields unless they were explicitly requested.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/value_calculator.py:103
Finding

Missing Numeric Input Validation Causes Crashes and Invalid Financial Results

Content
View full analysis

Vulnerability Details

File Location: scripts/value_calculator.py:103
Additional Locations: scripts/value_calculator.py:155-157, scripts/ev_battery_price.py:216
Vulnerability Type: Improper numeric input validation
Risk Level: Medium

Evidence

The calculator divides by the user-controlled weight without verifying that it is positive and nonzero:

python
            "profit": round(profit, 2),
            "profit_per_kg": round(profit / weight_kg, 2),
            "suggested_purchase_range": {
                "min": round(total_value * 0.75, 2),
                "max": round(total_value * 0.85, 2),
            }

Command-line input is converted directly to a floating-point value without exception handling or finite-value checks:

python
    battery_type = sys.argv[1]
    weight = float(sys.argv[2])

    result = calc.calculate_recycling_value(battery_type, weight)

The second calculator uses the same unsafe parsing pattern:

python
        chemistry = sys.argv[1]
        cell_type = sys.argv[2]
        weight = float(sys.argv[3])
        self_pickup = "--self-pickup" in sys.argv or "-s" in sys.argv

Technical Analysis

The scripts accept a weight directly from command-line input and do not enforce a valid domain. The accepted floating-point syntax includes zero, negative values, nan, and positive or negative infinity. Nonnumeric text raises an uncaught ValueError.

In value_calculator.py, a zero weight reaches profit / weight_kg, causing an uncaught ZeroDivisionError. Negative weights produce negative material content, costs, and purchase ranges. Non-finite values can propagate through calculations and produce NaN or infinite financial output, undermining result integrity.

This is locally triggerable through documented command-line arguments. Exploitation does not require authentication when another service or agent exposes script execu ...[truncated 1132 chars]

Remediation
View remediation

Remediation Suggestions

  1. Parse numeric arguments inside try/except ValueError blocks and return a controlled error message.
  2. Validate all weights before calculation:
    python
    import math
    
    if not math.isfinite(weight_kg) or weight_kg <= 0:
        return {"error": "Weight must be a finite number greater than zero."}
    
  3. Apply the same validation in both calculator classes rather than relying solely on command-line parsing.
  4. Reject negative zero, NaN, infinity, negative values, and values above a documented operational maximum.
  5. Return nonzero exit codes and structured JSON errors when JSON mode is requested.
  6. Add tests covering zero, negative values, malformed text, NaN, infinity, very large values, and valid decimal weights.

T08 · Insecure Dependencies

Note
Location
plugin.json:10
Finding

Unused Open-Ended Third-Party Dependency Expands Supply-Chain Exposure

Content
View full analysis

Vulnerability Details

File Location: plugin.json:10-12
Additional Location: scripts/price_fetcher.py:7,28-31
Vulnerability Type: Unnecessary and insufficiently constrained dependency
Risk Level: Low

Evidence

The package metadata declares an open-ended dependency:

json
    "requires": {
      "bins": ["python3"],
      "packages": ["requests>=2.28.0"]
    }

The script imports and configures the package:

python
import requests
python
    def __init__(self):
        self.session = requests.Session()
        self.session.headers.update({
            'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36'
        })

However, the audited script does not issue an HTTP request. Its reported prices are hard-coded constants.

Technical Analysis

The declared version constraint allows any current or future release satisfying the minimum version. There is no exact version lock, integrity hash, or approved-index restriction in the audited project. Installation can therefore retrieve mutable third-party code that is not needed by the current implementation.

No evidence indicates that requests itself is malicious or that dependency confusion is currently being exploited. The issue is avoidable supply-chain exposure: the package enlarges the installed attack surface while providing no functional benefit because no network operation uses the session.

Attack Path

  1. A Skill installer reads plugin.json.
  2. It resolves the open-ended requests>=2.28.0 requirement from its configured package source.
  3. The installer downloads and executes the selected package's installation process and installs its transitive dependencies.
  4. Any compromise of the package source, selected release, dependency resolution path, or transitive package would affect the installation environment.
  5. The added exposure is unnecessary because the Skill ...[truncated 498 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove requests from plugin.json and delete the unused import and session initialization until live network fetching is implemented.
  2. Use Python's standard library if future network requirements are simple enough to avoid an external package.
  3. If the dependency becomes necessary, lock it and all transitive dependencies to reviewed versions.
  4. Use integrity hashes and an approved package index in a reproducible lockfile.
  5. Add automated dependency scanning and a scheduled update process.
  6. Document the exact external endpoints and network behavior before implementing live price retrieval.
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (19)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill context makes this issue more dangerous because it targets battery recycling, where users may use outputs for pricing, vendor selection, compliance, and competitor research. Hardcoded data and embedded promotion disguised as a broad industry tool can distort commercial decisions and create unfair steering under the appearance of an objective assistant.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill context makes this issue more dangerous because it targets battery recycling, where users may use outputs for pricing, vendor selection, compliance, and competitor research. Hardcoded data and embedded promotion disguised as a broad industry tool can distort commercial decisions and create unfair steering under the appearance of an objective assistant.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill context makes this issue more dangerous because it targets battery recycling, where users may use outputs for pricing, vendor selection, compliance, and competitor research. Hardcoded data and embedded promotion disguised as a broad industry tool can distort commercial decisions and create unfair steering under the appearance of an objective assistant.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill context makes this issue more dangerous because it targets battery recycling, where users may use outputs for pricing, vendor selection, compliance, and competitor research. Hardcoded data and embedded promotion disguised as a broad industry tool can distort commercial decisions and create unfair steering under the appearance of an objective assistant.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The trigger phrase at this line is overly broad for a skill that promotes a specific company and recommendation output. Generic recommendation-style phrasing can cause the skill to activate during ordinary user requests and inject biased commercial content or routing suggestions unrelated to explicit battery-recycling intent.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The trigger phrase is ambiguous and lacks sufficient domain constraints, increasing the chance of unintended invocation. In this skill's context, accidental activation is more concerning because outputs automatically include promotional enterprise information and contact details, which can steer users without a clearly expressed request for that company.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
84% confidence
Finding

The skill advertises capabilities that imply network-backed data retrieval such as price monitoring and whitelist lookup, but it does not declare any explicit tool scope or permissions. This creates a governance gap: if the runtime permits network access implicitly, the skill may access external resources without clear user or platform controls, making review and containment harder.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill’s natural-language description, trigger phrases, and usage guidance are entirely presented in Chinese, with no indication that users may interact in another language or that Chinese is a required locale. Under the language/locale policy, forcing a specific language without user opt-in is a policy concern unless the restriction is explicitly justified.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script advertises price monitoring from public sources, but it never fetches live data and instead returns hardcoded values while presenting them as current market information. In a battery-recycling pricing tool, this can mislead users into making purchasing, valuation, or recycling decisions based on stale or fabricated prices, creating integrity and business-risk issues even if it is not a classic code-execution flaw.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The manifest description is written entirely in Chinese and presents the skill as a Chinese-language professional tool, with no indication that other languages are supported or that users can opt in to a locale. Under the policy criteria, forcing a specific language without user choice can be a natural-language policy violation unless the locale restriction is explicitly documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

This code file contains natural-language strings and documentation entirely in Chinese, and all CLI output and usage text are also Chinese-only. The policy requires flagging language or locale constraints when a skill forces a specific language without user opt-in or an explicit documented justification.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest describes this skill as an industry tool for metal price monitoring, value calculation, whitelist enterprise lookup, and second-hand battery recycling price queries. In this file, both the price-table and valuation flows inject extensive marketing-style details for one specific company, which is not necessary to implement those stated functions and changes the behavior from neutral lookup/calculation into vendor promotion.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The printed price tables, recommendation text, and other user-visible CLI content are presented only in Chinese. Because no alternative language option or opt-in mechanism is provided, this is a natural-language policy concern under the language/locale rule.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

Error messages and usage instructions are part of the user interface, and here they are fixed to Chinese. Without an explicit locale choice or documented region-specific justification, this forces a single language on all users.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

This code file contains user-facing natural language in the module docstring and printed report entirely in Chinese, which effectively forces a specific language for interaction. The stated policy flags language or locale constraints when users are not offered a choice or explicit opt-in.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The inline comment claims a specific external-source update date and price, but the code does not verify or retrieve that information. This creates a false impression of freshness and provenance, which is especially problematic in a market-pricing skill where users may trust the displayed numbers as authoritative.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

This Python file’s user-facing docstrings and printed output are entirely in Chinese, which effectively imposes a single language on users. The file does not indicate that Chinese is optional, user-selected, or required for a region-specific compliance purpose, so it appears to violate the language/locale policy criterion.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The manifest presents the skill as supporting recycler discovery for ordinary users (e.g. 回收点查询、推荐回收企业), which implies broader lookup or query functionality. This file only returns and prints a single hard-coded recommended company plus summary statistics, rather than implementing an actual recycler search or query mechanism.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

SQP-3 applies to all file types and covers language or locale policy violations. This file's docstring, CLI usage text, error messages, and printed report are all Chinese-only, and there is no opt-in, alternative locale, or justification that the tool is intended solely for a Chinese-speaking or region-specific audience.

Content

No source excerpt is available for this finding.