Back to skill

Security audit

Home Reno Estimator

Security checks for vulnerabilities and agentic risk

Overview

The core estimator is understandable, but the package includes under-scoped shell execution, a vulnerable test helper, unrelated business-growth material, and a documented cron agent that do not fit cleanly with a simple renovation estimate skill.

Install only after reviewing the extra bundled business and marketing documents. For safer use, keep the skill to explicit estimation requests, do not let it auto-run background update jobs, avoid public-comment collection of home details, and fix or remove the shell=True test helper before running tests with any external input.

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

Warning
Location
scripts/test_estimate.py:14
Finding

Shell Command Injection in Test Command Helper

Content
View full analysis

Vulnerability Details

File Location: scripts/test_estimate.py, lines 14–17
Vulnerability Type: OS command injection through unsafe shell invocation
Risk Level: Medium

Vulnerable Code

python
def run_cmd(args):
    """运行估算命令"""
    cmd = f"python3 estimate.py {' '.join(str(a) for a in args)}"
    result = subprocess.run(cmd, shell=True, capture_output=True, text=True)
    return result

Technical Analysis

The run_cmd function converts argument values to strings, joins them into one command, and executes that command through a shell using shell=True. The arguments are neither escaped nor validated before interpolation.

Consequently, shell metacharacters in any argument—such as ;, &&, |, command substitutions, or redirections—are interpreted by the shell rather than passed literally to estimate.py. This creates an arbitrary command-execution primitive.

The bundled test cases are currently hard-coded, so the default test run does not directly expose attacker-controlled input. Exploitation becomes possible if this helper is imported, reused, or modified to accept arguments from users, files, environment variables, CI parameters, or other untrusted sources.

Attack Path

  1. An attacker gains influence over an argument passed to run_cmd.

  2. The attacker supplies a value containing a shell control operator, for example:

    python
    run_cmd(["100", "精装", "北京; id > /tmp/injection-proof"])
    
  3. The function constructs a command equivalent to:

    bash
    python3 estimate.py 100 精装 北京; id > /tmp/injection-proof
    
  4. Because shell=True is enabled, the shell treats the semicolon as a command separator.

  5. The injected command executes with the same operating-system privileges as the Python test process.

Impact Assessment

Successful exploitation permits arbitrary local command execution under the account running the tests. Depending on that account’s permissions, an attacker could:

  • Read or al ...[truncated 445 chars]
Remediation
View remediation

Remediation Suggestions

Avoid constructing a shell command from concatenated arguments. Pass the executable and each argument as separate list elements, and keep shell processing disabled:

python
def run_cmd(args):
    """Run the estimator without invoking a shell."""
    cmd = ["python3", "estimate.py", *map(str, args)]
    return subprocess.run(
        cmd,
        shell=False,
        capture_output=True,
        text=True,
        check=False,
    )

Additional hardening measures:

  1. Validate argument count and expected types before invocation.
  2. Restrict the grade argument to the supported allowlist.
  3. Validate the area as a finite numeric value within the documented range.
  4. Validate or normalize city input according to application requirements.
  5. Resolve estimate.py relative to __file__ rather than relying on process working-directory state.
  6. Add a regression test containing shell metacharacters and verify that they are passed literally and do not create files or execute secondary commands.
  7. If future CI parameters or external test fixtures are supported, treat all such values as untrusted input.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (62)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

If the actual behavior is maintaining reference price data and writing markdown reports rather than processing user area, grade, and city into an estimate, then the skill is misrepresented. Misrepresentation is dangerous because it can cause the agent to execute local file writes and maintenance workflows in a user-facing context where such capabilities are unexpected and unnecessary.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

If the actual behavior is maintaining reference price data and writing markdown reports rather than processing user area, grade, and city into an estimate, then the skill is misrepresented. Misrepresentation is dangerous because it can cause the agent to execute local file writes and maintenance workflows in a user-facing context where such capabilities are unexpected and unnecessary.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The file content is unrelated to the declared skill purpose of generating home renovation cost estimates and instead contains a growth-marketing playbook. This creates a scope-integrity problem: if surfaced to the agent at runtime, it can steer behavior toward promotion, upselling, and user-acquisition tactics rather than producing neutral estimation reports, causing misalignment, deceptive outputs, or unauthorized business-logic changes.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

This file is materially unrelated to the declared skill purpose of generating home renovation cost estimates. Such scope drift is dangerous because reference content can steer the agent toward marketplace monetization advice instead of fulfilling the user’s budgeting request, causing prompt contamination, unpredictable behavior, or disclosure of irrelevant business guidance. In this skill context, the mismatch is more concerning because the skill is supposed to provide structured estimation reports, not strategic platform recommendations.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

This file is materially misaligned with the declared skill purpose of home renovation cost estimation. Instead of estimator logic, assumptions, or data sources, it provides marketplace strategy, monetization guidance, and expansion plans, which can cause the agent to respond outside scope and produce unauthorized business-advice behavior. In skill-based systems, this kind of scope drift increases prompt-surface area and can steer outputs away from user intent and governance boundaries.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

This file is materially unrelated to the declared skill purpose of estimating home-renovation costs. Instead, it contains a marketplace revenue and go-to-market playbook, which can cause the agent to retrieve and present irrelevant business-strategy content to users, undermining integrity of outputs and potentially steering the skill toward self-promotion or monetization behavior outside its intended scope.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The referenced file is entirely unrelated to the skill’s stated purpose of home renovation cost estimation and instead contains AI startup subsidy policy material. In a RAG-style skill, this creates a strong risk of context poisoning: the model may surface irrelevant policy, business, or application guidance in response to renovation budget queries, degrading integrity and potentially steering users into unintended domains.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
99% confidence
Finding

