The term
can be re-onboarded
using a not allowed implementation
#1231
Labels
bug
Something isn't working
disagree with severity
Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments)
downgraded by judge
Judge downgraded the risk level of this issue
edited-by-warden
grade-a
primary issue
Highest quality submission among a set of duplicates
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
sponsor acknowledged
Technically the issue is correct, but we're not going to resolve it for XYZ reasons
sufficient quality report
This report is of sufficient quality
Lines of code
https://github.com/code-423n4/2023-12-ethereumcreditguild/blob/2376d9af792584e3d15ec9c32578daa33bb56b43/src/governance/LendingTermOnboarding.sol#L181
https://github.com/code-423n4/2023-12-ethereumcreditguild/blob/2376d9af792584e3d15ec9c32578daa33bb56b43/src/governance/LendingTermOnboarding.sol#L92
Vulnerability details
Lines of code
Impact
The
term
can bere-onboarded
using the LendingTermOnboarding::proposeOnboard() function, the problem is that theterm
may be using a implementation which was removed by the LendingTermOnboarding::allowImplementation()Proof of Concept
Please see the next scenario:
termA
is created using theimplementation=address(123)
.termA
is removed using theLendingTermOffboarding.sol
contract.implementation=address(123)
an theimplementation
is removed using theLendingTermOnboarding::allowImplementation(address(123), false)
functiontermA
, which is using theimplementation=address(123)
, isre-onboarded
usingLendingTermOnboarding::proposeOnboard()
function. That may be a problem because the activetermA
may be using an implementation (address(123)) which is not allowed.Tools used
Manual review
Recommended Mitigation Steps
The term proposed using the
LendingTermOnboarding::proposeOnboard()
function should be a recentcreated[term]
function proposeOnboard( address term ) external whenNotPaused returns (uint256 proposalId) { // Check that the term has been created by this factory require(created[term] != 0, "LendingTermOnboarding: invalid term"); ++ require(created[term] + MIN_LIVE > block.timestamp); // Check that the term was not subject to an onboard vote recently require( lastProposal[term] + MIN_DELAY_BETWEEN_PROPOSALS < block.timestamp, "LendingTermOnboarding: recently proposed" ); lastProposal[term] = block.timestamp; // Check that the term is not already active // note that terms that have been offboarded in the past can be re-onboarded // and won't fail this check. This is intentional, because some terms might be offboarded // due to specific market conditions, and it might be desirable to re-onboard them // at a later date. bool isGauge = GuildToken(guildToken).isGauge(term); require(!isGauge, "LendingTermOnboarding: active term"); // Generate calldata for the proposal ( address[] memory targets, uint256[] memory values, bytes[] memory calldatas, string memory description ) = getOnboardProposeArgs(term); // propose return Governor.propose(targets, values, calldatas, description); }
Assessed type
Context
The text was updated successfully, but these errors were encountered: