Back to skill

Security audit

Car Log

Security checks for vulnerabilities and agentic risk

Overview

This local car-log skill is purpose-aligned, but it needs review because it can delete vehicle and expense records, including bulk deletion, without confirmation.

Install only if you are comfortable with a local assistant creating and deleting persistent vehicle, mileage, refueling, maintenance, and expense records. Use explicit requests for any delete operation, review targets before deletion, and treat stored names or notes as untrusted text.

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

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:23
Finding

Unsafe interpolation of user-controlled values into documented shell commands

Content
View full analysis
mileage add --car ID --mileage KM [--datetime DT] [--note NOTE] mileage list --car ID mileage delete refuel add --car ID --liters L --cost C --mileage KM [--datetime DT] [--note NOTE] refuel list --car ID refuel delete refuel consumption --car ID ``` The documented workflow subsequently shows these values being inserted into shell command templates: ```bash bun scripts/carlog.js mileage add --car --mileage bun scripts/carlog.js refuel add --car --liters --cost --mileage bun scripts/carlog.js maintenance add --car --mileage [--cost ] ``` ### Technical Analysis The Skill directs an AI agent to invoke the utility through shell commands while accepting user-derived vehicle names, plates, notes, dates, and numeric values. It does not require structured process invocation, shell-free argument arrays, or robust quoting of dynamic arguments. If an implementing agent directly substitutes a user-provided value into one of these templates and executes the resulting string through a shell, shell metacharacters may terminate or modify the intended command. The JavaScript utility itself uses parameterized SQL and is not the source of this command-injection risk; the vulnerable boundary is the Skill's command-construction guidance. Exploitability depends on the agent's tool interface. Invocation through a shell with direct interpolation is vulnerable, whereas an execution API that passes a fixed executable and separate argument array is not. ### Attack Path 1. The user asks the agent to add or update a record containing a crafted name, plate, note, or date. 2. The crafted value includes a shell separator, command substitution, redirection, or another shell metacharac ...[truncated 1032 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/carlog.js:562
Finding

Stored terminal-control and indirect prompt injection through unsanitized database fields

Content
View full analysis
[ r.id, r.mileage?.toLocaleString("zh-CN") ?? "-", r.datetime, r.note ?? "-" ]))); ``` The same pattern is used for refueling and maintenance records: ```js console.log(table(["ID", "\u91CC\u7A0B(km)", "\u5347\u6570(L)", "\u82B1\u8D39(\u5143)", "\u65F6\u95F4", "\u5907\u6CE8"], records.map((r) => [ r.id, r.mileage?.toLocaleString("zh-CN") ?? "-", r.liters ?? "-", r.cost ? r.cost.toFixed(2) : "-", r.datetime, r.note ?? "-" ]))); ``` Vehicle names are also emitted directly during deletion: ```js console.log(`\x1B[32m\u5DF2\u5220\u9664 ${count} \u6761${typeLabel}\u8BB0\u5F55 (\u8F66\u8F86: ${vehicle.name})\x1B[0m`); ``` ### Technical Analysis Vehicle names, plates, and notes are accepted as arbitrary strings, stored in SQLite, and later printed without filtering or escaping control characters. The table formatter measures and truncates text but does not neutralize terminal control sequences. An attacker can therefore persist C0/C1 control characters or ANSI escape sequences in a stored field. When a later command lists or references that record, a compatible terminal may interpret the sequence rather than display it as data. This can alter colors, reposition the cursor, clear visible output, create deceptive terminal content, or potentially influence terminal-specific features. The command output is also intended to be consumed by an AI agent. Instruction-like text stored in a name or note m ...[truncated 1379 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
scripts/carlog.js:250
Finding

Typed deletion commands can delete records of any category

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (13)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 15)May include surrounding context.

md
bun scripts/carlog.js [命令] [子命令] [选项]

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 60)May include surrounding context.

md
bun scripts/carlog.js [命令] [子命令] [选项]

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 65)May include surrounding context.

md
bun scripts/carlog.js [命令] [子命令] [选项]

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 77)May include surrounding context.

md
bun scripts/carlog.js [命令] [子命令] [选项]

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 82)May include surrounding context.

md
bun scripts/carlog.js [命令] [子命令] [选项]

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 96)May include surrounding context.

md
bun scripts/carlog.js [命令] [子命令] [选项]

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 109)May include surrounding context.

md
bun scripts/carlog.js [命令] [子命令] [选项]

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.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger list contains broad everyday terms like '里程', '加油', '保养', '油耗', and '车辆花费', which can cause the skill to activate on casual discussion or informational questions rather than clear requests to modify records. In context, that raises the risk of unintended tool use and accidental creation or deletion of vehicle data if the agent misclassifies user intent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill exposes destructive commands for deleting cars and records but provides no confirmation, safety prompt, or recovery guidance. In this domain, accidental invocation could permanently remove user-maintained mileage, fuel, maintenance, and expense history, especially because the skill also uses broad triggers and automatic vehicle selection logic.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The delete-all command performs bulk soft-deletion immediately once invoked, without a confirmation prompt, dry-run mode, or additional safeguard. In an agent/assistant context, a misparsed instruction, prompt injection in upstream workflow, or user misunderstanding could cause irreversible loss of access to all vehicle records for a car, making this more dangerous than in a purely manual CLI.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

The manifest describes a local assistant for recording vehicle mileage, refueling, maintenance, fuel consumption, and expenses. Reading process environment variables to control storage location is not part of that stated user-facing purpose and introduces an extra capability beyond normal car-log operations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

This script presents usage text and operational messages entirely in Chinese, and formatting also forces the zh-CN locale in several user-visible outputs. That creates a natural-language policy concern if users are not given a language or locale choice.

Content

No source excerpt is available for this finding.