GovNFT: maxBridge has no effect
The GovNFT contract declares a maxBridge variable and a setter for it, but the bridging logic never reads it, so the intended cap on how many tokens can be bridged in one call is not enforced. The judge states this could cause a denial of service.
cccz Follow with unforgiven, Madalad and 1 other
Originally disclosed on Code4rena
Submitted by cccz, also found by unforgiven, Madalad, and 0xbepresent
In GovNFT, setMaxBridge function is provided to set maxBridge, but this variable is not used, literally it should be used to limit the number of GovNFTs crossing chain, but it doesn’t work in GovNFT.
uint256 public maxBridge = 20;
...
function setMaxBridge(uint256 _max) external onlyOwner {
maxBridge = _max;
}
Proof of Concept
Recommended Mitigation Steps
Consider applying the maxBridge variable.
Alex the Entreprenerd (judge) commented:
The Warden has shown how, an unused variable, which was meant to cap the amount of tokens bridged per call, could cause a DOS.
These types of DOS could only be fixed via Governance Operations, and could create further issues, for this reason I agree with Medium Severity.
GainsGoblin (Tigris Trade) confirmed and resolved:
Mitigation: https://github.com/code-423n4/2022-12-tigris/pull/2#issuecomment-1419175169
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
Root cause
Likely the bridging function never reads the maxBridge state variable, so the configured limit is not enforced.
Impact
The missing cap could cause a denial of service, according to the judge, and fixing it would require governance operations.
What the attacker needed
None
The fix
The maxBridge variable should be applied in the bridging logic; the project confirmed and resolved it with a mitigation pull request.
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 has a setting called maxBridge that is supposed to limit how many NFT tokens can be sent across chains at once. The code lets the owner change this setting, but the part that actually moves tokens never checks it, so the limit does nothing. The judge says this could let someone overload the bridge and cause a denial of service.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.