重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
solidity-audit by 0xlayerghost/solidity-agent-kit
npx skills add https://github.com/0xlayerghost/solidity-agent-kit --skill solidity-audit用法:此技能用于安全审计和代码审查。它不会自动调用——在审查合约漏洞时调用
/solidity-audit。
| 变体 | 描述 | 检查项 |
|---|---|---|
| 同函数重入 | 攻击者通过 fallback/receive 函数重新进入同一函数 | 状态更新后的所有外部调用(CEI 模式)? |
| 跨函数重入 | 攻击者重新进入共享状态的另一个函数 | 所有涉及共享状态的函数是否都受 nonReentrant 保护? |
| 跨合约重入 | 攻击者通过读取陈旧状态的其他合约重新进入 | 外部合约无法读取中间状态? |
| 只读重入 | 视图函数在执行中途返回陈旧数据 |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 在状态转换期间,没有关键视图函数被用作预言机? |
案例:GMX v1 (2025年7月,4200万美元) — Arbitrum 上 GLP 池的重入攻击,攻击者循环提款以耗尽流动性。
| 检查项 | 详情 |
|---|---|
| 缺少修饰器 | 每个状态更改函数都有明确的访问控制吗? |
| 修饰器逻辑 | 修饰器在失败时确实回滚(不仅仅是空检查)? |
| 状态标志 | 一次性访问模式在每个用户后正确更新存储吗? |
| 管理员权限范围 | 所有者权限是最小且有时限的吗? |
案例:Bybit (2025年2月,14亿美元) — Safe{Wallet} UI 被注入恶意 JS,劫持了签名过程。这不是合约缺陷,而是基础设施层的访问控制问题。
| 检查项 | 详情 |
|---|---|
| 零地址 | 所有地址参数都拒绝 address(0) 吗? |
| 零金额 | 资金转账拒绝零金额吗? |
| 数组边界 | 配对数组是否验证了匹配长度? |
| 任意调用 | 没有未经验证的 address.call(data),其中攻击者控制 data? |
| 数值边界 | 输入是否有边界以防止粉尘攻击或 gas 阻塞? |
| 变体 | 机制 | 防御措施 |
|---|---|---|
| 价格操纵 | 闪电贷 → 交换以移动价格 → 利用价格相关逻辑 → 偿还 | 带最小流动性检查的 TWAP 预言机 |
| 治理攻击 | 闪电贷治理代币 → 投票 → 在同一区块内偿还 | 快照投票 + 最低持有期 + 时间锁 ≥ 48小时 |
| 清算攻击 | 闪电贷 → 操纵抵押品价值 → 触发清算 | 多预言机价格验证 + 熔断机制 |
| 组合攻击(舍入) | 闪电贷 → 操纵池 → 利用舍入进行微提款 → 偿还 | 最低提款金额 + 虚拟份额 |
案例:
| 检查项 | 详情 |
|---|---|
| 单一预言机依赖 | 使用多个独立的价格来源吗? |
| 陈旧价格 | 检查 updatedAt 时间戳并拒绝旧数据吗? |
| 现货价格使用 | 从不使用原始 AMM 储备金进行定价吗? |
| 最小流动性 | 如果池储备金低于阈值,预言机是否回滚? |
| 价格偏差 | 如果价格相对于已知最后价格移动超出阈值,是否有熔断机制? |
| Chainlink 轮次完整性 | 检查 answeredInRound >= roundId 吗? |
案例:Cream Finance (2021年10月,1.3亿美元) — 攻击者通过减少供应来操纵 yUSD 金库价格,然后使用膨胀的抵押品耗尽所有借贷池。
| 类型 | 描述 | 防御措施 |
|---|---|---|
| 原始溢出 | uint256 a = uint8(b) + 1 — 如果 b=255 在 Solidity ≥0.8 上会回滚 | 使用一致的类型,避免隐式缩小 |
| 截断 | int8(int256Value) — 即使在 ≥0.8 版本上也会静默溢出 | 对所有类型缩小使用 SafeCast 库 |
| 舍入 / 精度损失 | usdcAmount / 1e12 对于小金额总是舍入到 0 | 先乘后除;检查零结果 |
| 先除后乘 | (a / b) * c 会损失精度 | 总是 (a * c) / b |
案例:Bunni (2025年9月,840万美元) — 微提款中的舍入错误通过闪电贷被利用。
| 类型 | 描述 | 防御措施 |
|---|---|---|
| ecrecover 返回 address(0) | 无效签名返回 address(0),而不是回滚 | 总是检查 recovered != address(0) |
| 重放攻击 | 相同签名在跨交易/链上被重用 | 在签名数据中包含 chainId + nonce + deadline |
| 签名可塑性 | ECDSA 每个签名有两个有效的 (s, v) 对 | 使用 OpenZeppelin ECDSA.recover(强制低 s) |
| 空循环绕过 | 签名验证在 for 循环中,攻击者发送空数组 | 在循环前检查 signatures.length >= requiredCount |
| 缺少 msg.sender 绑定 | 证明/签名未绑定到调用者 | 总是在签名/证明数据中包含 msg.sender |
| 问题 | 描述 | 防御措施 |
|---|---|---|
| 转账手续费 | transfer(100) 可能实际交付 <100 个代币 | 检查转账前后的余额,使用实际接收金额 |
| 变基代币 | 代币余额在没有转账的情况下发生变化 | 永不缓存外部余额;总是读取实时余额 |
| 无布尔返回值 | 某些代币(如 USDT)在转账时不返回布尔值 | 使用 SafeERC20.safeTransfer |
| ERC777 钩子 | 转账钩子可能触发重入 | 在所有接收代币的函数上使用 ReentrancyGuard |
| 零金额转账 | transferFrom(A, B, 0) — 地址投毒 | 拒绝零金额转账 |
| 授权竞争 | 将授权从 N 改为 M 允许花费 N+M | 使用 safeIncreaseAllowance / safeDecreaseAllowance |
| 类型 | 描述 | 防御措施 |
|---|---|---|
| 三明治攻击 | 攻击者在受害者交易前后进行买卖 | 滑点保护 + 截止时间参数 |
| ERC4626 通胀攻击 | 首存者捐赠以抬高份额价格,使后续存者份额被舍入掉 | 最低首次存款或虚拟份额(带偏移量的 ERC4626) |
| 授权抢先交易 | 攻击者在新的授权交易确认前花费旧的授权 | 使用 increaseAllowance 而不是 approve |
| 无限制提款 | 攻击者监控内存池中的提款交易,用自己的交易抢先 | 要求提交-揭示或授权绑定 |
| 问题 | 描述 |
|---|---|
| 存储指针 | Foo storage foo = arr[0]; foo = arr[1]; — 不会更新 arr[0] |
| 嵌套删除 | delete structWithMapping — 内部映射数据仍然存在 |
| 私有变量 | 所有合约存储都可以通过 eth_getStorageAt 公开读取 |
| 不安全的 delegatecall | 对不受信任合约的 delegatecall 可以 selfdestruct 调用者 |
| 代理存储冲突 | 升级改变父类顺序 → 变量相互覆盖(使用存储间隙) |
| 循环中的 msg.value | msg.value 在循环中不减少 — 可能导致双花 |
| 方法 | 工作原理 |
|---|---|
| 构造函数调用 | 从构造函数发起攻击 — 部署期间 extcodesize == 0 |
| CREATE2 预计算 | 预计算合约地址,在部署前用作 EOA |
| 检查项 | 详情 |
|---|---|
_authorizeUpgrade 访问控制 | UUPS 的 _authorizeUpgrade 必须有 onlyOwner 修饰器吗? |
| 无权限工厂/注册表 | 攻击者可以使用无权限工厂(例如 Aquifer boreWell)来满足升级检查吗? |
upgradeTo 修饰器 | 重写的 upgradeTo/upgradeToAndCall 保留了 onlyProxy 修饰器吗? |
| 初始化器保护 | initializer 修饰器防止重新初始化吗?实现调用了 _disableInitializers() 吗? |
| 存储布局兼容性 | 升级安全的存储布局(存储间隙或 ERC-7201 命名空间)? |
案例:Code4rena 2024-07-basin H-01 (via EVMbench Paper Fig.12, p.19) — _authorizeUpgrade 只检查了 delegatecall 和 Aquifer 注册,但缺少 onlyOwner,允许任何人将 Well 代理升级到恶意实现并耗尽资金。补丁:添加一个 onlyOwner 修饰器。
来源:EVMbench Paper §4.2.1, Fig.6 / Code4rena 2024-04-noya H-08, 2024-07-benddao
| 检查项 | 详情 |
|---|---|
| 跨金库信任隔离 | 注册表/路由器中继调用验证金库级授权吗? |
| 受信任发送者滥用 | 像 sendTokensToTrustedAddress 这样的函数验证来源金库,而不仅仅是路由器身份吗? |
| 闪电贷 + 路由组合 | 攻击者可以使用闪电贷回调让路由器冒充任意金库吗? |
| 抵押品所有权验证 | 清算/质押操作验证实际的 NFT/抵押品所有者吗? |
| 跨合约状态依赖 | 多合约交互没有中间状态依赖吗? |
案例:
sendTokensToTrustedAddress 耗尽跨金库资金isolateLiquidate 没有验证 NFT 所有权,允许攻击者传递他人的 tokenId 进行清算| 检查项 | 详情 |
|---|---|
| 计数器/ID 递增顺序 | credIdCounter++ 或类似的 ID 递增发生在外部调用之前吗? |
| 创建时的自动购买 | 带有自动 buy() 调用的 create() 函数仅在 ID/状态完全初始化后执行吗? |
| 退款时机 | ETH 退款(超额)在所有状态更新完成后发生吗? |
| 绑定曲线元数据覆盖 | 攻击者可以重入以修改绑定曲线/定价参数 — 低价买入,切换到昂贵曲线,高价卖出吗? |
案例:Code4rena 2024-08-phi H-06 (via EVMbench Paper Appendix H.1, p.25-28) — _createCredInternal 在递增 credIdCounter 之前调用了 buyShareCred;_handleTrade 在更新 lastTradeTimestamp 之前退还了超额 ETH。攻击者重入以在廉价曲线上积累份额,将元数据覆盖为昂贵曲线,然后卖出以耗尽合约中的所有 ETH。修复:在 buyShareCred/sellShareCred 上添加 nonReentrant。
攻击者将恶意代码注入 dApp 前端或签名界面。
防御措施:在签名前验证交易 calldata 是否匹配预期的函数选择器和参数。使用带设备上交易预览的硬件钱包。定期审计所有前端依赖项。
案例:Bybit (2025年2月,14亿美元) — 恶意 JavaScript 注入 Safe{Wallet} UI,在签名期间篡改交易数据。
私钥泄露在 2025-2026 年仍然是第一大损失来源。
防御措施:将密钥存储在 HSM 或硬件钱包中。对所有金库和管理操作使用多签(≥ 3/5)。切勿与任何“支持”联系人共享助记词。定期进行社会工程意识培训。
案例:Step Finance (2026年1月,3000万美元) — 金库钱包私钥通过设备泄露被窃取。
| 检查项 | 详情 |
|---|---|
| 继承的代码 | 审计从第三方框架继承的所有桥接逻辑 |
| 消息验证 | 跨链消息是否使用适当的签名和重放保护进行验证? |
| 流动性隔离 | 桥接资金与协议金库分离吗? |
案例:SagaEVM (2026年1月,700万美元) — 从 Ethermint 继承了有漏洞的 EVM 预编译桥接逻辑。
带有已知漏洞的旧合约在链上永远可调用。
防御措施:永久 pause 或从已弃用合约迁移资金。监控旧合约地址的异常活动。在弃用前移除铸币/管理功能。
案例:Truebit (2026年1月,2640万美元) — Solidity 0.6.10 合约缺少溢出保护,攻击者以近乎零的成本铸造代币。
当配置了 slither MCP 时,在下面的手动清单之前运行自动化分析:
Step 1: slither MCP 自动化扫描
→ get_detector_results(path, impact="High")
→ get_detector_results(path, impact="Medium")
Step 2: 审查 Slither 发现 — 筛选真阳性与假阳性
Step 3: 下面的手动清单 — 捕获 Slither 遗漏的内容(业务逻辑、经济攻击)
Step 4: 交叉引用 — Slither + 手动发现合并成最终报告
| 工具 | 用途 | 补充 |
|---|---|---|
get_contract_metadata | 提取函数、继承关系、标志 | 手动访问控制审查 |
get_function_source | 获取带行号的精确源代码 | 比 grep 更快定位代码 |
find_implementations | 查找函数签名的所有实现 | 跨合约重入分析 |
get_detector_results | 运行 90+ 个安全检测器,按影响/置信度过滤 | 手动清单的自动化版本 |
get_detector_metadata | 列出带描述的可用检测器 | 了解正在检查的内容 |
| Slither 擅长捕获 | 仍需手动审查 |
|---|---|
| 重入模式 | 业务逻辑缺陷 |
| 未受保护的函数 | 经济攻击向量(闪电贷组合) |
| 未使用的状态变量 | 跨协议可组合性风险 |
| 变量遮蔽问题 | 预言机操纵场景 |
| 不正确的 ERC20 接口 | 信任边界架构问题 |
| 死代码 | 特定于业务逻辑的 MEV/抢先交易 |
关键原则:Slither 通过静态分析提供基本事实 — 减少了已知漏洞模式的漏报。但它无法推理协议级的经济攻击 — 这正是下面手动清单必不可少的地方。
优雅降级:如果未配置 slither MCP,请跳过此部分并直接进行手动清单。所有清单项仍然有效且自包含。
进行安全审计时,检查每一项:
重入攻击:
nonReentrant访问控制:
输入与逻辑:
call / delegatecalltx.origin 进行身份验证代币处理:
SafeERC20价格与预言机:
updatedAt / answeredInRound)签名与加密:
ecrecover 结果与 address(0) 对比检查chainId、nonce、msg.sender、deadlineECDSA(强制低 s)msg.sender闪电贷防御:
代理与升级 (EVMbench):
_authorizeUpgrade 有 onlyOwner — [EVMbench/basin H-01]upgradeTo/upgradeToAndCall 保留了 onlyProxy — [EVMbench/basin H-01]_disableInitializers() — [EVMbench/basin H-01]信任边界与可组合性 (EVMbench):
状态排序 (EVMbench):
基础设施:
来源:EVMbench (OpenAI/Paradigm, Feb 2026) — 在 40 个 Code4rena 审计仓库的 120 个高严重性漏洞上评估了 AI 代理在检测/修补/利用模式下的表现。
来源:EVMbench Table 4 (p.17) — 40 个审计仓库
来源:EVMbench Paper §4.1 (p.7), Fig.7 (p.10), Fig.10 (p.18), Fig.11 (p.19)
| 日期 | 项目 | 损失 | 攻击类型 | 根本原因 | 来源 |
|---|---|---|---|---|---|
| 2021年10月 | Cream Finance | 1.3亿美元 | 闪电贷 + 预言机 | 通过减少供应操纵 yUSD 金库价格 | rekt.news |
| 2025年2月 | Bybit | 14亿美元 | UI 注入 / 供应链 | Safe{Wallet} JS 通过受感染的开发机器被篡改 | NCC Group |
| 2025年3月 | Abracadabra | 1300万美元 | 逻辑缺陷 | cauldron 清算中的状态跟踪错误 | Halborn |
| 2025年7月 | GMX v1 | 4200万美元 | 重入攻击 | Arbitrum 上 GLP 池的跨合约重入 | Halborn |
| 2025年9月 | Bunni | 840万美元 | 闪电贷 + 舍入 | 提款中的舍入方向错误,44 次微提款 | The Block |
| 2025年10月 | Abracadabra #2 | 180万美元 | 逻辑缺陷 | cook() 验证标志重置,无抵押 MIM 借款 | Halborn |
| 2026年1月 | Step Finance | 3000万美元 | 密钥泄露 | 金库钱包私钥通过设备泄露被窃取 | Halborn |
| 2026年1月 | Truebit | 2640万美元 | 遗留合约 | Solidity 0.6.10 铸币定价中的整数溢出 | CoinDesk |
| 2026年1月 | SagaEVM | 700万美元 | 供应链 / 桥接 | 继承了 Ethermint 预编译桥接漏洞 | The Block |
每周安装数
43
仓库
GitHub 星标数
1
首次出现
2026年2月15日
安全审计
安装在
claude-code34
cursor33
codex33
gemini-cli32
opencode32
kimi-cli31
Usage : This skill is for security audits and code reviews. It is NOT auto-invoked — call
/solidity-auditwhen reviewing contracts for vulnerabilities.
| Variant | Description | Check |
|---|---|---|
| Same-function | Attacker re-enters the same function via fallback/receive | All external calls after state updates (CEI pattern)? |
| Cross-function | Attacker re-enters a different function sharing state | All functions touching shared state protected by nonReentrant? |
| Cross-contract | Attacker re-enters through a different contract that reads stale state | External contracts cannot read intermediate state? |
| Read-only | View function returns stale data during mid-execution state | No critical view functions used as oracle during state transitions? |
Case : GMX v1 (Jul 2025, $42M) — reentrancy in GLP pool on Arbitrum, attacker looped withdrawals to drain liquidity.
| Check | Detail |
|---|---|
| Missing modifier | Every state-changing function has explicit access control? |
| Modifier logic | Modifier actually reverts on failure (not just empty check)? |
| State flag | Access-once patterns properly update storage after each user? |
| Admin privilege scope | Owner powers are minimal and time-limited? |
Case : Bybit (Feb 2025, $1.4B) — Safe{Wallet} UI injected with malicious JS, hijacked signing process. Not a contract flaw, but access control at the infrastructure layer.
| Check | Detail |
|---|---|
| Zero address | All address params reject address(0)? |
| Zero amount | Fund transfers reject zero amounts? |
| Array bounds | Paired arrays validated for matching length? |
| Arbitrary call | No unvalidated address.call(data) where attacker controls data? |
| Numeric bounds | Inputs bounded to prevent dust attacks or gas griefing? |
| Variant | Mechanism | Defense |
|---|---|---|
| Price manipulation | Flash-borrow → swap to move price → exploit price-dependent logic → repay | TWAP oracle with min-liquidity check |
| Governance | Flash-borrow governance tokens → vote → repay in same block | Snapshot voting + minimum holding period + timelock ≥ 48h |
| Liquidation | Flash-borrow → manipulate collateral value → trigger liquidation | Multi-oracle price verification + circuit breaker |
| Combo (rounding) | Flash-borrow → manipulate pool → micro-withdrawals exploit rounding → repay | Minimum withdrawal amount + virtual shares |
Cases :
| Check | Detail |
|---|---|
| Single oracle dependency | Using multiple independent price sources? |
| Stale price | Checking updatedAt timestamp and rejecting old data? |
| Spot price usage | Never using raw AMM reserves for pricing? |
| Minimum liquidity | Oracle reverts if pool reserves below threshold? |
| Price deviation | Circuit breaker if price moves beyond threshold vs last known? |
| Chainlink round completeness | Checking answeredInRound >= roundId? |
Case : Cream Finance (Oct 2021, $130M) — attacker manipulated yUSD vault price by reducing supply, then used inflated collateral to drain all lending pools.
| Type | Description | Defense |
|---|---|---|
| Primitive overflow | uint256 a = uint8(b) + 1 — reverts if b=255 on Solidity ≥0.8 | Use consistent types, avoid implicit narrowing |
| Truncation | int8(int256Value) — silently overflows even on ≥0.8 | Use SafeCast library for all type narrowing |
| Rounding / precision loss | usdcAmount / 1e12 always rounds to 0 for small amounts | Multiply before divide; check for zero result |
| Division before multiplication | (a / b) * c loses precision | Always |
Case : Bunni (Sep 2025, $8.4M) — rounding errors in micro-withdrawals exploited via flash loan.
| Type | Description | Defense |
|---|---|---|
| ecrecover returns address(0) | Invalid sig returns address(0), not revert | Always check recovered != address(0) |
| Replay attack | Same signature reused across txs/chains | Include chainId + nonce + deadline in signed data |
| Signature malleability | ECDSA has two valid (s, v) pairs per signature | Use OpenZeppelin ECDSA.recover (enforces low-s) |
| Empty loop bypass |
| Issue | Description | Defense |
|---|---|---|
| Fee-on-transfer | transfer(100) may deliver <100 tokens | Check balance before/after, use actual received amount |
| Rebase tokens | Token balances change without transfers | Never cache external balances; always read live |
| No bool return | Some tokens (USDT) don't return bool on transfer | Use SafeERC20.safeTransfer |
| ERC777 hooks | Transfer hooks can trigger reentrancy | Use ReentrancyGuard on all token-receiving functions |
| Zero-amount transfer | transferFrom(A, B, 0) — address poisoning |
| Type | Description | Defense |
|---|---|---|
| Sandwich attack | Attacker front-runs buy + back-runs sell around victim | Slippage protection + deadline parameter |
| ERC4626 inflation | First depositor donates to inflate share price, rounding out later depositors | Minimum first deposit or virtual shares (ERC4626 with offset) |
| Approval front-run | Attacker spends old allowance before new allowance tx confirms | Use increaseAllowance not approve |
| Unrestricted withdrawal | Attacker monitors mempool for withdraw tx, front-runs with own | Require commit-reveal or auth binding |
| Issue | Description |
|---|---|
| Storage pointer | Foo storage foo = arr[0]; foo = arr[1]; — does NOT update arr[0] |
| Nested delete | delete structWithMapping — inner mapping data persists |
| Private variables | All contract storage is publicly readable via eth_getStorageAt |
| Unsafe delegatecall | Delegatecall to untrusted contract can selfdestruct the caller |
| Proxy storage collision | Upgrade changes parent order → variables overwrite each other (use storage gaps) |
| msg.value in loop | msg.value doesn't decrease in loop — enables double-spend |
| Method | How it works |
|---|---|
| Constructor call | Attack from constructor — extcodesize == 0 during deployment |
| CREATE2 pre-compute | Pre-calculate contract address, use as EOA before deploying |
Source: EVMbench Paper §4.2, Appendix H / Code4rena 2024-07-basin H-01
| Check | Detail |
|---|---|
_authorizeUpgrade access control | UUPS _authorizeUpgrade must have onlyOwner modifier? |
| Permissionless factory/registry | Can attacker use permissionless factory (e.g. Aquifer boreWell) to satisfy upgrade checks? |
upgradeTo modifier | Overridden upgradeTo/upgradeToAndCall retains onlyProxy modifier? |
Case : Code4rena 2024-07-basin H-01 (via EVMbench Paper Fig.12, p.19) — _authorizeUpgrade only checked delegatecall and Aquifer registration but lacked onlyOwner, allowing anyone to upgrade a Well proxy to a malicious implementation and drain funds. Oracle patch: add a single onlyOwner modifier.
Source: EVMbench Paper §4.2.1, Fig.6 / Code4rena 2024-04-noya H-08, 2024-07-benddao
| Check | Detail |
|---|---|
| Cross-vault trust isolation | Registry/Router relay calls verify vault-level authorization? |
| Trusted sender abuse | Functions like sendTokensToTrustedAddress verify source vault, not just router identity? |
| Flash loan + routing combo | Can attacker use flash loan callback to make router impersonate arbitrary vault? |
| Collateral ownership verification | Liquidation/staking operations verify actual NFT/collateral owner? |
| Cross-contract state dependency | Multi-contract interactions free from intermediate state dependencies? |
Cases :
sendTokensToTrustedAddressisolateLiquidate did not verify NFT ownership, allowing attacker to pass others' tokenIds for liquidationSource: EVMbench Paper Appendix H.1, Fig.19-21 / Code4rena 2024-08-phi H-06
| Check | Detail |
|---|---|
| Counter/ID increment order | credIdCounter++ or similar ID increments happen before external calls? |
| Auto-buy in create | create() functions with auto buy() calls execute only after ID/state fully initialized? |
| Refund timing | ETH refund (excess) happens after all state updates complete? |
| Bonding curve metadata overwrite | Can attacker reenter to modify bonding curve/pricing params — buy cheap, switch to expensive curve, sell high? |
Case : Code4rena 2024-08-phi H-06 (via EVMbench Paper Appendix H.1, p.25-28) — _createCredInternal called buyShareCred before incrementing credIdCounter; _handleTrade refunded excess ETH before updating lastTradeTimestamp. Attacker reentered to accumulate shares on cheap curve, overwrote metadata to expensive curve, sold to drain all contract ETH. Fix: add nonReentrant to buyShareCred/sellShareCred.
Attackers inject malicious code into the dApp frontend or signing interface.
Defense : Verify transaction calldata matches expected function selector and parameters before signing. Use hardware wallet with on-device transaction preview. Audit all frontend dependencies regularly.
Case : Bybit (Feb 2025, $1.4B) — malicious JavaScript injected into Safe{Wallet} UI, tampered with transaction data during signing.
Compromised keys remain the #1 loss source in 2025-2026.
Defense : Store keys in HSM or hardware wallet. Use multisig (≥ 3/5) for all treasury and admin operations. Never share seed phrases with any "support" contact. Conduct regular social engineering awareness training.
Case : Step Finance (Jan 2026, $30M) — treasury wallet private keys compromised via device breach.
| Check | Detail |
|---|---|
| Inherited code | Audit all bridge logic inherited from third-party frameworks |
| Message verification | Cross-chain messages validated with proper signatures and replay protection? |
| Liquidity isolation | Bridge funds separated from protocol treasury? |
Case : SagaEVM (Jan 2026, $7M) — inherited vulnerable EVM precompile bridge logic from Ethermint.
Old contracts with known bugs remain callable on-chain forever.
Defense : Permanently pause or migrate funds from deprecated contracts. Monitor old contract addresses for unexpected activity. Remove mint/admin functions before deprecation.
Case : Truebit (Jan 2026, $26.4M) — Solidity 0.6.10 contract lacked overflow protection, attacker minted tokens at near-zero cost.
When slither MCP is configured, run automated analysis BEFORE the manual checklist below:
Step 1: slither MCP automated scan
→ get_detector_results(path, impact="High")
→ get_detector_results(path, impact="Medium")
Step 2: Review Slither findings — triage true positives vs false positives
Step 3: Manual checklist below — catch what Slither misses (business logic, economic attacks)
Step 4: Cross-reference — Slither + manual findings combined into final report
| Tool | Usage | Complements |
|---|---|---|
get_contract_metadata | Extract functions, inheritance, flags | Manual access control review |
get_function_source | Get exact source code with line numbers | Faster than grep for locating code |
find_implementations | Find all implementations of a function signature | Cross-contract reentrancy analysis |
get_detector_results | Run 90+ security detectors, filter by impact/confidence | Automated version of manual checklist |
get_detector_metadata |
| Slither Catches Well | Manual Review Still Needed |
|---|---|
| Reentrancy patterns | Business logic flaws |
| Unprotected functions | Economic attack vectors (flash loan combos) |
| Unused state variables | Cross-protocol composability risks |
| Shadowing issues | Oracle manipulation scenarios |
| Incorrect ERC20 interface | Trust boundary architecture issues |
| Dead code | MEV/front-running specific to business logic |
Key Principle : Slither provides ground truth via static analysis — reduces false negatives on known vulnerability patterns. But it cannot reason about protocol-level economic attacks — that's where the manual checklist below is essential.
Graceful degradation : If slither MCP is not configured, skip this section and proceed directly to the manual checklist. All checklist items remain valid and self-contained.
When conducting a security audit, check each item:
Reentrancy:
nonReentrantAccess Control:
Input & Logic:
call / delegatecalltx.origin for authenticationToken Handling:
SafeERC20Price & Oracle:
updatedAt / answeredInRound)Signature & Crypto:
ecrecover result checked against address(0)chainId, nonce, msg.sender, deadlineECDSA (low-s enforced)msg.senderFlash Loan Defense:
Proxy & Upgrade (EVMbench):
_authorizeUpgrade has onlyOwner — [EVMbench/basin H-01]upgradeTo/upgradeToAndCall retains onlyProxy — [EVMbench/basin H-01]_disableInitializers() — [EVMbench/basin H-01]Trust Boundary & Composability (EVMbench):
State Ordering (EVMbench):
Infrastructure:
Source: EVMbench (OpenAI/Paradigm, Feb 2026) — evaluated AI agents on 120 high-severity vulnerabilities from 40 Code4rena audit repositories across Detect/Patch/Exploit modes.
Source: EVMbench Table 4 (p.17) — 40 audit repositories
Source: EVMbench Paper §4.1 (p.7), Fig.7 (p.10), Fig.10 (p.18), Fig.11 (p.19)
| Date | Project | Loss | Attack Type | Root Cause | Source |
|---|---|---|---|---|---|
| Oct 2021 | Cream Finance | $130M | Flash loan + oracle | yUSD vault price manipulation via supply reduction | rekt.news |
| Feb 2025 | Bybit | $1.4B | UI injection / supply chain | Safe{Wallet} JS tampered via compromised dev machine | NCC Group |
| Mar 2025 | Abracadabra | $13M | Logic flaw | State tracking error in cauldron liquidation | Halborn |
| Jul 2025 | GMX v1 |
Weekly Installs
43
Repository
GitHub Stars
1
First Seen
Feb 15, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
claude-code34
cursor33
codex33
gemini-cli32
opencode32
kimi-cli31
Azure RBAC 权限管理工具:查找最小角色、创建自定义角色与自动化分配
159,600 周安装
(a * c) / b| Signature verification in for-loop, attacker sends empty array |
Check signatures.length >= requiredCount before loop |
| Missing msg.sender binding | Proof/signature not bound to caller | Always include msg.sender in signed/proven data |
| Reject zero-amount transfers |
| Approval race | Changing allowance from N to M allows spending N+M | Use safeIncreaseAllowance / safeDecreaseAllowance |
| Initializer protection | initializer modifier prevents re-initialization? Implementation calls _disableInitializers()? |
| Storage layout compatibility | Upgrade-safe storage layout (storage gaps or ERC-7201 namespace)? |
| List available detectors with descriptions |
| Understanding what's being checked |
| $42M |
| Reentrancy |
| GLP pool cross-contract reentrancy on Arbitrum |
| Halborn |
| Sep 2025 | Bunni | $8.4M | Flash loan + rounding | Rounding direction error in withdraw, 44 micro-withdrawals | The Block |
| Oct 2025 | Abracadabra #2 | $1.8M | Logic flaw | cook() validation flag reset, uncollateralized MIM borrow | Halborn |
| Jan 2026 | Step Finance | $30M | Key compromise | Treasury wallet private keys stolen via device breach | Halborn |
| Jan 2026 | Truebit | $26.4M | Legacy contract | Solidity 0.6.10 integer overflow in mint pricing | CoinDesk |
| Jan 2026 | SagaEVM | $7M | Supply chain / bridge | Inherited Ethermint precompile bridge vulnerability | The Block |