BRA Hack
What happened
On January 10, 2023, an attacker drained 819 WBNB (about $225,000) from the BRA token's PancakeSwap liquidity on BNB Chain in two transactions.
The BRA token charged a tax inside _transfer() and credited part of it to the liquidity pair. When the pair was both the sender and the recipient of a transfer, the pair was credited twice, and the token never called sync() on the pair afterward. The pair's BRA balance therefore grew past its recorded reserves on every such transfer, and anyone could collect the excess with skim().
The attacker funded the attack with a 1,400 WBNB flash loan from a DODO pool, pumped the pair's BRA balance with about 100 skim() calls that sent tokens from the pair back to the pair, and then sold the inflated BRA. The first transaction netted 675 WBNB and a second run netted 144 WBNB.
**Block data**
- Attacker: 0x67a909f2953fb1138bea4b60894b51291d2d0795
- Vulnerable contract: 0x449fea37d339a11efe1b181e5d5462464bba3752
- Exploit tx 1 (675 WBNB): 0x6759db55a4edec4f6bedb5691fc42cf024be3a1a534ddcc7edd471ef205d4047
- Exploit tx 2 (144 WBNB): 0x4e5b2efa90c62f2b62925ebd7c10c953dc73c710ef06695eac3f36fe0f6b9348
How it happened
- The attack contract borrowed 1,400 WBNB through
flashLoan()on a DODO pool. - It swapped 1,000 BNB for BRA (routed through USDT), receiving roughly 10.5K BRA, and transferred the BRA to the BRA/USDT PancakeSwap pair.
- It called
skim()on the pair with the pair itself as the recipient. Because sender and recipient were both the pair, BRA's_transfer()tax logic credited the pair twice, so the pair ended up holding more BRA than before, with nosync()to update reserves. - Repeating the
skim()loop about 100 times inflated the pair's surplus BRA balance. - The attacker skimmed the surplus out, sold it back to WBNB for about 1,675 WBNB, repaid the 1,400 WBNB loan and kept 675 WBNB. A second transaction repeated the method for 144 WBNB more.
Protocol details
Evidence
- report Report blog.solidityscan.com
- transaction bscscan.com transaction 0x6759…4047 bscscan.com
- analysis BRA Token Hack Analysis - Double the Reward blog.solidityscan.com
- analysis DeFiLlama defillama.com
- analysis DeFiHackLabs BRA_exp.sol raw.githubusercontent.com
- analysis debank.com page 0x67a9…0795 debank.com
Understand the attack patterns
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.