Back to skill

Security audit

Smart Contract Audit

Security checks for vulnerabilities and agentic risk

Overview

The skill is a legitimate smart-contract audit workflow, but it can run untrusted project build code and unpinned installers on the host without clear containment.

Install only if you are comfortable running it in an isolated disposable environment. Do not run it directly on your main machine or with valuable environment variables, wallets, SSH agents, cloud credentials, or private repos accessible. Prefer a container or VM with pinned tools, no inherited secrets, limited network access, and explicit approval before any build, coverage, npx, forge, pip, cargo, npm, or curl-to-shell step.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • 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
Findings (3)

T03 · Remote Payload Retrieval and Execution

Error
Location
scripts/install-tools.sh:25
Finding

Mutable remote installer content is recommended for direct shell execution

Content
View full analysis
/dev/null; then echo "✅ Forge already installed: $(forge --version 2>&1 | head -1)" else echo "⚠️ Forge not found. Install via: curl -L https://foundry.paradigm.xyz | bash && foundryup" fi ``` ```bash # --- Aderyn --- if command -v aderyn &>/dev/null; then echo "✅ Aderyn already installed: $(aderyn --version 2>&1 | head -1)" else echo "📦 Installing Aderyn..." if command -v cargo &>/dev/null; then cargo install aderyn elif [ -f "$HOME/.cargo/env" ]; then source "$HOME/.cargo/env" cargo install aderyn else echo "⚠️ Rust/cargo not found. Install Rust first:" echo " curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" echo " source ~/.cargo/env && cargo install aderyn" fi fi ``` ### Technical Analysis The script does not automatically execute the two `curl | shell` pipelines; it prints them as installation instructions when Foundry or Rust is unavailable. Nevertheless, following those instructions passes mutable network responses directly to a command interpreter without first verifying a pinned version, cryptographic signature, or checksum. HTTPS protects the connection in transit but does not establish that the returned script is immutable or that a compromised upstream host cannot deliver a malicious response. The effective payload can change after the Skill package has been reviewed. The Foundry command also does not restrict the protocol and minimum TLS version as the Rust command does, although such restrictions would not eliminate the underlying pipe-to-shell risk. This behavior is not necessary for the Skill's core auditing function. Tools can be installed from pinned, indep ...[truncated 1281 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/run-slither.sh:22
Finding

Automatic Hardhat compilation executes code controlled by an untrusted audit target

Content
View full analysis
/dev/null) || echo "⚠️ hardhat compile failed" ``` In `scripts/run-aderyn.sh:21-24`: ```bash elif [ -f "$TARGET/hardhat.config.js" ] || [ -f "$TARGET/hardhat.config.ts" ]; then echo "📦 Detected Hardhat project — compiling first..." (cd "$TARGET" && npx hardhat compile 2>/dev/null) || echo "⚠️ hardhat compile failed" fi ``` Related workflow instructions also permit cloning a user-selected repository and running Hardhat coverage: ```markdown - **GitHub repo:** Clone it first with `git clone` ``` ```bash npx hardhat coverage 2>/dev/null ``` ### Technical Analysis A Hardhat configuration file is executable JavaScript or TypeScript, not passive build metadata. Running `npx hardhat compile` loads the target repository's `hardhat.config.js` or `hardhat.config.ts`, along with imported modules and configured plugins. Because the repository is the subject of a security audit, its contents must be considered untrusted. A malicious repository can place arbitrary Node.js operations in its Hardhat configuration. Those operations execute before compilation and inherit the audit process's filesystem, environment, and network access. The workflow's support for cloning a user-specified GitHub repository makes this path directly reachable by an attacker who supplies a malicious audit target. Redirecting stderr to `/dev/null` does not provide isolation and can conceal warning signs. The same unsafe compile action is performed independently by both analyzer wrappers, potential ...[truncated 1653 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
scripts/install-tools.sh:32
Finding

Unpinned analysis tools are installed into the host environment

Content
View full analysis
/dev/null; then echo "✅ Slither already installed: $(slither --version 2>&1 | head -1)" else echo "📦 Installing Slither..." pip3 install --break-system-packages slither-analyzer 2>/dev/null || pip3 install slither-analyzer fi # --- solc-select --- if command -v solc-select &>/dev/null; then echo "✅ solc-select already installed" else echo "📦 Installing solc-select..." pip3 install --break-system-packages solc-select 2>/dev/null || pip3 install solc-select fi # --- Aderyn --- if command -v aderyn &>/dev/null; then echo "✅ Aderyn already installed: $(aderyn --version 2>&1 | head -1)" else echo "📦 Installing Aderyn..." if command -v cargo &>/dev/null; then cargo install aderyn elif [ -f "$HOME/.cargo/env" ]; then source "$HOME/.cargo/env" cargo install aderyn ``` Additional unsafe installation guidance appears in `references/tool-guide.md:15-18`, `references/tool-guide.md:67-73`, and `references/tool-guide.md:115-117`: ```bash pip3 install slither-analyzer pip3 install solc-select cargo install aderyn npm install -g aderyn npx @4naly3er/cli . --output 4naly3er-report.md ``` ### Technical Analysis The package names are installed without exact version constraints, hashes, signatures, or a reviewed lockfile. Consequently, every execution can resolve a different release and transitive dependency graph. The Python commands first use `--break-system-packages`, which bypasses the protection for externally managed Python environments. This can modify system-level or distribution-managed Python state rather than creating an isolated environment. The fallback installation is also not explicitly scoped to a virtual environment. Likewise, `cargo in ...[truncated 1920 chars]
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (13)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description presents the skill as an active smart contract auditing and analysis system. However, this code chunk only installs or verifies prerequisite tools and prints informational notes. While installing Slither/Aderyn is related to the broader domain, the actual behavior is setup/bootstrapping, not vulnerability analysis. This is a material mismatch in primary purpose and implemented capabilities.

