Back to skill

Security audit

Upgrade Solidity Contracts

Security checks for vulnerabilities and agentic risk

Overview

This is a transparent documentation-only skill for Solidity contract upgrades, with normal smart-contract and dependency-install risks but no hidden or deceptive behavior.

Install only in a development environment you trust. Pin dependency versions or commits, review lockfiles, and avoid running installs, Foundry ffi workflows, deployments, or upgrades where wallet keys, production RPC credentials, or upgrade authority are exposed unless you have explicitly approved that operation.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:153
Finding
Unpinned Third-Party Dependencies Create Supply-Chain Risk## Vulnerability Details **File Location**: `SKILL.md`, lines 153–154 and 181–183 **Vulnerability Type**: Unpinned executable dependencies **Risk Level**: Medium ### Vulnerable Code ```bash npm install --save-dev @openzeppelin/hardhat-upgrades npm install --save-dev @nomicfoundation/hardhat-ethers ethers # peer dependencies ``` ```bash forge install foundry-rs/forge-std forge install OpenZeppelin/openzeppelin-foundry-upgrades forge install OpenZeppelin/openzeppelin-contracts-upgradeable ``` Related configuration and behavior at lines 190 and 196: ```toml ffi = true ``` > Node.js is required — the library shells out to the OpenZeppelin Upgrades CLI for validation. ### Technical Analysis The installation commands do not specify exact npm versions, reviewed Git tags, or immutable commit hashes. Consequently, executing the instructions at different times can retrieve different code than the content originally reviewed. npm dependencies can execute lifecycle scripts during installation. Foundry dependencies contribute code to compilation and deployment workflows. The documented use of Foundry FFI and an external Node.js validation CLI expands the execution boundary: a compromised dependency may influence subprocess execution, generated artifacts, validation results, or deployment operations. This finding does not establish that the named upstream projects are malicious. The risk arises from mutable dependency resolution and the absence of explicit integrity controls. ### Attack Path 1. An attacker compromises an upstream package, repository, maintainer account, or package publication process. 2. The attacker publishes malicious code under a version or repository revision selected by the unpinned installation command. 3. A user or agent follows the Skill instructions and installs the dependency. 4. Malicious logic executes through an npm lifecycle script, the build process, imported Foundry code, or th ...[truncated 983 chars]
Remediation
## Remediation Suggestions 1. Pin every npm dependency to an audited exact version rather than a floating range, and commit the generated lockfile. 2. Use deterministic installation commands such as `npm ci` in CI and production-sensitive workflows. 3. Pin every Foundry dependency to a reviewed release tag or, preferably, an immutable commit hash. 4. Commit and review Foundry submodule references so dependency revisions cannot change silently. 5. Verify package integrity and use trusted registries and repository sources. 6. Review npm lifecycle scripts before installation; disable scripts where they are unnecessary. 7. Run dependency installation, compilation, and validation in an isolated environment without wallet keys or production credentials. 8. Enable FFI only for workflows that require it, restrict the commands and environment available to subprocesses, and disable it for ordinary builds. 9. Add automated dependency review, vulnerability scanning, and controlled update procedures so version changes require explicit security approval.
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (2)

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
All three use EIP-1967 storage slots for the implementation address, admin, and beacon.

> **Transparent proxy — v5 constructor change:** In v5, `TransparentUpgradeableProxy` automatically deploys its own `ProxyAdmin` contract and stores the admin address in an immutable variable (set at construction time, never changeable). The second constructor parameter is the **owner address** for that auto-deployed `ProxyAdmin` — do **not** pass an existing `ProxyAdmin` contract address here. Transfer of upgrade capability is handled exclusively through `ProxyAdmin` ownership. This differs from v4, where `ProxyAdmin` was deployed separately and its address was passed to the proxy constructor.

## Upgrade Restrictions Between Major Versions (v4 → v5)
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.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
All three use EIP-1967 storage slots for the implementation address, admin, and beacon.

> **Transparent proxy — v5 constructor change:** In v5, `TransparentUpgradeableProxy` automatically deploys its own `ProxyAdmin` contract and stores the admin address in an immutable variable (set at construction time, never changeable). The second constructor parameter is the **owner address** for that auto-deployed `ProxyAdmin` — do **not** pass an existing `ProxyAdmin` contract address here. Transfer of upgrade capability is handled exclusively through `ProxyAdmin` ownership. This differs from v4, where `ProxyAdmin` was deployed separately and its address was passed to the proxy constructor.

## Upgrade Restrictions Between Major Versions (v4 → v5)
Confidence
85% 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.

Static analysis

No suspicious patterns detected.