Back to skill

Security audit

Loan Calculator

Security checks for vulnerabilities and agentic risk

Overview

The skill includes a real loan calculator, but it also bundles an unrelated command utility that can persist user-supplied text locally without clear disclosure.

Review before installing. The loan calculator script appears local and purpose-aligned, but the package also contains an unrelated utility script that can store arbitrary entries and command history under ~/.local/share/loan-calculator. Avoid entering sensitive financial or personal data into the generic add/search/export flow, and prefer a version that removes the extra utility script or clearly documents storage, deletion, and file-permission behavior.

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/script.sh:5
Finding

Unprotected and Undisclosed Writes to Predictable Local Files

Content
View full analysis

Vulnerability Details

File Location: scripts/script.sh, lines 5–7, 35, and 63
Vulnerability Type: Predictable file writes, symbolic-link following, and plaintext retention of user-controlled data
Risk Level: Medium

Vulnerable Code

bash
DATA_DIR="${LOAN_CALCULATOR_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/loan-calculator}"
DB="$DATA_DIR/data.log"
mkdir -p "$DATA_DIR"
bash
_log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; }
bash
echo "$(date +%Y-%m-%d) $*" >> "$DB"; echo "  Added: $*"

Technical Analysis

The script creates a persistent data directory on every invocation and appends data to the predictable paths history.log and data.log. It neither establishes restrictive permissions nor verifies that the destination files are regular files owned by the expected user.

Shell append redirection follows symbolic links. If either predictable destination is replaced with a symbolic link, the script appends its output to the linked target using the privileges of the process executing the script. The primitive is limited to appending attacker-influenced text; it does not provide arbitrary replacement of existing file content.

The add command stores the complete argument list in plaintext. The _log function also records command information. These persistent storage behaviors are not disclosed in SKILL.md and are unrelated to the documented loan-calculation functionality. Consequently, users may provide financial or other sensitive values without realizing that another bundled script can retain supplied content locally.

The effective accessibility of the files depends on the process umask because neither the directory nor the files receive explicit restrictive modes. A permissive execution environment could therefore expose retained information to other local users.

Attack Path

A symbolic-link exploitation path requires local ...[truncated 2035 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove scripts/script.sh if it is an unused generic template, because it does not implement the loan-calculator commands documented by the project.
  2. Clearly document all persistent storage, including the exact files created, the retained fields, the retention period, and deletion instructions.
  3. Create the storage directory and files with restrictive permissions:
    bash
    umask 077
    install -d -m 700 -- "$DATA_DIR"
    touch -- "$DB" "$DATA_DIR/history.log"
    chmod 600 -- "$DB" "$DATA_DIR/history.log"
    
  4. Reject symbolic links and unexpected file types before writing. Where possible, open files safely using a small implementation that supports no-follow semantics such as O_NOFOLLOW, verifies ownership with fstat, and writes through the already-validated file descriptor.
  5. Canonicalize and constrain LOAN_CALCULATOR_DIR. Do not honor an externally supplied storage directory in privileged or automated execution contexts unless it has been explicitly validated.
  6. Verify that the directory and destination files are owned by the effective user and are not group- or world-writable.
  7. Do not log user arguments by default. If logging is necessary, record only non-sensitive command metadata and provide an explicit opt-in mechanism.
  8. Validate and minimize data accepted by add, and provide a functional deletion command and retention policy for stored records.
  9. Never run this script with elevated privileges. If privileged execution is unavoidable, use a fixed root-owned directory and secure file-descriptor-based writes.
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 (9)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description says this skill is a loan calculator with multiple financial-analysis features. However, the code is a generic command-line utility scaffold with commands like add, list, search, export, init, and status. It writes arbitrary text entries to a data log and records command usage in a history log under a local data directory. There is no implementation of loan formulas, repayment schedule generation, comparison logic, prepayment analysis, affordability evaluation, or refinancing analysis. The primary purpose and actual behavior are materially different, so this is a clear mismatch.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script's implemented behavior does not match the declared loan-calculator purpose; it is a generic local data and logging utility with unrelated commands. This kind of skill/implementation mismatch is dangerous because users or higher-level agents may grant trust, permissions, or provide sensitive financial inputs under false assumptions, enabling unintended data collection or misuse.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This skill presents loan affordability, repayment, prepayment, and refinancing guidance but does not warn users that outputs are informational only and not financial advice. In a financial decision-making context, users may over-rely on generated recommendations, which can lead to harmful borrowing or repayment choices even without code execution or system compromise.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The markdown command list exposes help as a command name, which is a very common everyday term and may overlap with generic user requests rather than a narrowly scoped skill invocation. The file does not provide exclusion conditions or clarify when generic 'help' requests should invoke this skill versus broader assistant help behavior.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Labeling the file as a 'Multi-purpose utility tool' directly contradicts the declared financial-calculator purpose and signals deceptive or careless packaging. In an agent ecosystem, misleading documentation increases the chance that the tool is invoked in inappropriate contexts and trusted with sensitive user data it was not designed to handle safely.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The help text advertises a generic command utility rather than a loan calculator, reinforcing that the shipped capability differs from the claimed one. This discrepancy can mislead users and orchestrators, causing sensitive financial workflows to call a tool that instead stores, lists, searches, and exports arbitrary local data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The logging helper persistently writes command names and user-supplied arguments to history.log without user notice, consent, redaction, or retention controls. In the context of a purported loan calculator, those arguments may contain highly sensitive financial information such as income, debts, rates, balances, or repayment plans, creating a privacy and data-exposure risk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

This shell script presents its name, help text, usage guidance, errors, and all analytical output in Chinese, with no opt-in or alternative locale selection. That creates a language/locale policy concern because users are implicitly forced into a specific language rather than being given a choice.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The instructional content from L03 onward is written entirely in Chinese, while there is no indication that the skill is region-specific or that users can opt into this language. Under the policy, forcing a specific language without user choice is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.