Omniscia rain protocol Audit
Manual Review
Manual Review
A thorough line-by-line review was conducted on the codebase to identify potential malfunctions and vulnerabilities in the complex multi-component Rain protocol.
As the project at hand implements a custom virtual machine as well as multiple asset-managing contracts, intricate care was put into ensuring that the flow of funds within the system conforms to the specifications and restrictions laid forth within the protocol's specification and that the documentation of the novel virtual machine complies with the code that the contracts implement.
We validated that all state transitions of the system occur within sane criteria and that all rudimentary formulas within the system execute as expected. We pinpointed a significant vulnerability within the virtual machine's mathematical module which could have had severe ramifications to its overall operation, however, it was conveyed ahead of time to the Rain team to be promptly remediated.
Additionally, the system was investigated for any other commonly present attack vectors such as re-entrancy attacks, mathematical truncations, logical flaws and ERC / EIP standard inconsistencies. The documentation of the project was satisfactory to an exemplary extent, however, we advise all documentation mistakes to be corrected and certain components to be further documented to ensure ease-of-maintenance as well as ease-of-integration.
A total of 48 findings were identified over the course of the manual review of which 23 findings concerned the behaviour and security of the system. The non-security related findings, such as optimizations, are included in the separate Code Style chapter.
The finding table below enumerates all these security / behavioural findings:
ID | Severity | Addressed | Title |
---|---|---|---|
CTR-01M | Potential Sanitization of VM State Configuration | ||
ERB-01M | Balance Flash-Loan Susceptibility | ||
ERC-01M | Potential Function Misuse | ||
ERC-02M | Mutability Documentation Discrepancy | ||
ERR-01M | Potentially Unfair Redemptions of Rebasing Assets | ||
EER-01M | Potential Sanitization of VM State Configuration | ||
FAC-01M | Inexistent Validation of Existing Child | ||
ITR-01M | Report Encoding Discrepancy | ||
MOS-01M | Inexistent Accumulation of Exponention | ||
RVM-01M | Documentation Discrepancy of Opcode Consumption | ||
RVM-02M | Documentation Discrepancy of Operators | ||
RVM-03M | Documentation Discrepancy of Zipmap Operand Unpacking | ||
RVM-04M | Inexplicable Limitation of Jump Instructions | ||
RER-01M | Inexplicable Status Restriction | ||
REE-01M | Documentation Discrepancy of Call Validity | ||
TBC-01M | Counter-Intuitive Tier Check | ||
TOP-01M | Insufficient Documentation of Stack Layout | ||
TCE-01M | Potential Nullification of Upcoming Tiers | ||
TRU-01M | Deprecated Usage of Safe Approval | ||
TRU-02M | Documentation Discrepancies | ||
VTR-01M | Inexistent Enforcement of Tier Value Validity | ||
VER-01M | Introduction of Single Point of Failure | ||
VER-02M | Potentially Dangerous Race Condition |