Skip to content

Sherlock

Union Finance Update #2

Every publicly disclosed report for Union Finance Update #2 and what kind of bugs they were.

disclosed reports
9
most reported class
Business logic
bug classes found
2
first disclosure
2024
Find Union Finance Update #2 on bugbounty.fyi Current scope, rewards and status, if it runs a public program.

Disclosed reports

Newest first. Only what Union Finance Update #2 chose to make public.

Business logic

Minimum borrow amount can be surpassed and borrower can be treated as being overdue earlier than their actual overdue time

The borrow function checks the minimum borrow amount before withdrawing from the asset manager, so if the asset manager can only return a dust amount or nothing, the borrow still succeeds with less than the minimum. This can set the borrower's last repayment timestamp early, marking them as overdue before the actual overdue time, which blocks them from borrowing or vouching and reduces lenders' staking rewards.

Union Finance Update #2

Medium
Business logic

VouchFaucet can be immediately drained by anyone

The claimTokens function in the VouchFaucet contract does not update the claimedTokens mapping, so the maxClaimable limit is never enforced. Any address can claim an arbitrary amount of any token, draining the contract's entire balance.

Union Finance Update #2

High
Business logic

Wrong calculation of Accure Reward in Comptroller.sol

The reward calculation in Comptroller.sol reads the global total staked before updating the frozen token amounts, so the value used is stale. This lets a user claim rewards on tokens that were just frozen.

Union Finance Update #2

High
Business logic

Repaying a Loan with Permit in UErc20.sol Wrongly calculates the interest to be paid this Reduce/Increase profits for the protocol as interest calculations are not performed correctly

The repayBorrowWithERC20Permit function in UEr20.sol passes an unscaled interest amount to _repayBorrowFresh, while the principal is scaled to 1e18. This causes users to pay incorrect interest for tokens with decimals other than 18, leading to lost or excess interest for the protocol.

Union Finance Update #2

High
Audit finding

`updateLocked()` locks a rounded down value

The `updateLocked()` function in the UToken contract rounds down the locked amount when adding a fee, which can cause the locked amount to be slightly less than the borrowed principal. This can prevent the full write-off of a debt, leaving a small residual principal and causing the borrower's position to be marked as overdue, blocking future borrows.

Union Finance Update #2

Medium
Business logic

Possible loss of funds, transfer functions can silently fail

The contracts use ERC20 transfer() without checking the return value, so tokens that return false on failure (like some non-standard tokens) can cause silent transfer failures, leading to loss of funds. Additionally, tokens like USDT that do not return a boolean will cause transfers to revert, making the functions unusable with those tokens.

Union Finance Update #2

Medium
Business logic

The _totalStaked tracker calculation is incorrect and will be inflated due to the improper logic in the writeOffDebt function of the UserManager contract, leading to wrong Comptroller gInflationIndex being calculated and wrong user rewards being issued

The debtWriteOff function in UserManager subtracts an unscaled amount from _totalStaked instead of the scaled actualAmount, causing the total staked value to be inflated. This inflated value is passed to the Comptroller, leading to an incorrect gInflationIndex and therefore incorrect user rewards.

Union Finance Update #2

High