The article begins with a blurb on how to and how NOT to run a good bug bounty program. The first issue is NOT following up with emails from whitehats. Second is paying less than the advertised bounty or it being too small in the first place.
The second point is a major issue. If the bounty is 1K and the funds at risk is 1B, the incentive to steal far outweighs the reward; this makes it more likely that a vulnerability found will be exploited. Apparently, Balancer had advertised 2M but only paid of 25% on a previous bug.
Balancer is an AMM in the DeFi space. It allows a pool containing two or more tokens to swap between them, while the people providers liquidity get some proceed of the fees for performing the swaps. This is all very standard functionality for an AMM though.
MerkleRedeem's purpose is to distribute rewards. The original way this was architected only allowed for a single token per contract. This led the way for the
Merkle Orchard contract, which allows for multiple tokens being claimable in a single contract. All rewards were in this contract.
The code for submitting a reward claim took in an array of ids. The program would iterate on these ids and send the user all of the tokens they deserved. At the end of the loop, it would mark the id as used, meaning it couldn't be claimed more than once.
The vulnerability is that the continue iterating through the list and ONLY at the end mark the id as used. This allowed for the same claim to be made several times, effectively creating an infinite claiming glitch. In total, between several chains, 3.2M of tokens could have been stolen. It should be noted that this was reported by the author of this post. They made 50ETH on an out of scope target, which is pretty cool. This code had made it past four security audits, which is pretty crazy.
Immunefi created an article with this as well.