A borrower's last repay block is not reset when their debt is written off, so a later loan can be written off immediately by any member before the overdue delay expires, causing the staker to lose their stake. An attacker could repeatedly borrow and have the loan written off instantly.
The repayBorrow function in UToken calls UserManager's updateFrozenInfo when a borrower is overdue, but that function is restricted to the comptroller, causing the repayment to revert. As a result, overdue borrowers cannot repay their debt, permanently freezing lenders' funds.
When a borrower pays only interest without prepayment, the updateLocked() function updates only the first active vouch's lastUpdated timestamp, causing all other stakers to lose rewards because their vouches appear overdue. An attacker could exploit this by making a small interest payment to harm other stakers' rewards.
The cancelVouch function removes a vouch by swapping it with the last element, breaking the first-in-first-out order of the vouchers array. This can cause some stakers' funds to be locked for longer than expected or permanently if the borrower defaults, because repayments are allocated based on array order.
The reward calculation only updates when a user calls stake, unstake, or withdrawRewards, so a staker can wait a long time, then briefly lend to themselves to become a member and immediately withdraw rewards, receiving the maximum multiplier for the entire period without bearing credit risk or paying interest. This inflates UNION emissions and dilutes honest holders.
The rewards multiplier for stakers in Union Finance is calculated based solely on whether a stake is locked, not on how long it has been locked. An attacker can lock a stake, vouch for another member, have that member borrow, then withdraw rewards with the full multiplier and repay the loan in the same transaction, gaining extra rewards without risking funds.
The rebalance function in AssetManager calls withdrawAll on every money market adapter, even when the adapter holds a zero balance of the token. Because Aave V3 rejects withdrawals of zero amount, the entire rebalance transaction reverts if any single money market has no balance.
The getFrozenInfo function iterates over the vouchees array and performs gas-intensive operations, which could cause it to revert due to out-of-gas when the array is large. This would affect any function that calls getFrozenInfo.
Several smart contract functions downcast uint256 values to uint96 or uint128 without checking, so large amounts are silently truncated. An attacker could borrow or stake amounts whose truncated accounting values no longer match the funds moved, breaking the contract's internal accounting.
The AssetManager's withdraw function can return less than the requested amount when underlying lending pools lack liquidity, but all calling functions (unstake, borrow, redeem, removeReserves) assume the full amount was transferred and update user balances accordingly. This leaves the shortfall permanently frozen for the user, as their accounting shows a full withdrawal while the actual funds remain in the strategy.
The AssetManager::withdraw function returns true even when it could not transfer the full requested amount, leaving a non-zero remainder. Callers such as UserManager and UToken trust the true result and update their accounting as if the full amount had been paid out, so users may receive less than they unstaked, borrowed or redeemed.
The AssetManager contract grants unlimited token approvals to adapters and markets when they are added, but removing an adapter or token does not revoke these approvals. An attacker could exploit a vulnerability in a removed adapter or token to drain any funds held in the AssetManager's balance.
In Comptroller::withdrawRewards, totalFrozen was subtracted twice from totalStaked, causing gInflationIndex to be updated with an incorrect value. If more than half of totalStaked is frozen, the function reverts, blocking stake, unstake and withdrawRewards.
The frozen coin age used to compute staker rewards was reset whenever a borrower took out any new loan, even a tiny one, so a staker could have their borrowers borrow a minimal amount to clear the overdue penalty and claim rewards at the maximum multiplier. This let a staker obtain inflated UNION token issuance and dilute other holders.
The public debt write-off function reverts when it tries to fully remove a voucher because the internal cancellation function has stricter access controls. An attacker cannot exploit this, but it prevents full removal of bad debt, leaving dust vouchers that increase gas costs over time.
The getUserInfo() function in UnionLens.sol returns the locked and stakedAmount values swapped because it destructures the Staker struct in the wrong order. Any user or front end calling this function receives incorrect staking information, which could lead to wrong decisions.
The cancelVouch function in UserManager moves the last element of the vouchers and vouchees arrays to fill the deleted slot but fails to update the corresponding index mappings for the moved element. This leaves stale indices that cause functions like getLockedStake and updateTrust to revert or return incorrect values, potentially allowing a borrower to exploit incorrect trust/locked amounts and freeze the staker's funds.
The repayBorrow function in UToken calls updateFrozenInfo with the borrower's address instead of the staker's address, so the staker's frozen coin age information is not updated when a borrower repays an overdue loan. This can lead to stale totalFrozen values being used in Comptroller reward calculations, resulting in incorrect UNION reward distribution.
The withdraw sequence array grows indefinitely because removing an adapter does not shrink it, while adding an adapter increases it. Over time, withdrawals iterate over an ever-longer array, raising gas costs and potentially making withdrawals economically unviable or impossible.
The updateTrust function checks the maxVouchers limit for the vouchees array but not for the vouchers array, so a borrower's vouchers list can grow without bound. This could cause updateLocked to fail due to gas exhaustion when iterating over a large vouchers array.
A malicious member can repeatedly vouch for a victim with a zero trust amount, filling the victim's vouchers array. This makes loops over that array unbounded, so the victim's borrow, repay, and registration transactions run out of gas and fail.
The contract's removeAdapter and removeToken functions do not check whether the adapter or token still holds funds. An attacker could cause funds to be locked or removed from total TVL by triggering removal of an adapter or token that still holds assets.
The asset manager's deposit, withdraw and rebalance functions loop over all money market adapters without handling failures, so if one adapter is broken or paused the whole call reverts. An attacker could not directly exploit this, but a paused Aave V2 pool would block deposits, withdrawals and rebalances on every other adapter.
UF
Union Finance
Medium
Instant results are busy. Press Enter to search every report.
No direct matches. Search every report above, or try a bug class like IDOR or SSRF.