CVE Professor
/
All CVEs
CVE-2026-141545

CVE-2026-141545 — Capminal Capminal-contracts — CWE-682

HIGH CVSS 8.7 ⚡ EPSS 0.5% Shodan

Capminal Contracts are the open-source smart contracts powering the Capminal protocol. Prior to commit 3e26129, capminal-contracts calculates the amount of CAPU minted by ScapStaking.lockAndMintCapu using the mint rate at the pre-mint supply for the entire transaction. A user can therefore receive more CAPU than intended in a single large mint, because the calculation does not account for the increasing mint rate as supply grows. This issue is fixed in commit 3e26129.

Capminal Contracts are the open-source smart contracts powering the Capminal protocol. Prior to commit 3e26129, capminal-contracts calculates the amount of CAPU minted by ScapStaking.lockAndMintCapu using the mint rate at the pre-mint supply for the entire transaction. A user can therefore receive more CAPU than intended in a single large mint, because the calculation does not account for the increasing mint rate as supply grows. This issue is fixed in commit 3e26129.

CVSS v4.0 Vector Metrics
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Attack Vector Network AV:N
Attack Complexity Low AC:L
Attack Reqs. None AT:N
Privileges Req. None PR:N
User Interaction None UI:N
Vuln. Conf. None VC:N
Vuln. Integrity High VI:H
Vuln. Avail. None VA:N
Subseq. Conf. None SC:N
Subseq. Integ. None SI:N
Subseq. Avail. None SA:N
Scope X S:X
EPSS — Exploit Prediction Scoring System
0.5%
30-day probability
In the 46. percentile of all CVEs — higher exploitation probability than most vulnerabilities.
AI Security Analysis & Remediation

🎯 What is this vulnerability?

This vulnerability is a Business Logic Error (CWE-682) specifically classified as an Inaccurate Calculation or State Dependency Flaw within a smart contract.

Technical Flaw:
The function ScapStaking.lockAndMintCapu in the capminal-contracts repository calculates the amount of CAPU tokens to be minted based on a "mint rate." The critical flaw is that this calculation uses the pre-mint supply (the total supply of CAPU before the current transaction is executed) to determine the rate for the entire transaction.

In many staking or inflationary token models, the mint rate is often inversely proportional to the current supply (e.g., rate = constant / currentSupply) or follows a curve that changes as supply increases. Because the contract does not update the supply variable incrementally during the calculation of a large mint, or it uses a static snapshot of the supply for the whole operation, an attacker can exploit the discrepancy between the calculated rate (based on low supply) and the actual economic impact (which should account for the rising supply during the mint).

Essentially, if the mint rate decreases as supply increases, using the pre-mint supply (which is lower) results in a higher calculated rate than what should apply to the latter portion of the mint. This allows an attacker to mint more tokens than the protocol's economic model intends for a single large transaction.

