Back to skill

Security audit

Compound

Security checks for vulnerabilities and agentic risk

Overview

This is a local compound-interest calculator with disclosed history, export, and configuration features, but users should treat stored financial inputs as private local data.

Install only if you are comfortable with calculation inputs and results being saved locally under ~/.compound. Avoid entering highly sensitive financial details on shared machines, review file permissions if privacy matters, and be careful when using OUTPUT because export can overwrite the specified file.

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:7
Finding

Financial History and Configuration Files May Be Created with Overly Permissive Permissions

Content
View full analysis

Vulnerability Details

File Location: scripts/script.sh, lines 7–18
Vulnerability Type: Insecure filesystem permissions
Risk Level: Medium

bash
DATA_DIR="$HOME/.compound"
DATA_FILE="$DATA_DIR/data.jsonl"
CONFIG_FILE="$DATA_DIR/config.json"
VERSION="1.0.0"

mkdir -p "$DATA_DIR"
touch "$DATA_FILE"

if [ ! -f "$CONFIG_FILE" ]; then
  cat > "$CONFIG_FILE" << 'EOF'
{"default_frequency": "monthly", "currency_symbol": "$", "decimal_places": 2}
EOF

Technical Analysis

The script creates ~/.compound, data.jsonl, and config.json without setting a restrictive umask or explicitly applying secure permission modes. Their resulting permissions therefore depend on the invoking process's existing umask.

Under a common umask of 022, the directory can be created with mode 0755, while the history and configuration files can be created with mode 0644. If the user's home directory is traversable by other local users, those users may read the files.

The history file stores financial information such as principal amounts, interest rates, savings targets, contribution amounts, projected balances, and calculation timestamps. Although this does not provide code execution or elevated privileges, it may expose private financial planning information.

Attack Path

  1. A user runs the Skill on a multi-user system with a permissive umask, such as 022.
  2. The script creates ~/.compound/data.jsonl and ~/.compound/config.json without restrictive modes.
  3. Calculation commands append financial records to data.jsonl.
  4. A different local user who can traverse the victim's home directory locates ~/.compound/.
  5. The local user reads the world-readable or group-readable history and configuration files.
  6. The exposed records reveal the victim's financial inputs, goals, contributions, and projected results.

Exploitation requires local access and sufficient directory traversal permissions. T ...[truncated 661 chars]

Remediation
View remediation

Remediation Suggestions

Set a restrictive umask before creating any persistent data, and explicitly enforce secure modes for both newly created and existing paths:

bash
DATA_DIR="$HOME/.compound"
DATA_FILE="$DATA_DIR/data.jsonl"
CONFIG_FILE="$DATA_DIR/config.json"

umask 077
mkdir -p "$DATA_DIR"
chmod 700 "$DATA_DIR"

touch "$DATA_FILE"
chmod 600 "$DATA_FILE"

if [ ! -f "$CONFIG_FILE" ]; then
  cat > "$CONFIG_FILE" << 'EOF'
{"default_frequency": "monthly", "currency_symbol": "$", "decimal_places": 2}
EOF
fi
chmod 600 "$CONFIG_FILE"

Additional hardening should include:

  • Validate that DATA_DIR is owned by the current user and is not a symbolic link before writing.
  • Apply secure permissions to existing installations, not only newly created files.
  • Replace configuration files atomically using a securely created temporary file in the same protected directory.
  • Avoid following attacker-controlled symbolic links when opening persistent files where the platform permits safe open flags.
  • Document that calculation history contains potentially private financial data and is stored locally.
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (12)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The manifest presents the skill as a compound-interest calculator, but the documented behavior also includes persistent history, configuration management, and arbitrary export output. This mismatch can mislead users and reviewers about the actual data-handling surface, increasing the risk of unintended storage or disclosure of sensitive financial inputs.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill documents capabilities that read environment variables and write persistent/local export files, but it does not declare any tool scope or permission boundaries. That creates an authorization and transparency gap: users may invoke what appears to be a simple calculator without being clearly told it persists data or writes files.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation says the skill is for financial calculations, but it also stores calculation history and configuration locally and supports exporting stored data. For financial contexts, those records may contain sensitive investment amounts, rates, targets, and planning assumptions, so undocumented persistence increases privacy and leakage risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill states that all calculations are stored in a local JSONL file, but it does not provide a strong warning or consent mechanism despite handling potentially sensitive financial data. Users may unknowingly persist balances, savings goals, contribution amounts, and other personal financial details on disk, where they could later be exposed to other local processes or users.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
94% confidence
Finding

The skill establishes session persistence by default through ~/.compound and a history file, retaining calculation activity across runs. For a calculator handling financial planning inputs, persistence raises privacy and data minimization concerns when not clearly justified or disclosed by the skill description.

Content

Scanner excerpt · scripts/script.sh (reported line 11)May include surrounding context.

sh
CONFIG_FILE="$DATA_DIR/config.json"
VERSION="1.0.0"

mkdir -p "$DATA_DIR"
touch "$DATA_FILE"

if [ ! -f "$CONFIG_FILE" ]; then

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script creates and uses persistent files for calculation history and configuration under ~/.compound even though the stated skill purpose is just to perform financial calculations. Silent persistence expands the data-handling scope, creates unnecessary retention of potentially sensitive financial inputs, and increases privacy risk if the host or account is shared or compromised.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The calculate flow writes principal, rates, years, and results to persistent history without any user-facing disclosure or consent. Financial inputs may be sensitive, and silent retention is especially risky in shared environments or agent platforms where users may reasonably expect ephemeral computation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The export command allows previously stored financial history to be written to an arbitrary file path specified by the environment, which exceeds the calculator's stated purpose. This can facilitate unintended data disclosure or clobber user files if used in an automated agent context without adequate path restrictions or confirmation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The export path is fully controlled by the OUTPUT environment variable and the script opens it with write mode, which will overwrite existing files without warning. In an agent or automation context, this can destroy unrelated local files or place exported financial data into unsafe locations.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

A compound-interest calculator reasonably performs financial computations and may display results, but exposing a command to modify persistent configuration is an ancillary system-management capability not mentioned in the manifest purpose. This broadens the skill from a calculator into a stateful local tool with settings mutation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script creates a config file automatically on startup without informing the user, introducing hidden state and persistent storage. Although the config contents are not highly sensitive by themselves, undisclosed file creation can surprise users and expands the skill's behavior beyond simple calculation.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The config command permits arbitrary key/value writes to the JSON config file, not just narrowly scoped calculator settings. While not direct code execution, this broad mutability increases unintended behavior and weakens integrity controls for the skill's local state beyond what is needed for a simple calculator.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.