code-423n4 / 2023-05-maia-findings

24 stars 13 forks source link

Inconsistently reading the encoded parameters received in the _sParams argument in the BranchBridgeAgent::clearTokens() #173

Open code423n4 opened 1 year ago

code423n4 commented 1 year ago

Lines of code

https://github.com/code-423n4/2023-05-maia/blob/main/src/ulysses-omnichain/BranchBridgeAgent.sol#L565-L634

Vulnerability details

Impact

Proof of Concept

 *           - ht = hToken
 *           - t = Token
 *           - A = Amount
 *           - D = Destination
 *           - b = bytes
 *           - n = number of assets
 *           ________________________________________________________________________________________________________________________________
 *          |            Flag               |           Deposit Info           |             Token Info             |   DATA   |  Gas Info   |
 *          |           1 byte              |            4-25 bytes            |        (105 or 128) * n bytes      |   ---    |  16 bytes   |
 *          |                               |                                  |            hT - t - A - D          |          |             |
 *          |_______________________________|__________________________________|____________________________________|__________|_____________|

 *          | callOutMulti = 0x2            |  1b(n) + 20b(recipient) + 4b     |         32b + 32b + 32b + 32b      |   ---    |     16b     |

Tools Used

Manual Audit

Recommended Mitigation Steps

Assessed type

en/de-code

c4-judge commented 1 year ago

trust1995 marked the issue as unsatisfactory: Insufficient proof

c4-judge commented 1 year ago

trust1995 marked the issue as satisfactory

c4-judge commented 1 year ago

trust1995 marked the issue as primary issue

c4-sponsor commented 1 year ago

0xBugsy marked the issue as disagree with severity

c4-sponsor commented 1 year ago

0xBugsy marked the issue as sponsor confirmed

c4-judge commented 1 year ago

trust1995 marked the issue as selected for report

0xLightt commented 1 year ago

Addressed https://github.com/Maia-DAO/eco-c4-contest/commit/762067df869fdf6e21fdd125524e93c51ead6db2