Content

No source excerpt is available for this finding.

External Script Fetching

High
Category
Supply Chain
Confidence
95% confidence
Finding

The script recommends a classic curl-to-shell installation flow for Foundry, which executes remote code fetched at runtime without pinning or independent verification. If the remote endpoint, transport, or distribution channel were compromised, users could execute attacker-controlled code on their systems with the privileges of the current user.

Content

Scanner excerpt · scripts/install-tools.sh (reported line 29)May include surrounding context.

sh
if command -v forge &>/dev/null; then
    echo "✅ Forge already installed: $(forge --version 2>&1 | head -1)"
else
    echo "⚠️  Forge not found. Install via: curl -L https://foundry.paradigm.xyz | bash && foundryup"
fi

# --- Slither ---

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill invokes shell commands (bash, git clone, forge, npx hardhat) but does not declare any explicit tool scope such as permissions or allowed-tools. In an agent setting, missing tool scoping weakens least-privilege boundaries and can allow broader-than-expected command execution if the runtime infers or permits shell access implicitly.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill description uses very broad trigger language such as 'use when reviewing, auditing, or analyzing smart contracts,' which can cause over-invocation in common requests. In agent ecosystems, overly broad routing increases the chance that a high-privilege skill with shell access is selected in contexts where a narrower, safer skill would suffice.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
89% confidence
Finding

The skill runs npx hardhat coverage, which resolves and executes packages from the Node ecosystem without any version pinning shown in the skill. This creates supply-chain risk and non-reproducible behavior, since a different or compromised package version could be fetched and executed at runtime.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
89% confidence
Finding

A second unpinned npx hardhat invocation appears later in the workflow, repeating the same supply-chain and reproducibility risk. Repeated unpinned runtime package execution increases exposure because the skill may fetch or run unintended versions during audit execution.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · references/ethskills-security.md (reported line 44)May include surrounding context.

md
### Bad Incentive Patterns (Red Flags for Auditors)
- "The contract will check prices every hour" → WHO pays gas? WHY?
- "Expired listings get automatically removed" → Nothing is automatic
- "The protocol rebalances daily" → Whose gas? What profit?
- "An admin will manually trigger the next phase" → Single point of failure

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · references/owasp-sc-top10.md (reported line 59)May include surrounding context.

md
### SC06: Unchecked External Calls
**What:** Failures, reverts, or callbacks from external contracts not handled.
**Look for:**
- Low-level `call()` without checking return bool
- Missing `try/catch` on external calls
- ERC20 `transfer()` without `SafeERC20`
- No contract existence check before `delegatecall`

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
89% confidence
Finding

The script invokes npx hardhat compile without pinning the package version or constraining resolution to a trusted local dependency. If the target project lacks a locked local Hardhat installation, npx may resolve or fetch an unexpected package/version from the registry, causing execution of untrusted code during analysis. In the context of a smart-contract audit skill that processes third-party repositories, this is more dangerous because the script is expected to run inside potentially adversarial project directories.

Content

No source excerpt is available for this finding.

Excessive Permissions

Low
Category
Privilege Escalation
Confidence
80% confidence
Finding

Skill requests more permissions than appear necessary for its stated functionality. Review if elevated access is justified.

Content

Scanner excerpt · references/owasp-sc-top10.md (reported line 102)May include surrounding context.

md
- Missing `initializer` modifier / can call `initialize()` twice
- Function selector clashes
- `selfdestruct` in implementation
- Missing upgrade access controls
**Code pattern:** `delegatecall`, `initializer`, `_disableInitializers()`

External Script Fetching

Low
Category
Supply Chain
Confidence
91% confidence
Finding

The script prints guidance to install Rust using a remote shell script from rustup.rs, which has the same supply-chain risk pattern as any curl-to-sh installer. Although it is only echoed and not automatically executed by this script, the skill context encourages users to run it manually, so a compromise of the remote installer could still lead to arbitrary code execution.

Content

Scanner excerpt · scripts/install-tools.sh (reported line 60)May include surrounding context.

sh
cargo install aderyn
    else
        echo "⚠️  Rust/cargo not found. Install Rust first:"
        echo "   curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y"
        echo "   source ~/.cargo/env && cargo install aderyn"
    fi
fi