Omniscia 0xPhase Audit
Core Protocol Security Audit
Audit Report Revisions
Commit Hash | Date | Audit Report Hash |
---|---|---|
3dd3d7bf0c | May 25th 2023 | a81bb35c28 |
19668501f8 | May 27th 2023 | 7d92cf96f9 |
f921b6c4f9 | May 31st 2023 | 66d4a4b03a |
Audit Overview
We were tasked with performing an audit of the 0xPhase codebase and in particular their novel collateral-based borrowing system that permits an algorithmic stablecoin to be minted by supplying collateral to the system.
Over the course of the audit, we identified multiple vulnerabilities of varying severity, the most important of which is the capability to force an ill-health / misconfigured credit line to an unsuspecting user.
We advise the 0xPhase 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 0xPhase team iterated through all findings within the report and provided us with a revised commit hash to evaluate all exhibits on.
We evaluated all alleviations performed by 0xPhase and have identified that certain exhibits have not been adequately dealt with. We advise the 0xPhase team to revisit the following exhibits: CAV-01M, VSF-01M, VBE-01C, VAF-01C
Post-Audit Conclusion (19668501f8)
The 0xPhase team revised their codebase to address the remaining 4 findings. In their revisions, finding CAV-01M was improperly alleviated as it performs the recommended course of action in an incorrect order.
We advise the 0xPhase team to revisit the exhibit and correctly alleviate it.
Post-Audit Conclusion (f921b6c4f9)
The final CAV-01M exhibit has been properly alleviated in the latest iteration by re-ordering the transfer status updates. As a result, all exhibits of the report have been adequately dealt with.
Contracts Assessed
Files in Scope | Repository | Commit(s) |
---|---|---|
AccessControl.sol (ACL) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
AccessControlBase.sol (ACB) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
AccessControlFacet.sol (ACF) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
AccessControlCutFacet.sol (ACC) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
AdminUpgradeableProxy.sol (AUP) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
BytesLib.sol (BLB) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
CallLib.sol (CLB) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
ClockBase.sol (CBE) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
CashOracle.sol (COE) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
CloneDiamond.sol (CDD) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
CreditAccountV1.sol (CAV) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
ChainlinkOracleV1.sol (COV) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
DBV1.sol (DBV) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
DebtLib.sol (DLB) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
Diamond.sol (DDN) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
DiamondLib.sol (DLI) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
DiamondLoupeFacet.sol (DLF) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
Element.sol (ETN) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
ERC20Base.sol (ERC) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
ERC20Facet.sol (ERF) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
ElementBase.sol (EBE) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
ElementFacet.sol (EFT) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
EIP712Upgradeable.sol (EIP) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
ERC20VotesUpgradeable.sol (ERV) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
ERC20PermitUpgradeable.sol (ERP) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
FixedOracle.sol (FOE) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
FixedRateInterest.sol (FRI) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
IDB.sol (IDB) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
IVault.sol (IVT) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
IPegToken.sol (IPT) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
ITreasury.sol (ITY) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
ISystemClock.sol (ISC) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
ICreditAccount.sol (ICA) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
IChainlinkOracle.sol (ICO) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
Manager.sol (MRE) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
MathLib.sol (MLB) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
MasterOracle.sol (MOE) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
MulticallFacet.sol (MFT) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
OwnableBase.sol (OBE) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
OwnableFacet.sol (OFT) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
OwnableCutFacet.sol (OCF) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
Proxy.sol (PYX) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
PegTokenV1.sol (PTV) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
ProxyOwnable.sol (POE) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
ProxyInitializable.sol (PIE) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
SlotLib.sol (SLB) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
ShareLib.sol (SLI) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
SimpleProxy.sol (SPY) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
SystemClockV1.sol (SCV) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
StorageUpgradeableProxy.sol (SUP) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
TreasuryV1.sol (TV1) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
VaultBase.sol (VBE) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
VaultConstants.sol (VCS) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
VaultInitializer.sol (VIR) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
VaultGettersFacet.sol (VGF) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
VaultSettersFacet.sol (VSF) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
VaultAccountingFacet.sol (VAF) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
VaultLiquidationFacet.sol (VLF) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
WETHAdapter.sol (WET) | contracts | 2ccd464158, 3dd3d7bf0c, 19668501f8, f921b6c4f9 |
Audit Synopsis
Severity | Identified | Alleviated | Partially Alleviated | Acknowledged |
---|---|---|---|---|
7 | 5 | 0 | 2 | |
43 | 43 | 0 | 0 | |
18 | 18 | 0 | 0 | |
8 | 8 | 0 | 0 | |
11 | 11 | 0 | 0 |
During the audit, we filtered and validated a total of 11 findings utilizing static analysis tools as well as identified a total of 76 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 can 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: