Armor Bug Fix Review
A smart contract contained a redundant conversion that multiplied a claim amount by 10^18, allowing a user with coverage to withdraw vastly more than they were entitled to. An attacker could have drained the coverage pool, but the contract had not yet been deployed.
immunefi.com
Published on immunefi.com
Many bugfix reviews in DeFi are sad because they’re written up in reaction to users losing millions from an exploited project. This, however, is a happy one.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The contract applied a redundant conversion factor of 10^18 to a value that was already denominated in WEI.
Impact
If exploited, the vulnerability could have resulted in a total loss of funds for Armor, but the contract had not been deployed at the time of the report.
What the attacker needed
A user with coverage; contract deployed (it was not)
The fix
The fix was to delete the line that performed the redundant multiplication.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
In a smart contract, amounts are often stored in a very small unit called WEI. The code mistakenly treated a value that was already in WEI as if it were in a larger unit (ETH) and multiplied it by 10^18, making the payout enormous. This meant someone could claim a tiny policy and receive a huge amount of funds.
What is Smart contracts?
Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.