This is a direct instance of tool parameter abuse: externally influenced parameters are embedded into a shell command and executed. Because the script is a test harness likely to be run by developers or CI, exploitation could lead to arbitrary command execution, credential exposure, or CI runner compromise.

Content

Scanner excerpt · scripts/test_estimate.py (reported line 17)May include surrounding context.

python
def run_cmd(args):
    """运行估算命令"""
    cmd = f"python3 estimate.py {' '.join(str(a) for a in args)}"
    result = subprocess.run(cmd, shell=True, capture_output=True, text=True)
    return result

def test_case(args, expected_keys=None):

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

This markdown file is written entirely in Chinese, including the title and all user-facing descriptions, with no indication that the skill supports other languages or that Chinese is a required regional constraint. Under the language/locale policy rule, forcing a specific language without opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The plan prescribes a specific Chinese-platform persona and provides fixed Chinese profile text such as the nickname and bio, which imposes a language/locale choice in natural-language instructions. The file does not indicate that this language choice is optional or limited to a justified region-specific deployment.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file contains detailed platform publishing, social-media growth, lead generation, and monetization instructions that are unrelated to the stated core function of a home renovation cost estimator. This expands the skill's operational scope into user acquisition and payment collection, increasing the chance the skill is used as a business-playbook wrapper rather than a narrowly scoped estimation tool, which can mislead deployers and bypass review expectations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

These instructions explicitly describe collecting user-provided housing details and returning paid reports, but provide no privacy notice, consent flow, retention limits, or handling rules for personal data exchanged in comments or direct messages. In practice, location and property details can be sensitive, and the paid-report workflow encourages off-platform data collection without safeguards.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown file contains user-facing instructions exclusively in Chinese, including the title, setup guidance, monetization steps, and FAQ. Under the policy rule, forcing a specific language without user opt-in is a natural-language locale violation unless the regional constraint is explicitly documented and justified.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The README shows a very broad natural-language activation example ('帮我估算一下装修费用...') without any explicit constraints, confirmation step, or namespaced invocation. In agent environments, broad triggers can cause unintended skill activation on loosely related user messages, leading to surprise tool use, incorrect budgeting output, or context hijacking when the user did not clearly intend to invoke this specific estimator.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
76% confidence
Finding

The skill explicitly instructs use of a shell command (python scripts/estimate.py ...) and references local files, but it declares no permissions or allowed-tools scope. That creates an authorization gap: an agent may invoke shell or file operations more broadly than intended, making misuse or accidental expansion of capability harder to constrain and audit.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The trigger section includes generic phrases like "帮我估算装修成本" and broad topic mentions such as "住宅装修"、"家装预算"、"装修报价", which could match ordinary discussion rather than a clear request to invoke the skill. The description does not provide negative examples or tighter activation constraints to distinguish when the skill should or should not activate.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The file title and all operational content are written in Chinese, indicating the skill documentation is localized to a single language. Under the policy, forcing a specific language without user opt-in is a natural-language policy concern unless the locale restriction is clearly documented and justified, which is not present here.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The file explicitly documents a cron-based agent that 'auto-wakes' every 15 minutes and continuously updates the project, which indicates autonomous background activity beyond a simple home-renovation estimator. In skill ecosystems, hidden or unnecessary autonomy expands operational scope, can trigger unauthorized actions or updates, and increases the chance the packaged skill behaves differently from its stated purpose.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This markdown file presents all user-facing case studies and suggested customer-service phrasing exclusively in Chinese. Under the policy, forcing a specific language without user opt-in 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.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The case study claims the tool can核查/对比报价单并发现漏项和重复计价, which exceeds the declared capability of estimating renovation cost from area, grade, and city. This creates a security/integrity gap between documented functionality and actual promised behavior, encouraging users to rely on unsupported analysis that may mishandle documents, produce false assurances, or prompt downstream unsafe data collection.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The customer-service script tells users they can send a报价单 for comparison, but the declared skill only accepts house area, renovation grade, and city to generate an estimate. This can mislead users into submitting extra documents or sensitive commercial/personal data to a workflow not described or prepared to handle them, increasing the risk of overcollection and unreliable outputs.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The CTA asks users to post home-renovation details such as area, city, and renovation tier in public comments, but does not warn that comments are public or advise users to avoid sharing identifiable details. In this context, project details can reveal location, housing status, and spending capacity, creating unnecessary privacy exposure and making users easier targets for profiling, spam, or scams.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

SQP-3 applies to all file types and covers language/locale policy violations. This markdown file presents all user personas, stories, and feedback prompts only in Chinese, with no indication that users can opt into another language or that the skill is intentionally region-specific.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The post explicitly encourages users to share area, city, and renovation tier in a public comment section to receive an estimate, but provides no privacy warning or safer submission channel. While these fields may seem low sensitivity individually, combined they can reveal approximate residence characteristics and location context, enabling profiling, targeted scams, or unwanted solicitation in a home-renovation context.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The document explicitly advises changing the product from a personal renovation estimator to an enterprise automation workflow, which conflicts with the declared user-facing function. This is risky because instruction-like business strategy inside the reference set can bias the agent to reframe user requests, upsell enterprise use cases, or generate outputs outside authorized scope. The skill context increases the concern because users expect neutral cost estimates, not product pivot recommendations.

Content

No source excerpt is available for this finding.