Llama - Madalad's results

A governance system for onchain organizations.

General Information

Platform: Code4rena

Start Date: 06/06/2023

Pot Size: $60,500 USDC

Total HM: 5

Participants: 50

Period: 8 days

Judge: gzeon

Id: 246

League: ETH

Llama

Findings Distribution

Researcher Performance

Rank: 26/50

Findings: 1

Award: $54.53

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

Awards

54.5276 USDC - $54.53

Labels

bug
2 (Med Risk)
satisfactory
duplicate-247

External Links

Lines of code

https://github.com/code-423n4/2023-06-llama/blob/aac904d31639c1b4b4e97f1c76b9c0f40b8e5cee/src/LlamaExecutor.sol#L29-L35

Vulnerability details

Impact

LlamaExecutor#execute is a function for making a delegate call to a target contract, with data and value defined as a parameter by the user. However the function is not payable, meaning it is not possible to pass ether when calling the function. Moreover, there does not exist a receive or payable fallback function in the contract. This makes the LlamaExecutor contract unable to receive ether and therefore unable to send ether with the call executed in the execute function.

Proof of Concept

  // @audit missing `payable` modifier
  function execute(address target, uint256 value, bool isScript, bytes calldata data)
    external
    returns (bool success, bytes memory result)
  {
    if (msg.sender != LLAMA_CORE) revert OnlyLlamaCore();
    (success, result) = isScript ? target.delegatecall(data) : target.call{value: value}(data);
  }

https://github.com/code-423n4/2023-06-llama/blob/aac904d31639c1b4b4e97f1c76b9c0f40b8e5cee/src/LlamaExecutor.sol#L29-L35

Tools Used

Manual review

Add a payable modifier to LlamaExecutor#execute.

Assessed type

ETH-Transfer

#0 - c4-pre-sort

2023-06-19T11:11:23Z

0xSorryNotSorry marked the issue as duplicate of #255

#1 - c4-pre-sort

2023-06-19T11:13:18Z

0xSorryNotSorry marked the issue as not a duplicate

#2 - c4-pre-sort

2023-06-19T11:15:44Z

0xSorryNotSorry marked the issue as duplicate of #247

#3 - c4-judge

2023-07-02T10:29:15Z

gzeon-c4 marked the issue as satisfactory

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