SC02:2026 - ビジネスロジックの脆弱性 (Business Logic Vulnerabilities)
説明
事例 (脆弱な融資ロジック)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
contract VulnerableLending {
mapping(address => uint256) public collateral;
mapping(address => uint256) public debt;
uint256 public collateralFactorBps = 7500; // 75%
function depositCollateral() external payable {
collateral[msg.sender] += msg.value;
}
// Vulnerable: calculates borrow capacity using the *new* amount, not total
function borrow(uint256 amount) external {
uint256 allowed = (amount * collateralFactorBps) / 10_000;
require(allowed >= amount, "not enough collateral"); // meaningless check
debt[msg.sender] += amount;
// send tokens from pool (omitted)
}
}事例 (修正: 不変式ベースの借用ロジック)
2025 ケーススタディ
ベストプラクティスと緩和策
PreviousSC01:2026 - アクセス制御の脆弱性 (Access Control Vulnerabilities)NextSC03:2026 - 価格オラクル操作 (Price Oracle Manipulation)
Last updated