Escher contest - 0xNazgul's results

A decentralized curated marketplace for editioned artwork.

General Information

Platform: Code4rena

Start Date: 06/12/2022

Pot Size: $36,500 USDC

Total HM: 16

Participants: 119

Period: 3 days

Judge: berndartmueller

Total Solo HM: 2

Id: 189

League: ETH

Escher

Findings Distribution

Researcher Performance

Rank: 18/119

Findings: 2

Award: $320.32

QA:
grade-b

๐ŸŒŸ Selected for report: 0

๐Ÿš€ Solo Findings: 0

Findings Information

๐ŸŒŸ Selected for report: HollaDieWaldfee

Also found by: 0xNazgul, cccz, hansfriese, obront

Labels

bug
2 (Med Risk)
downgraded by judge
satisfactory
duplicate-68

Awards

289.163 USDC - $289.16

External Links

Lines of code

https://github.com/code-423n4/2022-12-escher/blob/main/src/Escher721.sol#L64

Vulnerability details

Impact

Currently in the Sales Patterns section in the documentation, it states in number 2 that: "If the artist would like sales and royalties to go somewhere other than the default royalty receiver, they must call setTokenRoyalty with the following variables". However, in the code _setDefaultRoyalty() is used instead of _setTokenRoyalty() from the OpenZeppelin contract ERC2981Upgradeable.

Proof of Concept

This could cause confusion for artists causing them to miss-configure/not set their royalties and loss out on the funds they intend to make.

Tools Used

Manual Review

After speaking with one of the developers this was a "blunder" and I would consider fixing the documentation so that it states the correct functionality used in the code.

#0 - berndartmueller

2022-12-11T19:19:28Z

Downgrading to QA (Low) given the C4 Judging Criteria (https://docs.code4rena.com/awarding/judging-criteria):

QA (Quality Assurance) Includes both Non-critical (code style, clarity, syntax, versioning, off-chain monitoring (events, etc) and Low risk (e.g. assets are not at risk: state handling, function incorrect as to spec, issues with comments)

#1 - c4-judge

2022-12-11T19:19:40Z

#2 - Simon-Busch

2022-12-14T11:31:20Z

Revert back to Medium as requested by @berndartmueller

#3 - c4-judge

2022-12-14T11:34:32Z

berndartmueller marked the issue as not a duplicate

#4 - c4-judge

2022-12-14T11:35:01Z

berndartmueller marked the issue as duplicate of #181

#5 - c4-judge

2023-01-03T15:51:03Z

berndartmueller marked the issue as satisfactory

#6 - liveactionllama

2023-01-11T20:12:35Z

Duplicate of #68

Awards

31.1555 USDC - $31.16

Labels

bug
grade-b
QA (Quality Assurance)
Q-22

External Links

[NAZ-L1] Missing Equivalence Checks in Setters

Severity: Low Context: Base.sol#L10, Generative.sol#L14, FixedPriceFactory.sol#L42, OpenEditionFactory.sol#L42, LPDAFactory.sol#L46, Escher.sol#L21, Escher.sol#L27

Description: Setter functions are missing checks to validate if the new value being set is the same as the current value already set in the contract. Such checks will showcase mismatches between on-chain and off-chain states.

Recommendation: This may hinder detecting discrepancies between on-chain and off-chain states leading to flawed assumptions of on-chain state and protocol behavior.

[NAZ-L2] Missing Time locks

Severity: Low Context: Base.sol#L10, Generative.sol#L14, Generative.sol#L19, FixedPriceFactory.sol#L42, OpenEditionFactory.sol#L42, LPDAFactory.sol#L46, Escher.sol#L21, Escher.sol#L27, Escher721.sol#L57, Escher721.sol#L64, Escher721.sol#L72

Description: When critical parameters of systems need to be changed, it is required to broadcast the change via event emission and recommended to enforce the changes after a time-delay. This is to allow system users to be aware of such critical changes and give them an opportunity to exit or adjust their engagement with the system accordingly. None of the onlyOwner functions that change critical protocol addresses/parameters have a timelock for a time-delayed change to alert: (1) users and give them a chance to engage/exit protocol if they are not agreeable to the changes (2) team in case of compromised owner(s) and give them a chance to perform incident response.

Recommendation: Users may be surprised when critical parameters are changed. Furthermore, it can erode users' trust since they canโ€™t be sure the protocol rules wonโ€™t be changed later on. Compromised owner keys may be used to change protocol addresses/parameters to benefit attackers. Without a time-delay, authorized owners have no time for any planned incident response.

[NAZ-L3] Missing Zero-address Validation

Severity: Low Context: FixedPriceFactory.sol#L17, FixedPriceFactory.sol#L42, OpenEditionFactory.sol#L42, LPDAFactory.sol#L46

Description: Lack of zero-address validation on address parameters may lead to transaction reverts, waste gas, require resubmission of transactions and may even force contract redeployments in certain cases within the protocol.

Recommendation: Consider adding explicit zero-address validation on input parameters of address type.

[NAZ-L4] Lack of Event Emission For Critical Functions

Severity: Low Context: Base.sol#L10, Generative.sol#L14, Generative.sol#L19, FixedPriceFactory.sol#L42, OpenEditionFactory.sol#L42, LPDAFactory.sol#L46

Description: Several functions update critical parameters that are missing event emission. These should be performed to ensure tracking of changes of such critical parameters.

Recommendation: Consider adding events to functions that change critical parameters.

[NAZ-N1] Code Contains Empty Blocks

Severity: Informational Context: Escher721.sol#L25

Description: It's best practice that when there is an empty block, to add a comment in the block explaining why it's empty.

Recommendation: Consider adding /* Comment on why */ to the empty blocks.

[NAZ-N2] Function && Variable Naming Convention

Severity Informational Context: Generative.sol#L27

Description: The linked variables do not conform to the standard naming convention of Solidity whereby functions and variable names(local and state) utilize the mixedCase format unless variables are declared as constant in which case they utilize the UPPER_CASE_WITH_UNDERSCORES format. Private variables and functions should lead with an _underscore.

Recommendation: Consider naming conventions utilized by the linked statements are adjusted to reflect the correct type of declaration according to the Solidity style guide.

[NAZ-N3] Spelling Errors

Severity: Informational Context: Escher.sol#L8 (editionized => ?I don't know?), Escher721.sol#L18 (editionized => ?I don't know?), Escher721.sol#L18 (art work => artwork)

Description: Spelling errors in comments can cause confusion to both users and developers.

Recommendation: Consider checking all misspellings to ensure they are corrected.

[NAZ-N4] Missing or Incomplete NatSpec

Severity: Informational Context: All Contracts

Description: Some functions are missing @notice/@dev NatSpec comments for the function, @param for all/some of their parameters and @return for return values. Given that NatSpec is an important part of code documentation, this affects code comprehension, auditability and usability.

Recommendation: Consider adding in full NatSpec comments for all functions to have complete code documentation for future use

[NAZ-N5] Floating Pragma

Severity: Informational Context: All Contracts

Description: Contracts should be deployed with the same compiler version and flags that they have been tested with thoroughly. Locking the pragma helps to ensure that contracts do not accidentally get deployed using, for example, an outdated compiler version that might introduce bugs that affect the contract system negatively.

Recommendation: Consider locking the pragma version.

#0 - c4-judge

2023-01-04T10:52:58Z

berndartmueller marked the issue as grade-b

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax ยฉ 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter