KUMABondToken.approve() should revert if the owner of the tokenId is blacklisted
The KUMABondToken.approve() function only checks if the caller and the approved address are not blacklisted, but does not check if the owner of the tokenId is blacklisted. This allows an operator to approve a blacklisted user's bond token, even though transfers would still be blocked.
The original report as published on Code4rena, by hihen. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Generating the AI write-up for this report.
This usually takes about 30 seconds. You can read the original meanwhile; this page updates itself.
Writing the technical write-up
Writing the version for beginners
Checking every passage against the original
How it worked
Root cause
The approve function checks the caller and the approved address against the blacklist but omits a check on the token owner.
Impact
A blacklisted user's bond token could be approved, though a transfer would still be blocked because transferFrom checks all accounts involved.
What the attacker needed
Blacklisted token owner; operator approved via setApprovalForAll
How it was found
User A owns a bond token.
User A calls setApprovalForAll to let user B operate on all their bond tokens.
User A is blacklisted.
User B calls approve to let user C operate on the bond token.
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 report has not been written yet. The Original tab links to the source.
Generating the AI write-up for this report.
This usually takes about 30 seconds. You can read the original meanwhile; this page updates itself.
Writing the technical write-up
Writing the version for beginners
Checking every passage against the original
A blacklist is meant to stop certain users from doing things with their tokens. Here, a user who was blacklisted could still have their token approved for someone else to use, because the approval function forgot to check the token owner. This is a gap in the rules, not a way to steal funds directly.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.