Back to skill

Security audit

Operation Tracer

Security checks for vulnerabilities and agentic risk

Overview

This skill is a local SQLite tracing utility whose sensitive logging behavior is mostly disclosed and purpose-aligned, but users should treat its trace database and exports as potentially sensitive.

Install only if you are comfortable with local trace records containing tool parameters, file paths, prompts, results, and errors. Avoid tracing secrets, protect or delete traces/agent_traces.db when needed, and be careful sharing JSON/CSV exports because they may contain sensitive operational data.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/tracer.py:52
Finding

Unredacted Operation Metadata and Results Persisted in Plaintext

Content
View full analysis
str: """开始追踪一个操作 Args: name: 操作名称 op_type: 操作类型(tool_call / llm_call / error / compression) metadata: 附加元数据 Returns: span_id: 追踪跨度ID """ span_id = str(uuid.uuid4())[:8] span = Span( id=span_id, name=name, start_time=time.time(), metadata=metadata or {}, ) span.metadata["operation_type"] = op_type self._active_spans[span_id] = span return span_id ``` ```python def end_span(self, span_id: str, result: Any = None, status: str = "success"): """结束追踪 Args: span_id: 追踪跨度ID result: 操作结果 status: 状态(success / error) """ if span_id not in self._active_spans: return span = self._active_spans[span_id] span.end_time = time.time() span.duration_ms = (span.end_time - span.start_time) * 1000 span.result = str(result) if result is not None else None span.status = status # 持久化到 SQLite self._save_span(span) # 从活跃列表移除 self._active_spans.pop(span_id, None) ``` ```python def _save_span(self, span: Span): """保存 span 到数据库""" conn = sqlite3.connect(self.db_path) conn.execute( """INSERT OR REPLACE INTO traces (id, timestamp, operation_type, operation_name, duration_ms, metadata, result, status) VALUES (?, ?, ?, ?, ?, ?, ?, ?)""", ( span.id, span.start_time, span.metadata.get("operation_type", "unknown"), span.name, span.duration_ms, json.dumps(span.metadata, ensure_ascii=False), span.result, span.status, ...[truncated 2266 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
scripts/analyzer.py:139
Finding

Improper CSV Escaping and Spreadsheet Formula Injection

Content
View full analysis
str: """导出追踪数据 Args: format: "json" 或 "csv" Returns: 导出的数据字符串 """ conn = sqlite3.connect(self.db_path) conn.row_factory = sqlite3.Row cursor = conn.execute(""" SELECT id, timestamp, operation_type, operation_name, duration_ms, metadata, result, status FROM traces ORDER BY timestamp """) rows = [dict(row) for row in cursor.fetchall()] conn.close() if format == "json": return json.dumps(rows, ensure_ascii=False, indent=2) elif format == "csv": if not rows: return "" headers = list(rows[0].keys()) lines = [",".join(headers)] for row in rows: lines.append(",".join(str(row.get(h, "")) for h in headers)) return "\n".join(lines) else: raise ValueError(f"Unsupported format: {format}") ``` ### Technical Analysis The CSV export implementation concatenates fields with commas instead of using a standards-compliant CSV serializer. Values containing commas, quotation marks, carriage returns, or line feeds are not escaped or quoted, allowing one stored value to alter columns or create additional records. The exported `result` and `operation_name` fields can be influenced by traced operations. If a field begins with a spreadsheet formula marker such as `=`, `+`, `-`, or `@`, spreadsheet applications may interpret it as a formula rather than text when an analyst opens the exported file. CSV quoting alone fixes record structure but does not reliably prevent formula interpretation. Spreadsheet-targeted exports therefore also require formula neutralization or an export format that preserves explicit data types. ### Attack Path 1. An attacker influence ...[truncated 1180 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (9)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description emphasizes a tracing system whose purpose is to record operational events into SQLite. This code chunk does not perform recording/instrumentation of tool calls, LLM calls, errors, or compression operations. Instead, its primary function is post hoc analysis and maintenance of an existing traces table: generating statistics, retrieving slow/error operations, exporting stored traces, and cleaning up old entries. While these behaviors are related to trace data and post-analysis, they are materially different from the stated core behavior of recording all calls. Therefore the description does not accurately represent this code chunk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill advertises comprehensive tracing of tool calls, LLM calls, errors, and compression events with SQLite persistence, but does not clearly warn that this can capture and retain sensitive metadata such as file paths, prompts, arguments, results, and timing data. In an agent environment, such telemetry can accumulate secrets or operationally sensitive information and make later compromise, misuse, or over-collection more likely.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The export function returns complete trace records including metadata and result fields, which commonly contain tool inputs/outputs, prompts, error details, or other sensitive operational data. In a tracing system, bulk export without redaction, access control, or even an explicit sensitivity warning materially increases the risk of accidental disclosure or exfiltration of secrets and internal data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The cleanup method deletes database records with a DELETE statement and commits the change, making the operation destructive and not easily reversible. The docstring describes retention days but does not warn that old trace data will be permanently removed.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

This code file contains user-facing natural-language documentation and comments entirely in Chinese, including the module docstring and method/class descriptions, without offering any language choice or documenting a justified locale constraint. The policy explicitly flags forced language or locale behavior when there is no user opt-in or clear region-specific rationale.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The user-facing description and instructional content are written entirely in Chinese, with no indication that language selection is optional or that the skill is intended only for a Chinese-speaking audience. This can violate language or locale policy when a skill implicitly forces one language without user opt-in or justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

This markdown file presents the schema description entirely in Chinese, including the title and all explanatory text, with no indication that the language is optional or required for a region-specific purpose. Under the policy for natural-language violations, forcing a specific language without user opt-in should be flagged.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

Natural-language strings in the module header and all user-oriented docstrings are written exclusively in Chinese, which effectively constrains the skill to a single language. The file does not indicate that language selection is optional or that the locale restriction is intentional for a region-specific use case.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The module docstring and surrounding natural-language comments are written only in Chinese, and there is no indication that the skill or tests are region-specific or that users may choose another language. Under the stated policy, forcing a specific language without opt-in is a natural-language locale violation.

Content

No source excerpt is available for this finding.