Back to skill

Security audit

Data Cleaner Skill

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent data-cleaning skill that writes cleaned CSV/Excel outputs, with ordinary data-alteration risks but no evidence of hidden, persistent, exfiltrating, or destructive behavior.

Install only if you are comfortable with a tool that can remove duplicate rows and alter missing values or date/phone formats in generated outputs. Use copies of important datasets, inspect the cleaned file before relying on it, avoid processing untrusted spreadsheets unless formula-injection protections are added, and note that the documented batch script is not present in the inspected artifact.

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/clean_data.py:24
Finding

Spreadsheet Formula Injection in Exported Files

Content
View full analysis

Vulnerability Details

File Location: scripts/clean_data.py, lines 24–31
Vulnerability Type: Spreadsheet formula injection
Risk Level: Medium

Vulnerable Code

python
def save_data(df, file_path):
    """保存数据"""
    path = Path(file_path)
    output = path.parent / f"{path.stem}_cleaned{path.suffix}"
    
    if path.suffix == '.csv':
        df.to_csv(output, index=False)
    else:
        df.to_excel(output, index=False)
    
    return output

Technical Analysis

The application exports values originating from potentially untrusted CSV or Excel files without neutralizing spreadsheet formula prefixes. Text beginning with characters such as =, +, -, or @ may be interpreted as a formula when the generated file is opened in spreadsheet software.

The cleaning operations do not establish a safe-text policy before DataFrame.to_csv() or DataFrame.to_excel() is called. Consequently, an attacker-controlled value can survive processing and enter the cleaned output as active spreadsheet content.

Attack Path

  1. An attacker creates an input CSV or Excel file containing a cell such as:
    text
    =HYPERLINK("https://attacker.example/collect","Open report")
    
  2. A victim processes that file with scripts/clean_data.py.
  3. The cleaning functions preserve the crafted cell because formula neutralization is not implemented.
  4. save_data() writes the value unchanged to the cleaned CSV or Excel file.
  5. The victim or another recipient opens the generated file in spreadsheet software.
  6. The spreadsheet application interprets the cell as a formula. Depending on the spreadsheet software, its version, security configuration, and user interaction, the formula may initiate an external request, display a deceptive link, disclose data through formula-driven requests, or invoke other spreadsheet-specific behavior.

Impact Assessment

Exploitation occurs in the s ...[truncated 591 chars]

Remediation
View remediation

Remediation Suggestions

Establish a safe export policy for all untrusted text cells before writing CSV or Excel output:

  1. Detect strings whose first non-whitespace character is =, +, -, or @.
  2. Neutralize those values by prefixing an apostrophe or otherwise forcing explicit text representation.
  3. Apply the protection consistently to both CSV and Excel exports.
  4. Consider tab, carriage-return, newline, and other leading-character bypasses when normalizing values.
  5. Preserve original data separately if exact raw values are required, and clearly distinguish raw exports from spreadsheet-safe exports.
  6. Add regression tests covering every dangerous prefix, leading whitespace, mixed data types, and both supported output formats.
  7. Document that generated files are sanitized for spreadsheet use and avoid offering an unsafe export mode by default.

Example defensive helper:

python
FORMULA_PREFIXES = ("=", "+", "-", "@")

def neutralize_formula(value):
    if isinstance(value, str) and value.lstrip().startswith(FORMULA_PREFIXES):
        return "'" + value
    return value

safe_df = df.map(neutralize_formula)

Export safe_df instead of the original data frame. The exact escaping method should be validated against every supported spreadsheet application and output format.

Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • 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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (6)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

This markdown file advertises automatic deduplication, deletion/filling of missing values, phone normalization, and batch processing, all of which can alter user data. The README provides usage examples and output behavior but does not include any caution that these operations may remove records or change files, which is a missing user warning for data-affecting behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill describes cleaning capabilities such as deduplication, missing-value handling, and batch processing, but does not warn that these actions can alter records, remove rows, or overwrite outputs. In this context, users may reasonably underestimate the destructive nature of the tool, increasing the chance of accidental data loss or corruption.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger phrases are generic enough to match ordinary user requests about cleaning or organizing data, which can cause the skill to activate unintentionally. In a file-processing skill, accidental activation is risky because it may lead to modification, deduplication, or deletion of user data without sufficiently explicit consent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This code file contains user-facing natural-language text only in Chinese, including the module description and later CLI help/output strings. Under the policy, forcing a specific language without offering user choice or documenting a justified locale constraint is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
71% confidence
Finding

Most user-facing instructional content is written in Chinese, and the file does not indicate that the tool is intended only for a Chinese-speaking or region-specific audience. Under the language/locale policy, forcing a specific language without user opt-in can be a natural-language policy concern.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
98% confidence
Finding

The argument help at L155 states that date-format repair is 'default enabled', implying the CLI option controls that behavior. However, the call at L159 passes only five arguments, so args.fix_date is ignored and clean_data uses its own default regardless of the parsed option. This is a documentation/intent mismatch in the command-line interface behavior.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.