Skip to content
DoS Audit finding Intermediate

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

https://github.com/code-423n4/2022-12-tigris/blob/496e1974ee3838be8759e7b4096dbee1b8795593/contracts/GovNFT.sol#L19-L20

https://github.com/code-423n4/2022-12-tigris/blob/496e1974ee3838be8759e7b4096dbee1b8795593/contracts/GovNFT.sol#L311-L313

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


The original report as published on Code4rena, by cccz. 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.

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.

More by cccz

View all

104 more disclosed reports, best first.

More from Tigris Trade contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.