<!-- canonical: https://0xsimao.com/findings/ostium-faulty-revert-decoding-delegatable -->

# Faulty revert reason decoding in Delegatable

Low/Info · Three Sigma · RWA perpetuals DEX · 19th February, 2024

Finding 3S-OS-N19 of the Ostium security review.

- Protocol: https://www.ostium.com/
- Report: /reports/ostium
- Source: https://cdn.sanity.io/files/qoqld077/production/a95b9c69e0f65d1d6b0e649f0d62a362358ca8ce.pdf

---

### Description

Delegatable decodes the revert reason of a revert in a way that may fail. It [adds](https://github.com/0xOstium/smart-contracts-threeSigma/blob/audit-feedback/src/abstract/Delegatable.sol#L41-L45) 4 bytes to
the result pointer, which may mess up the length of the result variable, see more details
[here](https://github.com/sherlock-audit/2023-02-gmx-judging/issues/119).

### Recommendation

Don't decode the reason.

### Status

Addressed in [#83ee4a7](https://github.com/0xOstium/smart-contracts-threeSigma/pull/58/commits/83ee4a7155e6bfff32fd112d2c4eb3f28ddb73dd).
