Back to skill

Security audit

Crypto Defi

Security checks for vulnerabilities and agentic risk

Overview

The skill is advertised as a DeFi yield calculator, but the inspected artifact is mainly a plaintext local crypto activity logger for potentially sensitive financial records.

Install only if you want a local plaintext crypto logbook, not a DeFi yield calculator. Avoid entering wallet secrets, exact balances, or sensitive trading strategy unless you are comfortable with those notes being stored on disk, and consider locking down ~/.local/share/crypto-defi permissions before use.

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

Plaintext Financial Records Created Without Enforced Access Controls

Content
View full analysis

Vulnerability Details

File Location: scripts/script.sh, lines 3-8
Vulnerability Type: Insecure storage permissions for sensitive local data
Risk Level: Medium

Vulnerable Code:

bash
# Powered by BytesAgain | bytesagain.com | hello@bytesagain.com
set -euo pipefail

DATA_DIR="${HOME}/.local/share/crypto-defi"
mkdir -p "$DATA_DIR"

_log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; }

Technical Analysis

The Skill stores portfolio balances, DeFi positions, alerts, price observations, whale activity, and operation history in plaintext files beneath ~/.local/share/crypto-defi/. It creates the storage directory with mkdir -p and creates log files through shell redirection, but it neither establishes a restrictive umask nor explicitly applies secure permission modes.

Consequently, permissions depend on the invoking process's environment. Under a commonly used 022 umask, newly created directories are typically mode 755 and log files are typically mode 644. This may permit other local accounts to traverse the directory and read the files. Existing directories and files are also not checked or repaired if their permissions are insecure.

The vulnerability does not independently provide remote access, code execution, privilege escalation, or access beyond the invoking user's files. Exploitation requires a separate local account or process that can access files according to their effective permissions.

Attack Path

  1. A user invokes commands such as crypto-defi portfolio, track, alert, or whale-watch and supplies sensitive financial information.
  2. The script creates ~/.local/share/crypto-defi and its log files using the caller's current umask.
  3. If that umask permits group or world access, the resulting directory and files receive overly broad permissions.
  4. Another local user or process enumerates or directly reads ~/.local/share/crypto-defi/*.log ...[truncated 764 chars]
Remediation
View remediation

Remediation Suggestions

  1. Establish a restrictive file-creation mask before creating any data:

    bash
    umask 077
    
  2. Create the data directory with an explicit owner-only mode:

    bash
    DATA_DIR="${HOME}/.local/share/crypto-defi"
    mkdir -p -m 700 -- "$DATA_DIR"
    chmod 700 -- "$DATA_DIR"
    
  3. Ensure all existing and newly generated logs and exports are owner-readable and owner-writable only:

    bash
    find "$DATA_DIR" -maxdepth 1 -type f -exec chmod 600 -- {} +
    
  4. Validate that DATA_DIR is owned by the invoking user and reject unsafe ownership or symbolic-link configurations before writing sensitive information.

  5. Clearly warn users that records are stored locally in plaintext. If the data is expected to include highly sensitive holdings or transaction details, consider optional encryption at rest using a well-reviewed platform key store or encryption utility.

  6. Add automated tests that execute the script under permissive umasks and verify that the resulting directory is mode 700 and all data files are mode 600.

Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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 skill metadata and description present this as a DeFi yield calculator, but the documented behavior is a local logging and portfolio-tracking toolkit that writes plaintext data to disk and exposes search/export/history capabilities. This mismatch can mislead users and downstream systems into granting trust or invoking the skill in contexts involving sensitive financial data, creating privacy and integrity risks because the actual behavior is broader than advertised.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The manifest claims yield-calculation functionality, while the body documents a different tool centered on recording, storing, and retrieving DeFi notes and portfolio activity. This is dangerous because users may provide sensitive financial information under false expectations, and reviewers or permission systems may underestimate the skill's data handling and persistence behavior.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The implementation materially diverges from the declared skill purpose. Instead of a DeFi yield calculator, it behaves as a general-purpose crypto activity logger with persistent storage, tracking, and export features, which expands data collection and capability scope beyond what a user would reasonably expect. In a skill ecosystem, this kind of scope mismatch is dangerous because it can facilitate covert data harvesting or unauthorized retention under misleading packaging.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file communicates conflicting intent: the frontmatter says 'DeFi Calculator' but the body describes 'Crypto DeFi' tracking, watchlists, whale monitoring, exports, and history commands. Conflicting identity and purpose increase the chance of unsafe use, mistaken installation, or overly broad trust in a skill that handles more sensitive data than its name suggests.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation notes that data is stored locally in plain-text logs, but it does not prominently warn that entries may include sensitive portfolio balances, trading activity, watchlists, and operational notes. In the DeFi context, such information can reveal holdings and behavior patterns, increasing privacy and targeting risks if the local machine, backups, or shared accounts are accessed.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Commands such as whale-watch, alert, watchlist, and generic tracking are outside the expected scope of a yield calculator and indicate unnecessary functional breadth. In the context of an agent skill, unjustified extra commands increase attack surface and the chance that users will disclose or persist information they did not intend to provide to a simple calculator.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Persistent portfolio/history storage and export capabilities are not necessary for a calculator and create avoidable privacy and data-retention risk. Aggregating prior user entries into export files can expose sensitive financial interests or behavior if the local environment is shared, backed up, or otherwise accessed by other software or users.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The export routine materializes aggregated historical logs into new files without prominently warning the user that previously entered data will be copied and consolidated. This increases the risk of sensitive local data spreading to additional files, formats, backups, or downstream tools, making accidental disclosure 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 script writes raw user-provided input to persistent log files without a clear upfront notice that data will be retained locally. For a tool presented as a calculator, this violates user expectations and can lead to inadvertent storage of sensitive portfolio, wallet, or strategy information.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.