{"id":1002,"date":"2025-02-25T13:29:31","date_gmt":"2025-02-25T11:29:31","guid":{"rendered":"https:\/\/ackee.xyz\/blog\/?p=1002"},"modified":"2025-02-28T12:25:47","modified_gmt":"2025-02-28T10:25:47","slug":"cian-yield-layer-audit-summary","status":"publish","type":"post","link":"https:\/\/ackee.xyz\/blog\/cian-yield-layer-audit-summary\/","title":{"rendered":"Cian Yield Layer Audit Summary"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">Cian protocol&#8217;s yield layer allows users to deposit assets into a Vault contract to earn yield via multiple strategies. The protocol is interoperable cross-chain, offering pools on various chains that can hold a representation of the Vault token. This can be exchanged for deposit tokens on the given chain.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">METHODOLOGY<\/span><\/h2>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Verification of technical specification<\/b><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">The audit scope is confirmed with the client, and auditors are onboarded to the project. Provided documentation is reviewed and compared to the audited system.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Tool-based analysis<\/b><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">A deep check with Solidity static analysis tool <\/span><a href=\"https:\/\/getwake.io\/\"><span style=\"font-weight: 400;\">Wake<\/span><\/a><span style=\"font-weight: 400;\"> in companion with <\/span><a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=AckeeBlockchain.tools-for-solidity\"><span style=\"font-weight: 400;\">Solidity (Wake)<\/span><\/a><span style=\"font-weight: 400;\"> extension is performed, flagging potential vulnerabilities for further analysis early in the process.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Manual code review<\/b><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">Auditors manually check the code line by line, identifying vulnerabilities and code quality issues. The main focus is on recognizing potential edge cases and project-specific risks.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Local deployment and hacking<\/b><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">Contracts are deployed in a local <\/span><a href=\"https:\/\/getwake.io\/\"><span style=\"font-weight: 400;\">Wake<\/span><\/a><span style=\"font-weight: 400;\"> environment, where targeted attempts to exploit vulnerabilities are made. The contracts&#8217; resilience against various attack vectors is evaluated.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Unit and fuzz testing<\/b><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">Unit tests are run to verify expected system behavior. Additional unit or fuzz tests may be written using <\/span><a href=\"https:\/\/getwake.io\/\"><span style=\"font-weight: 400;\">Wake<\/span><\/a><span style=\"font-weight: 400;\"> framework if any coverage gaps are identified. The goal is to verify the system\u2019s stability under real-world conditions and ensure robustness against both expected and unexpected inputs<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">We began our review using static analysis tools, including <\/span><a href=\"https:\/\/getwake.io\/\"><span style=\"font-weight: 400;\">Wake<\/span><\/a><span style=\"font-weight: 400;\">. We then took a deep dive into the logic of the contracts. For testing and fuzzing, we used the <\/span><a href=\"https:\/\/getwake.io\/\"><span style=\"font-weight: 400;\">Wake<\/span><\/a><span style=\"font-weight: 400;\"> testing framework. For more information on fuzzing, see the respective section in the <\/span><a href=\"https:\/\/1717361315-files.gitbook.io\/~\/files\/v0\/b\/gitbook-x-prod.appspot.com\/o\/spaces%2FO9IZAEayToLEPbAGTwkL%2Fuploads%2FV02w5MYbK0RQhopzxvF8%2Fackee-blockchain-cian-yield-layer-report.pdf?alt=media&amp;token=64ead027-139d-4642-9fe0-db0e9e111e0d\"><span style=\"font-weight: 400;\">full audit report<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">During the review, we paid special attention to:\u00a0<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Ensuring the arithmetic operations and accounting of the system were correct;\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Detecting possible reentrancies and unprotected calls in the code;\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Ensuring access controls are not too relaxed or too strict;\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Identifying common issues such as data validation.<\/span><\/li>\n<\/ul>\n<h2><span style=\"font-weight: 400;\">SCOPE<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">The audit was performed on commit <\/span><span style=\"font-weight: 400;\"><code class=\"codehl\">54e953<\/code><\/span><span style=\"font-weight: 400;\"> and the scope included all contracts, excluding strategies. Revision 1.1 was performed on commit <\/span><span style=\"font-weight: 400;\"><code class=\"codehl\">06f333<\/code><\/span><span style=\"font-weight: 400;\">, with the scope of the fixes of findings from the first review.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">FINDINGS<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Here are the findings from our audit.<\/span><\/p>\n<h3><span style=\"font-weight: 400;\">Critical severity<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">No critical severity issues were found.<\/span><\/p>\n<h3><span style=\"font-weight: 400;\">High severity<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">No high severity issues were found.<\/span><\/p>\n<h3><span style=\"font-weight: 400;\">Medium severity<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">M1: Invalid calculations due to intermediary division\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">M2: Pool state variables have insufficient data validation\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">M3: Users have almost no control over their deposited funds<\/span><\/p>\n<h3><span style=\"font-weight: 400;\">Low severity<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">L1: Double entrypoint-initialize functions\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">L2: Using <\/span><span style=\"font-weight: 400;\"><code class=\"codehl\">transfer<\/code><\/span><span style=\"font-weight: 400;\"> instead of <\/span><span style=\"font-weight: 400;\"><code class=\"codehl\">call<\/code><\/span><\/p>\n<p><span style=\"font-weight: 400;\">L3: Missing initializers on constructors\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">L4: Strategy position limit calculation inaccuracy<\/span><\/p>\n<h3><span style=\"font-weight: 400;\">Warning severity<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">W1: Strict equality check for balances\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">W2: Potential depeg of ETH-based assets\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">W3: Vault is not ERC4626-compliant\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">W4: Protocol owner can set arbitrary exchange price to pools\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">W5: Pitfalls of the Ownable contract\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">W6: Protocol owner can artificially mint Vault shares\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">W7: Underflow can cause DoS in <\/span><span style=\"font-weight: 400;\"><code class=\"codehl\">confirmWithdrawal<\/code><\/span><\/p>\n<p><span style=\"font-weight: 400;\">W8: Users are not able to request more than one withdrawal\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">W9: Potential issues with retrieving borrow and supply caps<\/span><\/p>\n<h3><span style=\"font-weight: 400;\">Informational severity<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">I1: A function can be declared as a view function\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">I2: Missing documentation\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">I3: Typos and incorrect NatSpec comments\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">I4: Missing underscore in internal function name\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">I5: Modifier consistency on access controls\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">I6: Unused variable\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">I7: Unused using-for directives\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">I8: Unused imports\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">I9: Unused events\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">I10: Unchecked return value for OFT receipt<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">TRUST MODEL<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Users have to trust protocol owners to act honestly. This is because once they deposit funds into the Vault, they cannot withdraw them without external confirmation, and the withdrawn amount is also decided by the entity that confirms the withdrawal requests. Several findings were raised related to the trust model (see M3, W6, W4).<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">CONCLUSION<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Our review resulted in <strong>26 findings<\/strong>, ranging from Informational to Medium severity. All issues were addressed and were either fixed, partially fixed, or acknowledged with comments explaining the reasons.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The protocol demonstrated centralization, making its correct functioning highly dependent on the protocol owners (see M3). Additionally, we identified arithmetic and data validation issues that could lead to incorrect protocol accounting (see M1).<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><a href=\"https:\/\/ackee.xyz\">Ackee Blockchain Security<\/a> recommends Cian to:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Write a documentation;\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Create a comprehensive test suite;\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Focus on intermediary divisions and precision during calculations;<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Address all other reported issues.<\/span><\/li>\n<\/ul>\n<p><b>Ackee Blockchain Security\u2019s full Cian audit report, which includes a more detailed description of all findings and recommendations, can be found <\/b><a href=\"https:\/\/1717361315-files.gitbook.io\/~\/files\/v0\/b\/gitbook-x-prod.appspot.com\/o\/spaces%2FO9IZAEayToLEPbAGTwkL%2Fuploads%2FV02w5MYbK0RQhopzxvF8%2Fackee-blockchain-cian-yield-layer-report.pdf?alt=media&amp;token=64ead027-139d-4642-9fe0-db0e9e111e0d\"><b>here<\/b><\/a><b>.<\/b><\/p>\n<p><span style=\"font-weight: 400;\">We were delighted to audit Cian and look forward to working with them again.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Cian protocol&#8217;s yield layer allows users to deposit assets into a Vault contract to earn yield via multiple strategies. The protocol is interoperable cross-chain, offering pools on various chains that can hold a representation of the Vault token. This can be exchanged for deposit tokens on the given chain. METHODOLOGY Verification of technical specification The audit scope is confirmed with the client,&hellip;<\/p>\n","protected":false},"author":30,"featured_media":1003,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20,10,103],"tags":[89,24,104],"class_list":["post-1002","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-audits","category-ethereum","category-wake","tag-audit-summary","tag-ethereum","tag-wake"],"aioseo_notices":[],"featured_image_src":"https:\/\/ackee.xyz\/blog\/wp-content\/uploads\/2025\/02\/Cian_blog-og-600x400.png","featured_image_src_square":"https:\/\/ackee.xyz\/blog\/wp-content\/uploads\/2025\/02\/Cian_blog-og-600x600.png","author_info":{"display_name":"Tom\u00e1\u0161 Kova\u0159\u00edk","author_link":"https:\/\/ackee.xyz\/blog\/author\/tomas-kovarik\/"},"_links":{"self":[{"href":"https:\/\/ackee.xyz\/blog\/wp-json\/wp\/v2\/posts\/1002","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ackee.xyz\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ackee.xyz\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ackee.xyz\/blog\/wp-json\/wp\/v2\/users\/30"}],"replies":[{"embeddable":true,"href":"https:\/\/ackee.xyz\/blog\/wp-json\/wp\/v2\/comments?post=1002"}],"version-history":[{"count":0,"href":"https:\/\/ackee.xyz\/blog\/wp-json\/wp\/v2\/posts\/1002\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ackee.xyz\/blog\/wp-json\/wp\/v2\/media\/1003"}],"wp:attachment":[{"href":"https:\/\/ackee.xyz\/blog\/wp-json\/wp\/v2\/media?parent=1002"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ackee.xyz\/blog\/wp-json\/wp\/v2\/categories?post=1002"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ackee.xyz\/blog\/wp-json\/wp\/v2\/tags?post=1002"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}