CVSS Vector Analysis:

  • AV:N/AC:L/PR:N/UI:N: The vulnerability is exploitable over the network (blockchain) with low complexity, no privileges, and no user interaction. This is standard for smart contract logic bugs.

  • VI:H (Integrity High): The primary impact is on the integrity of the token supply. The attacker can alter the total supply of CAPU beyond intended limits.

  • VC:N/VA:N: No direct impact on confidentiality or availability.
  • ⚡ Attack Chain

    1. Discovery & Reconnaissance

  • Target Identification: The attacker identifies that a specific dApp or DeFi protocol is using the capminal-contracts library. This can be done by:
  • * Checking the deployed contract bytecode on a block explorer (e.g., Etherscan) and matching it against known vulnerable versions of capminal-contracts. * Monitoring transaction logs for calls to the ScapStaking contract.
  • Version Verification: The attacker verifies that the deployed contract version is prior to commit 3e26129. This can be confirmed by checking the contract's source code if verified, or by analyzing the function selector and logic behavior via static analysis tools like Slither or Mythril.
  • Parameter Analysis: The attacker analyzes the lockAndMintCapu function to understand the input parameters (e.g., amountToLock, recipient) and the internal logic for calculating capuToMint.
  • 2. Exploitation

    The attacker crafts a single transaction that calls ScapStaking.lockAndMintCapu with a large amountToLock value. The goal is to maximize the discrepancy between the pre-mint supply-based rate and the actual supply growth during the mint.

    Illustrative PoC (Solidity Script):
    Note: The exact function signature and variable names are illustrative based on the CVE description. The attacker must reverse-engineer the specific contract interface.

    // SPDX-License-Identifier: MIT
    pragma solidity ^0.8.0;
    
    interface IScapStaking {
        function lockAndMintCapu(uint256 amountToLock, address recipient) external payable;
        function getCapuSupply() external view returns (uint256);
    }
    
    contract Exploit {
        IScapStaking public staking;
    
        constructor(address stakingAddress) {
            staking = IScapStaking(stakingAddress);
        }
    
        function exploit() external {
            // 1. Check current supply
            uint256 currentSupply = staking.getCapuSupply();
            require(currentSupply > 0, "Supply is zero");
    
            // 2. Calculate a large amount to lock.
            // The attacker chooses an amount that triggers the maximum discrepancy.
            // This value depends on the specific mint rate formula in the contract.
            // For example, if rate = 1000000 / supply, a large mint will use the
            // initial low supply for the entire calculation, yielding a higher rate
            // than if the supply were updated incrementally.
            uint256 largeAmount = 1000 ether; // Illustrative value
    
            // 3. Call the vulnerable function
            // The contract will calculate capuToMint using the pre-mint supply
            // for the entire largeAmount, resulting in an inflated mint.
            staking.lockAndMintCapu{value: largeAmount}(largeAmount, address(this));
    
            // 4. Check the new supply
            uint256 newSupply = staking.getCapuSupply();
            // The difference (newSupply - currentSupply) will be higher than intended
            // by the protocol's economic model.
        }
    }

    Execution:
    1. The attacker deploys the Exploit contract or sends a direct transaction from an EOA.
    2. The transaction is submitted to the blockchain with sufficient gas and value (if lockAndMintCapu requires a payment).
    3. The contract executes lockAndMintCapu. Internally, it calculates capuToMint using the preMintSupply.
    4. The contract mints capuToMint tokens to the recipient.
    5. The total supply of CAPU increases by capuToMint, which is higher than the "fair" amount calculated with an incremental supply update.

    3. Post-exploitation

  • Token Dumping: The attacker, now holding an inflated amount of CAPU tokens, can sell them on decentralized exchanges (DEXs) or centralized exchanges (CEXs) if listed. This causes a price drop, harming other holders.
  • Protocol Devaluation: The increased supply reduces the value of CAPU, potentially breaking the economic incentives of the Capminal protocol (e.g., staking rewards become less valuable).
  • Reputation Damage: The exploit can lead to a loss of trust in the protocol, potentially causing a run on liquidity pools or a halt in new user adoption.
  • 🌍 Real World Impact

  • Confidentiality (VC:N): No impact. The vulnerability does not expose private data.
  • Integrity (VI:H): High Impact. The integrity of the token supply is compromised. The total supply of CAPU is artificially inflated beyond the protocol's intended economic model. This is a direct violation of the token's value proposition.
  • Availability (VA:N): No impact. The protocol remains operational.
  • Practical Consequences:

  • Financial Loss for Users: Existing CAPU holders suffer from dilution. The value of their tokens decreases as the supply increases without corresponding economic activity.

  • Protocol Instability: If the mint rate is tied to staking rewards or other economic parameters, the inflated supply can break these mechanisms, leading to a collapse in staking participation or liquidity.

  • Legal/Regulatory Risk: If the token is considered a security, the manipulation of its supply could have legal implications for the project team.
  • 🛡️ Remediation & Mitigation

    Exact Affected Versions and Upgrade Recommendation

  • Affected: All versions of capminal-contracts prior to commit 3e26129.
  • Fixed: Commit 3e26129 and later.
  • Recommendation: Immediately upgrade the deployed ScapStaking contract to a version that includes the fix from commit 3e26129. This typically involves deploying a new contract version and migrating state or using a proxy pattern if the original contract is upgradeable. If the contract is not upgradeable, a migration plan must be executed, which may involve pausing the protocol, migrating user balances, and deploying the fixed contract.
  • Actionable Workarounds

    1. Pause Minting: If the protocol has a pause mechanism, immediately pause the ScapStaking contract or the specific lockAndMintCapu function to prevent further exploitation. 2. Limit Mint Size: If a pause is not possible, implement a temporary limit on the maximum amountToLock per transaction to reduce the impact of the discrepancy. This is a partial mitigation and does not fix the root cause. 3. Access Control: Restrict access to lockAndMintCapu to only trusted addresses or a whitelist of users. This is a strong mitigation but may impact usability.

    Detection

  • Blockchain Monitoring: Monitor the ScapStaking contract for calls to lockAndMintCapu with unusually large amountToLock values.
  • Supply Anomaly Detection: Track the total supply of CAPU. A sudden, unexplained increase in supply that does not correlate with normal staking activity is a strong indicator of exploitation.
  • Transaction Analysis: Use tools like Tenderly or OpenZeppelin Defender to analyze transactions and flag those where the minted amount deviates significantly from the expected value based on the pre-mint supply.
  • Example Alert Rule (Pseudo-code for Blockchain Monitor):

    def check_mint_anomaly(tx):
        if tx.to == SCAP_STAKING_ADDRESS:
            if tx.function == "lockAndMintCapu":
                pre_mint_supply = get_supply_before(tx)
                expected_mint = calculate_expected_mint(tx.args.amountToLock, pre_mint_supply)
                actual_mint = get_minted_amount(tx)
                if actual_mint > expected_mint * 1.1:  # 10% tolerance
                    alert("Potential CWE-682 Exploit: Mint amount exceeds expected value")

    ⚠️ Urgency

  • CVSS Score: 8.7 (HIGH)
  • CISA KEV: No
  • Exploit Complexity: Low (AC:L)
  • Priority: CRITICAL
