Back to skill

Security audit

Abi Toolchain

Security checks for vulnerabilities and agentic risk

Overview

The skill is purpose-aligned ABI tooling, but one bundled sync script has real unsafe path handling that can overwrite unintended files and conditionally execute injected Python from crafted artifact paths.

Review before installing or running in CI. Only run sync-abi.sh on trusted repositories and trusted artifact trees, avoid untrusted .abi-sync or ABI_CONTRACTS values, prefer jq over the Python fallback, and pin/review any Wagmi CLI dependency before using the generated CI commands.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/sync-abi.sh:119
Finding

Python Code Injection Through Unsafely Interpolated Artifact Paths

Content
View full analysis
/dev/null; then python3 -c "import json,sys; d=json.load(open('$artifact_path')); print(json.dumps(d['abi'], indent=2))" return elif command -v python &>/dev/null; then python -c "import json,sys; d=json.load(open('$artifact_path')); print(json.dumps(d['abi'], indent=2))" return fi fi ``` ### Technical Analysis The script embeds `artifact_path` directly into Python source passed to the `-c` option. Shell quoting protects the value from direct shell expansion, but it does not protect the generated Python program. A pathname containing a single quote can terminate the argument passed to `open(...)` and append attacker-controlled Python statements. The vulnerable branch is used when `jq` is unavailable and either `python3` or `python` is installed. Artifact paths are derived from the configurable `ABI_SOURCE`, contract names, and files found beneath the artifact directory. Consequently, an attacker who can control the artifact tree or relevant synchronization configuration may be able to introduce a specially crafted pathname. ### Attack Path 1. An attacker gains control over the artifact tree, `ABI_SOURCE`, or contract synchronization input. 2. The attacker creates an artifact whose pathname contains characters that terminate the Python string and inject additional Python statements. 3. The artifact contains the text `"abi"` so that the Python fallback is selected. 4. The victim runs `sync-abi.sh` on a system where `jq` is unavailable but Python is installed. 5. The script incorporates the malicious pathname into the program supplied to `python -c`. 6. The injected Python statements execute with the permissions of the developer or CI runner. ### Impact Assessment Successful exploit ...[truncated 544 chars]
Remediation
View remediation
/dev/null; then python3 -c ' import json import sys with open(sys.argv[1], encoding="utf-8") as stream: data = json.load(stream) print(json.dumps(data["abi"], indent=2)) ' "$artifact_path" return elif command -v python &>/dev/null; then python -c ' import json import sys with open(sys.argv[1], encoding="utf-8") as stream: data = json.load(stream) print(json.dumps(data["abi"], indent=2)) ' "$artifact_path" return fi ``` Additional hardening should include: - Validate that the resolved artifact remains inside the canonical `ABI_SOURCE` directory. - Reject symbolic links that resolve outside the expected artifact tree if untrusted artifacts are supported. - Validate that parsed JSON is either an ABI array or an object containing an ABI array. - Add regression tests using filenames containing quotes, whitespace, newlines, and shell/Python metacharacters. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scripts/sync-abi.sh:135
Finding

Path Traversal Allows Files Outside the ABI Destination to Be Overwritten

Content
View full analysis
"$dest_file" ``` ### Technical Analysis The output name originates from `ABI_CONTRACTS` or `.abi-sync` and is appended to `ABI_DEST` without validation. An output name may contain `../` path components, directory separators, or other unsafe pathname content. Shell quoting prevents word splitting but does not stop filesystem path traversal. For example, an entry such as `MyToken:../../target` creates a destination ending in `ABI_DEST/../../target.json`. If the traversed parent directories exist, the redirection follows the path and truncates or creates the resulting file outside the intended ABI directory. The use of direct shell redirection also means an existing destination is truncated before the write completes. Symbolic links at the destination can further redirect the write to another file accessible to the invoking user. ### Attack Path 1. An attacker modifies `.abi-sync`, controls `ABI_CONTRACTS`, or supplies configuration consumed by the script. 2. The attacker specifies a valid contract followed by a traversal-based output n ...[truncated 840 chars]
Remediation
View remediation
&2 FAILED=$((FAILED + 1)) continue fi if [[ ! "$output_name" =~ ^[A-Za-z_][A-Za-z0-9_-]*$ ]]; then echo "Invalid output name: $output_name" >&2 FAILED=$((FAILED + 1)) continue fi ``` Also implement the following controls: - Canonicalize `ABI_DEST` and the destination parent, then verify the result remains beneath the canonical destination directory. - Explicitly reject `/`, `\`, `..`, empty names, control characters, and leading hyphens where applicable. - Refuse to write through symbolic links, or create files using operating-system primitives that prevent symlink following. - Write validated output to a temporary file inside `ABI_DEST`, set appropriate permissions, and atomically rename it. - Validate the complete ABI before replacing an existing destination. - Add tests for traversal inputs, absolute paths, symbolic links, and malformed output names. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/abi-diff.js:43
Finding

ABI Overload Collisions Can Bypass Breaking-Change Detection

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
SKILL.md:121
Finding

Unpinned Third-Party Package Installation and Execution

Content
View full analysis
Remediation
View remediation
``` - Commit and review the package lockfile. - Use `npm ci` rather than `npm install` in CI so dependency resolution follows the committed lockfile. - Configure an approved registry and enforce package-integrity verification. - Review transitive dependency changes before lockfile updates. - Consider disabling lifecycle scripts where compatible: ```bash npm ci --ignore-scripts ``` - Avoid allowing `npx` to download missing packages implicitly. Invoke the locally installed binary through a package script or use `npx --no-install` where supported. - Run code generation in a restricted CI job with minimal credentials, filesystem permissions, and network access. ]]>
Vulnerability Patterns
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • 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 (8)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
| `abi-diff.js` | Compare two ABI files: find added/removed/changed, flag breaking changes |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
| `abi-diff.js` | Compare two ABI files: find added/removed/changed, flag breaking changes |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
| `abi-diff.js` | Compare two ABI files: find added/removed/changed, flag breaking changes |

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger list is extremely broad, ending with phrases like 'any question about syncing frontend code to contract changes,' which can cause the skill to activate in loosely related contexts. Over-broad invocation increases the chance that an agent applies specialized build/deployment guidance when it is not appropriate, potentially leading users to run shell commands, CI changes, or ABI sync steps in the wrong repository or workflow.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Unbounded Output

Medium
Category
Output Handling
Confidence
60% confidence
Finding

Output size or generation rate is not bounded. Unbounded output enables denial-of-service through resource exhaustion, log flooding, or context-window stuffing.

Content

Scanner excerpt · references/abi-formats.md (reported line 155)May include surrounding context.

Event Topics

Events are identified by a 32-byte topic (full keccak256, no truncation):

bash
cast keccak "Transfer(address,address,uint256)"

Static analysis

No suspicious patterns detected.