Prepared by:
HALBORN
Last Updated 08/22/2024
Date of Engagement by: July 16th, 2024 - August 1st, 2024
100% of all REPORTED Findings have been addressed
All findings
3
Critical
0
High
1
Medium
0
Low
0
Informational
2
The Entangle team
engaged Halborn to conduct a security assessment on their smart contracts beginning on 07/16/2024 and ending on 08/01/2024. The security assessment was scoped to the smart contracts. Commit hashes and further details can be found in the Scope section of this report.
Halborn was provided 2 weeks for the engagement and assigned 1 full-time security engineer to review the security of the smart contracts in scope. The engineer is a blockchain and smart contract security experts with advanced penetration testing and smart contract hacking skills, and deep knowledge of multiple blockchain protocols.
The purpose of the assessment is to:
Identify potential security issues within the smart contracts.
Ensure that smart contract functionality operates as intended.
In summary, Halborn identified some security that were addressed and acknowledged by the Entangle team
.
Halborn performed a combination of manual and automated security testing to balance efficiency, timeliness, practicality, and accuracy in regard to the scope of this assessment. While manual testing is recommended to uncover flaws in logic, process, and implementation; automated testing techniques help enhance coverage of the code and can quickly identify items that do not follow the security best practices. The following phases and associated tools were used during the assessment:
Research into architecture and purpose.
Smart contract manual code review and walkthrough.
Graphing out functionality and contract logic/connectivity/functions (solgraph
).
Manual assessment of use and safety for the critical Solidity variables and functions in scope to identify any arithmetic related vulnerability classes.
Manual testing by custom scripts.
Static Analysis of security for scoped contract, and imported functions (slither
).
Testnet deployment (Foundry
).
External libraries and financial-related attacks.
New features/implementations after/with the remediation commit IDs.
Changes that occur outside the scope of PRs.
EXPLOITABILIY METRIC () | METRIC VALUE | NUMERICAL VALUE |
---|---|---|
Attack Origin (AO) | Arbitrary (AO:A) Specific (AO:S) | 1 0.2 |
Attack Cost (AC) | Low (AC:L) Medium (AC:M) High (AC:H) | 1 0.67 0.33 |
Attack Complexity (AX) | Low (AX:L) Medium (AX:M) High (AX:H) | 1 0.67 0.33 |
IMPACT METRIC () | METRIC VALUE | NUMERICAL VALUE |
---|---|---|
Confidentiality (C) | None (I:N) Low (I:L) Medium (I:M) High (I:H) Critical (I:C) | 0 0.25 0.5 0.75 1 |
Integrity (I) | None (I:N) Low (I:L) Medium (I:M) High (I:H) Critical (I:C) | 0 0.25 0.5 0.75 1 |
Availability (A) | None (A:N) Low (A:L) Medium (A:M) High (A:H) Critical (A:C) | 0 0.25 0.5 0.75 1 |
Deposit (D) | None (D:N) Low (D:L) Medium (D:M) High (D:H) Critical (D:C) | 0 0.25 0.5 0.75 1 |
Yield (Y) | None (Y:N) Low (Y:L) Medium (Y:M) High (Y:H) Critical (Y:C) | 0 0.25 0.5 0.75 1 |
SEVERITY COEFFICIENT () | COEFFICIENT VALUE | NUMERICAL VALUE |
---|---|---|
Reversibility () | None (R:N) Partial (R:P) Full (R:F) | 1 0.5 0.25 |
Scope () | Changed (S:C) Unchanged (S:U) | 1.25 1 |
Severity | Score Value Range |
---|---|
Critical | 9 - 10 |
High | 7 - 8.9 |
Medium | 4.5 - 6.9 |
Low | 2 - 4.4 |
Informational | 0 - 1.9 |
Critical
0
High
1
Medium
0
Low
0
Informational
2
Security analysis | Risk level | Remediation Date |
---|---|---|
Missing Yield Booster Mechanism in CamelotSynthChef Contract | High | Solved - 08/13/2024 |
Simplify Access Control in the contracts | Informational | Acknowledged |
Hardcoded Router Address in AerodromeSynthChef Constructor | Informational | Acknowledged |
// High
The current implementation of the CamelotSynthChef
contract lacks a yield booster mechanism, which is present in the original Camelot protocol. This feature could potentially increase the APR for users and make the yield farming more attractive.
The CamelotSynthChef
contract currently handles basic farming operations such as deposit, withdraw, and harvest, but does not implement any yield boosting functionality.
Impact
- Potentially lower APR for users compared to direct interaction with Camelot protocol.
- Missed opportunity for optimizing yield farming rewards.
- Possible competitive disadvantage compared to other yield aggregators that implement yield boosting.
Implement a yield boosting mechanism on the contract.
SOLVED : The Entangle team solved the issue by managing the yield boosting mechanism through off-chain.
// Informational
The SolidlySynthChef and other contracts currently inherits from both OwnableUpgradeable
and AccessControlUpgradeable
. This creates unnecessary complexity and potential confusion in the access control system. We can simplify the contract by removing OwnableUpgradeable
and solely relying on AccessControlUpgradeable
with the DEFAULT_ADMIN_ROLE
.
abstract contract SolidlySynthChef is
IProtocolSynthChef,
Initializable,
UUPSUpgradeable,
AccessControlUpgradeable,
OwnableUpgradeable,
ReentrancyGuardUpgradeable
{
// ...
}
1. Remove OwnableUpgradeable
from the inheritance list.
2. Replace onlyOwner
modifier with onlyRole(DEFAULT_ADMIN_ROLE).
3. Remove transferOwnership
call in the initialize
function.
4. Update the _authorizeUpgrade
function to use DEFAULT_ADMIN_ROLE.
ACKNOWLEDGED : The Entangle team acknowledged the issue.
// Informational
The AerodromeSynthChef
contract currently hardcodes the router address in its constructor call to the SolidlySynthChef
base contract. This practice reduces the contract's flexibility and makes it difficult to deploy to different networks or adapt to potential address changes.
contract AerodromeSynthChef is SolidlySynthChef {
constructor() SolidlySynthChef(0xcF77a3Ba9A5CA399B7c97c74d54e5b1Beb874E43) {}
}
Modify the constructor to accept the router address as a parameter.
ACKNOWLEDGED : The Entangle team acknowledged the issue.
Halborn strongly recommends conducting a follow-up assessment of the project either within six months or immediately following any material changes to the codebase, whichever comes first. This approach is crucial for maintaining the project’s integrity and addressing potential vulnerabilities introduced by code modifications.
// Download the full report
* Use Google Chrome for best results
** Check "Background Graphics" in the print settings if needed