Rationale: Although not in CISA KEV, the vulnerability is easily exploitable (no authentication, no user interaction) and has a high impact on the integrity of the token supply. In the DeFi space, such vulnerabilities can lead to immediate and significant financial losses for users and the protocol. The fix is available (commit 3e26129), so there is no reason to delay patching.

Action Plan:
1. Immediate: Pause the vulnerable function if possible.
2. Short-term (24-48 hours): Deploy the fixed version of the contract.
3. Medium-term: Audit the entire codebase for similar calculation errors and implement comprehensive testing for edge cases in minting logic.

[🤖 CVE Professor AI Security Engine]

Target Reconnaissance Queries (FOFA & Shodan)

FOFA Query

app="Capminal capminal-contracts"
PoC & Exploit Intelligence (GitHub)
Technical reference / advisory repository for CVE-2026-141545
Technical reference / advisory repository for CVE-2026-141545
Technical reference / advisory repository for CVE-2026-141545
Technical reference / advisory repository for CVE-2026-141545
CVSS Score
8.7 / 10 · CVSS HIGH
Weakness Types (CWE)
CWE-682
Affected Products (1)
Capminal:capminal-contracts
References & Advisories (4)
Related CVEs
5.6
CVE-2026-141355
Incorrect calculation in the TPM device handling of Canonical LXD before 5.0.13, 5.21.11, and 6.10.3 allows an
9.3
CVE-2026-144337
osTicket before 1.17.9 and 1.18.0 before 1.18.5 contains an unauthenticated stored cross-site scripting vulner
9.2
CVE-2026-144579
curl_cffi 0.15.0 through 0.17.0 contains a server-side request forgery protection bypass in allow_redirects='s
9.2
CVE-2026-144598
Homebox 0.22.0-rc.2 through 0.27.1 contains an authentication bypass vulnerability in UserService.LoginOIDC th
9.2
CVE-2026-145153
LangChain4j before 1.5.4-beta11, 1.11.12-beta19, 1.19.4-beta29, and 1.23.0-beta33 contains an injection vulner
9.1
CVE-2026-144956
Hoverfly before 1.12.17 contains an improper certificate validation vulnerability in GetHttpClient in core/htt
8.8
CVE-2026-77417
Local CI is a ground-up rewrite of the GitHub Actions orchestration layer that runs entirely on a personal mac