Omniscia Morpho Audit
Heap Ordering Structure Security Audit
Audit Overview
We were tasked with performing an audit of Morpho's data structures and in particular their HeapOrdering
implementation.
The implementation is in fact a binary max-heap implementation with several optimizations to achieve the lowest operational cost when maintaining the structure's ordering integrity.
All indexes (contextually "ranks") are offset by 1
to ease bitwise operations and the structure implements the standard binary heap traversing operations by identifying parents and children using bitwise shift operations (i.e. a traversal upwards to the "parent" is performed using a right bitwise shift by 1
thus effectively achieving ⌊(i - 1) / 2⌋
).
We advise the Morpho team to closely evaluate all minor-and-above findings identified in the report and promptly remediate them as well as consider all optimizational exhibits identified in the report.
Post-Audit Conclusion
The Morpho team addressed all exhibits identified in the report in the form of comprehensive PRs, dedicated issues opened in the main repository, and supplemental material provided in the PR and issue threads supporting their claims for nullification incurred by certain exhibits.
All exhibits have been adequately dealt with as evidenced in each exhibit's respective "Alleviation" chapter which provides a summary of the communications between as well as actions taken by both the Omniscia and Morpho team.
Contracts Assessed
Files in Scope | Repository | Commit(s) |
---|---|---|
HeapOrdering.sol (HOG) | data-structures | 6b3f07abe7, ba93e9d212, 0cd679077f |
Audit Synopsis
Severity | Identified | Alleviated | Partially Alleviated | Acknowledged |
---|---|---|---|---|
![]() | 1 | 1 | 0 | 0 |
![]() | 10 | 9 | 0 | 1 |
![]() | 1 | 0 | 0 | 1 |
![]() | 0 | 0 | 0 | 0 |
![]() | 0 | 0 | 0 | 0 |
During the audit, we filtered and validated a total of 2 findings utilizing static analysis tools as well as identified a total of 10 findings during the manual review of the codebase. We strongly recommend that any minor severity or higher findings are dealt with promptly prior to the project's launch as they introduce potential misbehaviours of the system as well as exploits.
The list below covers each segment of the audit in depth and links to the respective chapter of the report: