Back to skill

Security audit

Flashloan

Security checks for vulnerabilities and agentic risk

Overview

This skill is advertised as flashloan analysis, but the artifact actually implements a persistent local record manager with write, delete, export, and unsafe config handling.

Do not install this as a flashloan-analysis skill. Only consider it if you intentionally want a local note/data manager, and even then avoid sensitive entries, avoid opening CSV exports from untrusted content, and do not pass untrusted values to config until the purpose mismatch and input-handling bugs are fixed.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/script.sh:10
Finding

Unescaped JSON Storage and CSV Formula Injection

Content
View full analysis
> "$DATA_DIR/data.jsonl" } ``` ```bash csv) echo "timestamp,command,value" > "$out" while IFS= read -r line; do ts=$(echo "$line" | grep -o '"ts":"[^"]*' | cut -d'"' -f4) c2=$(echo "$line" | grep -o '"cmd":"[^"]*' | cut -d'"' -f4) vl=$(echo "$line" | grep -o '"val":"[^"]*' | cut -d'"' -f4) echo "$ts,$c2,$vl" >> "$out" done < "$DATA_DIR/data.jsonl" ;; ``` ### Technical Analysis The `add` command ultimately passes user-controlled text to `_save_entry`. The value is interpolated directly into a JSON string without escaping quotation marks, backslashes, line breaks, or other JSON control characters. An attacker can therefore terminate the intended JSON string, introduce additional properties, or inject new lines that appear to be independent records. The later `list`, `search`, and `export` operations parse records using regular expressions rather than a JSON parser, making malformed or forged records more likely to be accepted incorrectly. The CSV export has a second output-encoding issue. Fields are concatenated with commas without RFC 4180 quoting or escaping. Values containing commas, quotation marks, or line breaks can alter the CSV structure. Values beginning with spreadsheet formula prefixes such as `=`, `+`, `-`, or `@` are not neutralized. When the result is opened in spreadsheet software, such values may be evaluated as formulas. ### Attack Path 1. The attacker supplies a crafted entry through the public command interface, ...[truncated 1166 chars]
Remediation
View remediation
> "$DATA_DIR/data.jsonl" ``` 2. Parse stored records with `jq` rather than `grep` and `cut`: ```bash jq -r '[.ts, .cmd, .val] | @tsv' "$DATA_DIR/data.jsonl" ``` 3. Generate CSV through a serializer that implements correct field quoting: ```bash jq -r '[.ts, .cmd, .val] | @csv' "$DATA_DIR/data.jsonl" ``` 4. Before spreadsheet export, neutralize values beginning with `=`, `+`, `-`, or `@`, for example by prefixing them with a single quote where compatible with the target spreadsheet application. 5. Reject or safely encode embedded control characters if multiline entries are not an intended feature. 6. Add regression tests covering quotation marks, backslashes, commas, CR/LF characters, malformed JSON fragments, and spreadsheet-formula prefixes. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scripts/script.sh:145
Finding

Unsanitized Input in grep and sed Expressions

