Back to skill

Security audit

research-matrix-builder

Security checks for vulnerabilities and agentic risk

Overview

This is a local literature-matrix helper with no hidden networking or persistence, though its CSV output should be treated carefully in spreadsheets.

Install only if you are comfortable with a local helper that reads a JSON file you provide and writes a CSV. Before opening generated CSV files in Excel or similar spreadsheet tools, sanitize or review cells that begin with =, +, -, or @ to avoid formula interpretation.

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/build_matrix.py:14
Finding

CSV Formula Injection in Generated Literature Matrices

Content
View full analysis

Vulnerability Details

File Location: scripts/build_matrix.py, lines 14–15
Vulnerability Type: CSV formula injection
Risk Level: Medium

Vulnerable Code

python
for row in rows:
    w.writerow({k: row.get(k, "") for k in fields})

Technical Analysis

The script reads paper records from a caller-selected JSON file and writes each field directly into a CSV file without neutralizing spreadsheet formula syntax.

Python's csv.DictWriter correctly quotes and escapes CSV structure, but CSV quoting does not prevent spreadsheet applications from interpreting cell values as formulas. An attacker-controlled value whose first significant character is =, +, -, or @ may be evaluated when the resulting file is opened in software such as Microsoft Excel or LibreOffice Calc.

For example, a record could contain:

json
{
  "citation": "=HYPERLINK(\"https://attacker.example\",\"Open source\")",
  "problem": "Example research problem"
}

The formula would be preserved in the generated CSV rather than treated strictly as inert text.

Attack Path

  1. An attacker supplies or influences a JSON literature record processed by the Skill.
  2. The attacker places spreadsheet formula syntax in any supported field, such as citation, problem, method, data, metric, key_result, limitation, or gap.
  3. The script loads the record and writes the malicious value unchanged to the output CSV.
  4. A victim opens the generated literature matrix in a spreadsheet application.
  5. The application interprets the value as a formula.
  6. Depending on the formula, spreadsheet application, configuration, and user interaction, the attacker may present deceptive links, trigger external-resource requests, or attempt application-specific data disclosure.

Impact Assessment

The script itself does not grant command execution, elevated privileges, or additional filesystem permissions. The impact occurs in the security context of the user who opens t ...[truncated 606 chars]

Remediation
View remediation

Remediation Suggestions

Treat all values written to CSV as untrusted spreadsheet input.

  1. Convert values to strings and inspect the first non-whitespace character.
  2. Neutralize values beginning with =, +, -, or @, commonly by prefixing an apostrophe.
  3. Apply sanitization to every user-controlled field.
  4. Document that the output is intended to contain text rather than formulas.
  5. Add regression tests covering formula-prefixed values, leading whitespace, tabs, newlines, and non-string JSON values.

Example hardening:

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

def sanitize_csv_cell(value):
    if value is None:
        return ""

    value = str(value)
    if value.lstrip().startswith(DANGEROUS_PREFIXES):
        return "'" + value

    return value

for row in rows:
    w.writerow({
        key: sanitize_csv_cell(row.get(key, ""))
        for key in fields
    })

If preserving exact source text is required, consider generating a format with explicit text cell types, such as an XLSX workbook created with cells configured as strings, while still validating formula-like values.

Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • 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 (5)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This markdown file contains user-facing instructions and invocation examples partly in Chinese, including section headings and several trigger phrases, but does not state that the skill is Chinese-specific or provide an opt-in language choice. That creates a natural-language policy concern because the skill presentation implicitly favors a specific language/locale without justification.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill includes Chinese-only trigger phrases alongside English ones, and later repeats Chinese suggested prompts, but nowhere states that language is optional or user-selectable. Under the language/locale policy, a skill should not impose or assume a specific language without explicit user opt-in or a documented justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

The file presents the skill as a Chinese example while embedding English trigger phrases and English output artifact names such as 'literature matrix CSV' and 'gap summary'. This can create an implicit language/locale expectation without explicitly offering the user a choice of response language or output locale.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

This markdown file uses Chinese for the skill’s objective, checks, manual verification, and pass criteria. Under the policy, forcing a specific language without user opt-in can be a natural-language policy violation, and this file does not indicate that the language is optional or required for a region-specific purpose.

Content

No source excerpt is available for this finding.