Functions in FERC20 can’t be invoked
Two owner-only functions in the FERC20 token contract cannot be called because the owner is the Bonding contract, which does not expose them. As a result, the maximum transaction limit cannot be updated and addresses cannot be excluded from that limit.
Submitted by EPSec, also found by io10, LeoGold, and oakcobalt
Finding Description and Impact
In the FERC20 contract, there are two functions restricted to be called only by the owner of the token: updateMaxTx and excludeFromMaxTx. These functions are crucial for managing transaction limits and exclusions for specific addresses. However, an issue arises as the owner of the token is the Bonding contract, which does not expose these functions externally. As a result, no one can call these functions, preventing the update of transaction limits or exclusions.
Here is the relevant code snippet from the contract:
function updateMaxTx(uint256 _maxTx) public onlyOwner {
_updateMaxTx(_maxTx);
}
function excludeFromMaxTx(address user) public onlyOwner {
require(user != address(0), "ERC20: Exclude Max Tx from the zero address");
isExcludedFromMaxTx[user] = true;
}
Impact:
- Transaction Limit Issues: The inability to update the maximum transaction limit leaves the contract inflexible in adapting to changes in market conditions or governance decisions.
- Exclusion Issues: Certain addresses that should be exempt from transaction limits cannot be excluded, limiting the ability to manage token holders effectively.
Recommended mitigation steps
Modify the Bonding contract to include wrapper functions that externally call updateMaxTx and excludeFromMaxTx for the owner. This ensures these functions are accessible for updates and exclusions.
function updateMaxTxForOwner(uint256 _maxTx) public onlyOwner {
token.updateMaxTx(_maxTx);
}
function excludeFromMaxTxForOwner(address user) public onlyOwner {
token.excludeFromMaxTx(user);
}
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
The token's maximum transaction limit cannot be updated and addresses cannot be excluded from it, leaving the contract inflexible.
What the attacker needed
None
The fix
Add wrapper functions in the Bonding contract that call updateMaxTx and excludeFromMaxTx on the 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.
A smart contract can have functions that only its owner is allowed to call. Here the owner is another contract, and that other contract has no way to pass the call along, so those functions are effectively locked. This means the token's transaction limit settings can never be changed.
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.