Content
View full analysis
/dev/null || echo 0) echo "Found: $matches matches" grep -i "$term" "$DATA_DIR/data.jsonl" 2>/dev/null | head -20 | while IFS= read -r line; do ``` ```bash elif [ -z "$val" ]; then grep "^${key}=" "$cfg" 2>/dev/null | cut -d= -f2- || echo "(not set)" else if [ -f "$cfg" ] && grep -q "^${key}=" "$cfg" 2>/dev/null; then sed -i "s|^${key}=.*|${key}=${val}|" "$cfg" else echo "${key}=${val}" >> "$cfg" fi echo "Set: $key=$val" ``` ### Technical Analysis The search term is passed to `grep` as a regular expression rather than as a literal string. No `--` option terminator is used. Consequently, regular-expression metacharacters change matching behavior, and option-like input can be interpreted as additional `grep` options rather than data. The configuration function has a more severe injection sink. Both `key` and `val` are embedded directly into a dynamically generated `sed` program: ```bash sed -i "s|^${key}=.*|${key}=${val}|" "$cfg" ``` The key affects the regular-expression portion, while the value affects the replacement portion. Neither input is validated or escaped. An attacker can inject the `|` delimiter, replacement metacharacters, newlines, or additional `sed` commands. On implementations supporting the `e` substitution flag, including common GNU `sed` installations, delimiter injection can potentially terminate the replacement and add the `e` flag. When a matching configuration line exists, `sed` can then execute the generated replacement text through a shell. This turns an intended configuration update into local command execution under the account invoking the S ...[truncated 2022 chars]
Remediation
View remediation
&2 return 1 fi ``` 3. Reject carriage returns, line feeds, NUL characters, and other control characters in configuration values. 4. Do not interpolate untrusted data into a `sed` program. Replace the update logic with a parser that compares keys as data. For example, use `awk` with values passed through `-v`, while still rejecting line breaks and validating keys. 5. If `sed` must be retained, escape regular-expression characters in keys and escape delimiter, backslash, and ampersand characters in replacement values. However, avoiding dynamically constructed `sed` programs is safer. 6. Write updates to a securely created temporary file in the same directory, verify success, set restrictive permissions, and atomically rename the file over `config.txt`. 7. Add tests for input containing `|`, `&`, backslashes, newlines, regex operators, leading hyphens, and `sed` flags such as `e`. ]]>
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 (11)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The manifest presents this as a flashloan analysis skill, but the documented behavior is a generic local data-management utility with persistent storage, deletion, export, and configurable filesystem paths. That mismatch can mislead users or calling agents into granting trust, permissions, or sensitive inputs under false assumptions, increasing the risk of unintended data handling and exfiltration.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The top-level description claims blockchain/flashloan analysis, but the subsequent commands contradict that by describing unrelated local record operations. In agent ecosystems, this kind of contradiction undermines trust boundaries and can cause unsafe invocation decisions based on inaccurate metadata rather than actual behavior.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The command set implements status/add/list/search/remove/export/config operations typical of a generic record manager, not a flashloan analysis tool. This semantic deception is dangerous because agents and users may invoke it expecting blockchain analysis while it instead manipulates local data and files, creating opportunities for unauthorized persistence, deletion, or export of information.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The inline documentation explicitly claims the script analyzes flashloan operations and protocol security, but no such capability exists in the code. This is dangerous because deceptive security-oriented labeling can socially engineer users into executing an unrelated tool with broader local data handling than expected.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill is presented as a flashloan/security analysis tool, but the implementation is a generic local note-taking and file-management utility. This mismatch is dangerous because users may grant trust and run the skill expecting read-only analytical behavior, while it actually persists arbitrary data, modifies files, and exports local content, indicating deceptive functionality inconsistent with the declared purpose.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The help text markets the tool as a flashloan analysis utility, but the exposed commands are only for storing, searching, removing, exporting, and configuring local entries. In a security-tool context, this discrepancy increases the risk of user deception and unauthorized persistence because users are not meaningfully informed about the script's true function.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The documentation advertises remove and export capabilities without warning about destructive effects, overwrite risk, destination sensitivity, or possible disclosure of stored content. While not inherently malicious, the lack of safety messaging increases the chance of accidental data loss or unintended exposure when an agent or user triggers these actions.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The script creates a persistent data directory and stores arbitrary user-supplied entries despite being advertised as a flashloan analysis skill. In this context, unjustified persistence is risky because it can silently retain sensitive data or operational notes that users did not expect to be written to disk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The remove command deletes a selected line from the persistent data store using sed -i, which is a destructive operation. The script reports success afterward, but there is no prior confirmation, warning in comments/docstrings, or help text indicating that the action permanently alters stored data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The export command creates or overwrites an output file in the current directory, but the help text only says Export data to file and does not clearly warn that local files will be written. For a file-writing operation, the user should be informed up front rather than only after the write completes.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The script modifies persistent configuration data in config.txt via sed replacement or file append, but there is no preceding confirmation prompt, cautionary comment, or help text warning that the config command writes to disk. Although the command echoes after the change, the disclosure comes only once the write has already happened.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.