Good Entry - hpsb's results

The best day trading platform to make every trade entry a Good Entry.

General Information

Platform: Code4rena

Start Date: 01/08/2023

Pot Size: $91,500 USDC

Total HM: 14

Participants: 80

Period: 6 days

Judge: gzeon

Total Solo HM: 6

Id: 269

League: ETH

Good Entry

Findings Distribution

Researcher Performance

Rank: 51/80

Findings: 2

Award: $28.23

QA:
grade-b

🌟 Selected for report: 0

πŸš€ Solo Findings: 0

Awards

12.8772 USDC - $12.88

Labels

bug
2 (Med Risk)
low quality report
satisfactory
duplicate-83

External Links

Lines of code

https://github.com/code-423n4/2023-08-goodentry/blob/71c0c0eca8af957202ccdbf5ce2f2a514ffe2e24/contracts/helper/V3Proxy.sol#L156 https://github.com/code-423n4/2023-08-goodentry/blob/71c0c0eca8af957202ccdbf5ce2f2a514ffe2e24/contracts/helper/V3Proxy.sol#L174 https://github.com/code-423n4/2023-08-goodentry/blob/71c0c0eca8af957202ccdbf5ce2f2a514ffe2e24/contracts/helper/V3Proxy.sol#L192

Vulnerability details

Impact

The functions do not check the return value of low-level calls. This can lock Ether in the contract if the call fails or may compromise the contract if the ownership is being changed. The following calls were detected without return value validations - call

Proof of Concept

Check both the links: https://swcregistry.io/docs/SWC-104/ https://coinsbench.com/unchecked-return-value-in-smart-contracts-providing-an-attack-surface-dab2eed64251#:~:text=When%20the%20return%20value%20of,be%20executed%20causing%20unexpected%20behavior.

Tools Used

Manual Review

Ensure return value is checked using conditional statements for low-level calls. We should also ensure that we log failed calls using events.

Assessed type

call/delegatecall

#0 - c4-pre-sort

2023-08-08T15:03:10Z

141345 marked the issue as low quality report

#1 - c4-pre-sort

2023-08-09T01:51:53Z

141345 marked the issue as primary issue

#2 - c4-pre-sort

2023-08-10T06:02:55Z

141345 marked the issue as duplicate of #83

#3 - c4-judge

2023-08-20T17:11:35Z

gzeon-c4 marked the issue as satisfactory

Awards

15.3494 USDC - $15.35

Labels

bug
disagree with severity
downgraded by judge
grade-b
QA (Quality Assurance)
sponsor confirmed
Q-07

External Links

Lines of code

https://github.com/code-423n4/2023-08-goodentry/blob/71c0c0eca8af957202ccdbf5ce2f2a514ffe2e24/contracts/TokenisableRange.sol#L228 https://github.com/code-423n4/2023-08-goodentry/blob/71c0c0eca8af957202ccdbf5ce2f2a514ffe2e24/contracts/TokenisableRange.sol#L229

Vulnerability details

Impact

Some tokens do not revert the transaction when the transfer or transferFrom fails and returns False. Hence we must check the return value after calling the transfer or transferFrom function.

Proof of Concept

Check the last answer here: https://ethereum.stackexchange.com/questions/136039/what-is-best-practice-for-transferfrom-out-of-these-two-ways In short: So using token.transferFrom(msg.sender, addr, amount); is NOT enough. The risk is that you're assuming the transfer was successful when actually it wasn't. Example of tokens that don't revert: ZRX, HT, WOO. The safest method is using this:

(bool success, bytes memory data) = address(token).call(abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'token transfer from sender failed'); This is the one used by Openzeppelin's SafeERC20 library.

Tools Used

Manual Report

Use OpenZeppelin SafeERC20's safetransfer and safetransferFrom functions.

Assessed type

Token-Transfer

#0 - 141345

2023-08-08T15:01:05Z

QA might be more appropriate.

not enough balance, deposit() will fail.

bot race missed instance.

#1 - c4-sponsor

2023-08-15T01:13:31Z

Keref marked the issue as sponsor confirmed

#2 - c4-sponsor

2023-08-15T01:13:35Z

Keref marked the issue as disagree with severity

#3 - Keref

2023-08-18T03:07:57Z

See PR#7

#4 - c4-judge

2023-08-19T15:33:41Z

gzeon-c4 changed the severity to QA (Quality Assurance)

#5 - c4-judge

2023-08-20T16:41:07Z

gzeon-c4 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