Skip to content
Access control Audit finding Beginner

reputation risks with updateSolution

The contract's updateSolution function allows the owner to change any part of the contract, potentially accessing all funds. This creates a reputation risk as the project could be flagged for a rug pull, even if intended for upgrades.

gpersoon Follow

Originally disclosed on Code4rena

Submitted by gpersoon

GovDev.sol has a function updateSolution to upgrade parts of the contract via the Diamond construction. Via updateSolution, any functionality can be changed and all the funds can be accessed/rugged. Even if this is well intended the project could still be called out resulting in a reputation risk, see for [example(https://twitter.com/RugDocIO/status/1411732108029181960).

Note: there is a function transferGovDev which can be used to disable the updateSolution

function updateSolution(IDiamondCut.FacetCut[] memory _diamondCut,address _init,bytes memory _calldata) external override {
  require(msg.sender == LibDiamond.contractOwner(), 'NOT_DEV');
  return LibDiamond.diamondCut(_diamondCut, _init, _calldata);
}

Recommend applying extra safeguards for example to limit the time period where updateSolution can be used.

Evert0x (Sherlock) acknowledged:

Fair point, although we are not anonymous, we still want to mitigate this risk.

I’m thinking something like this

  • update is pushed, everyone can review the code changes
  • 14 days of waiting, people are able to get their funds out
  • update is executed.

Downside is that it doesn’t allow us to fix potential critical issues fast.

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

Impact

The project could be called out as a rug pull, damaging its reputation, even if the owner has good intentions.

What the attacker needed

Owner has malicious intent or is compromised

The fix

The project should add safeguards such as a time delay before updates take effect, allowing users to review changes and withdraw funds if desired.

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 special function that lets the owner change how the contract works. If the owner misuses this, they could take all the money. Even if the owner is honest, people might think it's a scam because the owner has so much power.

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.

More by gpersoon

View all

47 more disclosed reports, best first.

More from Sherlock contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

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.