Back to skill

Security audit

记账工具

Security checks for vulnerabilities and agentic risk

Overview

This is a real local bookkeeping skill, but it handles sensitive financial records with broad file access and an unsafe global dependency install, so it should be reviewed before use.

Use this only if you are comfortable storing personal financial records locally. Prefer an isolated, pinned local dependency install instead of the documented global npm install, confirm any update/delete/import/export action before running it, and only import from or export to trusted local paths you explicitly choose.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (3)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:27
Finding

Unpinned Global Installation of a Third-Party npm Dependency

Content
View full analysis
&1 && echo "ready" || echo "not_installed" ``` ```bash npm install -g better-sqlite3 ``` ### Technical Analysis The Skill instructs the agent to install `better-sqlite3` globally if the module is unavailable. The installation does not specify an exact version, use a lockfile, verify an integrity hash, or isolate the package inside the project. Consequently, the installed code is determined by the package registry state at execution time rather than by the reviewed Skill artifact. npm installation may also run package lifecycle scripts with the permissions of the user running the agent. The global `-g` installation expands the affected scope beyond this Skill and modifies the user's shared Node.js environment. No evidence in the audited files indicates that `better-sqlite3` is currently malicious. The vulnerability is the mutable, unpinned, globally installed dependency chain. ### Attack Path 1. The user invokes the bookkeeping Skill. 2. The dependency check reports that `better-sqlite3` is unavailable. 3. Following `SKILL.md`, the agent executes `npm install -g better-sqlite3`. 4. npm retrieves the package and its dependency graph as they exist in the configured registry at that time. 5. If the package, a transitive dependency, maintainer account, or configured registry has been compromised, malicious installation code can execute. 6. The malicious code runs with the invoking user's permissions and may modify files, access user-readable information, or tamper with the global Node.js environment. ### Impact Assessment Successful exploitation would provide code execution with the privileges of the user running npm. The affected scope could include: - Files and credentials readable or writable by that user. - The ...[truncated 411 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/book.mjs:298
Finding

SQL Injection Through Unvalidated Pagination Parameters

Content
View full analysis
Remediation
View remediation
1000) { throw new Error("limit must be an integer between 1 and 1000"); } if (!Number.isSafeInteger(rawOffset) || rawOffset < 0) { throw new Error("offset must be a non-negative integer"); } const sql = ` SELECT * FROM transactions WHERE ${conditions.join(" AND ")} ORDER BY happen_time DESC LIMIT @limit OFFSET @offset `; return this.db.prepare(sql).all({ ...params, limit: rawLimit, offset: rawOffset }); ``` Additional hardening should include: 1. Apply a centralized runtime schema to all CLI JSON parameters. 2. Reject strings where numeric values are required instead of coercing them. 3. Enforce a conservative maximum page size to prevent resource exhaustion. 4. Add tests containing SQL metacharacters and expressions in both pagination fields. 5. Avoid all direct interpolation of caller-controlled values into SQL, including values that are nominally numeric. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/book.mjs:647
Finding

Arbitrary File Overwrite Through Caller-Controlled Export Path

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (12)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
所有命令通过 `node` 直接运行本 skill 目录下的 `scripts/book.mjs`:

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger instructions are broad enough to invoke the bookkeeping skill for many general money-related requests without strong disambiguation. In an agent setting, this can cause the assistant to collect, store, or act on sensitive personal financial information when the user may have intended only discussion or analysis, increasing privacy and integrity risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill documents direct transaction deletion with no requirement for confirmation, preview, or recovery guidance. Because this tool modifies a local SQLite ledger, accidental or misinterpreted commands could irreversibly remove financial records and corrupt the user's accounting history.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The import/export section instructs handling potentially sensitive financial data files but provides no privacy warning, path-safety guidance, or restrictions on where data may be written or read. In practice, this can expose personal financial records through unintended file locations, unsafe imports, or accidental disclosure during agent-mediated file operations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

This is a markdown file, so SQP-2 applies to documented behaviors that may affect user data or system integrity. The export and import sections describe writing financial data to disk and ingesting transaction data from a file, but they do not warn users about privacy implications, validating the target path, or backing up data before import/update operations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The file contains user-facing error messages in Chinese and later seeds Chinese default category/account names, with no evidence of locale choice or opt-in. This creates a natural-language policy issue because the skill appears to enforce a specific language/locale for interaction and default content regardless of user preference.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The export function accepts a caller-controlled outputPath and writes bookkeeping data to that path with fs.writeFileSync, enabling arbitrary file overwrite within the permissions of the running user. In an agent/tooling context, this exceeds normal bookkeeping needs and can be abused to clobber shell profiles, app configs, or other sensitive local files.

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 writes transaction records, including account names, remarks, and timestamps, to a file path on disk. Although the operation is part of an export feature, this code provides no user-facing disclosure in the function itself about persisting potentially sensitive financial data to a local file.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The import function reads an arbitrary caller-specified local file via fs.readFileSync and processes its contents. In an agent skill, this grants broader local file read capability than necessary for bookkeeping and can be abused to access unrelated sensitive files if the agent exposes this parameter to untrusted prompts.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The migration seeds default categories and accounts using Chinese labels such as expense/income categories and wallet names. Without any documented locale selection or region-specific justification in this file, the skill appears to impose a Chinese-language default experience on all users.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

SQP-3 applies to all file types and includes language or locale policy violations. This file forces a specific language for all instructions and command documentation, and there is no indication that Chinese is optional or that the skill is intentionally restricted to a Chinese-speaking locale.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The import function reads a file from a user-provided path and ingests its contents into the application's database, but there is no in-code confirmation, warning, or user-facing disclosure around this file access and data mutation. This is a safety-relevant file read/write workflow because it consumes local data and alters stored financial records.

Content

No source excerpt is available for this finding.