{"id":371,"date":"2022-09-26T12:00:05","date_gmt":"2022-09-26T10:00:05","guid":{"rendered":"https:\/\/ackeeblockchain.com\/blog\/?p=371"},"modified":"2025-02-19T14:16:45","modified_gmt":"2025-02-19T12:16:45","slug":"zunami-uzd-audit-summary","status":"publish","type":"post","link":"https:\/\/ackee.xyz\/blog\/zunami-uzd-audit-summary\/","title":{"rendered":"Zunami: UZD Audit Summary"},"content":{"rendered":"<p class=\"p1\"><span style=\"font-weight: 400;\"><em>Update (18th August 2023)<\/em>: this audit report was performed on commit <code class=\"&quot;codehl\">53dc20a<\/code>. The <a href=\"https:\/\/ackee.xyz\/blog\/zunami-hack-post-mortem\/\">hack<\/a> was performed by a donation (price manipulation) into strategy MimCurveStakeDAO (<a href=\"https:\/\/raw.githubusercontent.com\/RektHQ\/Assets\/main\/images\/2023\/01\/zunami-steps.png\">step 3<\/a>) that was first added in commit <code class=\"codehl\">6df0ae533a718a34df70984d745cc2d70fb7172d<\/code> and was not in the scope of this audit.<\/span><\/p>\n<p><a href=\"https:\/\/www.zunami.io\/\">Zunami<\/a> engaged <a href=\"https:\/\/ackeeblockchain.com\/\">Ackee Blockchain<\/a>\u00a0<span style=\"font-weight: 400;\">to review and <a href=\"https:\/\/ackeeblockchain.com\/blog\/glossary\/audit\/\">audit<\/a> <\/span> the Zunami UZD between <strong>September<\/strong><b> 12 and 16, 2022<\/b>. The entire audit process was conducted with a total time commitment of<b> 4 engineering days<\/b>. We now publish a summary of our results.<!--more--><\/p>\n<h4 class=\"p2\"><b>Methodology<\/b><\/h4>\n<p class=\"p1\">We start by reviewing the specifications, sources, and instructions provided to us, which is essential to ensure we understand the project&#8217;s size, scope, and functionality. This is followed by due diligence using the static analysis tools <a href=\"https:\/\/getwake.io\">Wake<\/a> and <a href=\"https:\/\/ackeeblockchain.com\/blog\/glossary\/slither\/\">Slither<\/a>.<\/p>\n<p class=\"p1\">In addition to tool-based analysis, we continue with a detailed manual code review, which is the process of reading the source code line by line to identify potential vulnerabilities or code duplications. When the code review is complete, we run unit tests to ensure the system works as expected and potentially write missing unit or fuzzy tests. We also deploy the <a href=\"https:\/\/ackeeblockchain.com\/blog\/glossary\/smart-contract\/\">contracts<\/a> locally and try to attack and break the system.<\/p>\n<h4 class=\"p2\"><b>Scope\u00a0<\/b><\/h4>\n<p class=\"p1\">We audited commit <em><code class=\"&quot;codehl\">53dc20a<\/code><\/em><i>\u00a0<\/i>of the <code class=\"&quot;codehl\">ZunamiProtocol\/ZunamiStable<\/code>\u00a0repository.<\/p>\n<p class=\"p1\">During the security review,\u00a0<strong>we paid particular attention to<\/strong>:<\/p>\n<div class=\"page\" title=\"Page 9\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<ul>\n<li>ensuring the price caching can not be exploited;<\/li>\n<li>deposit\/withdrawal limits can not cause DoS;<\/li>\n<li>detecting possible reentrancies in the code;<\/li>\n<li>ensuring access controls are not too relaxed or too strict;<\/li>\n<li>looking for common issues such as data validation.<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<h4 class=\"p2\"><b>Findings<\/b><\/h4>\n<p class=\"p1\">Here we present our <a href=\"https:\/\/ackeeblockchain.com\/blog\/glossary\/findings\/\"><span class=\"s1\">findings<\/span><\/a>.<\/p>\n<h5 class=\"p5\"><b>Critical severity\u00a0<\/b><\/h5>\n<p class=\"p1\">No critical severity issues were found.<\/p>\n<h5 class=\"p5\"><b>High severity\u00a0<\/b><\/h5>\n<div class=\"page\" title=\"Page 11\">\n<div class=\"section\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p><strong>H1:<\/strong> Anybody can cause DoS of the protocol if the limits are set<\/p>\n<p><strong>H2:<\/strong> Daily deposit\/withdrawal limits can be violated<\/p>\n<div class=\"page\" title=\"Page 11\">\n<div class=\"section\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p><strong>H3:<\/strong> The <span style=\"color: #0000ff;\">previewWithdraw<\/span> function does not include fee calculation<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<h5 class=\"p5\"><b>Medium severity<\/b><\/h5>\n<div class=\"page\" title=\"Page 11\">\n<div class=\"section\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p><strong>M1:<\/strong> Fees can be set to 100% anytime<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"page\" title=\"Page 11\">\n<div class=\"section\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p><strong>M2:<\/strong> Two-phase transfer of ownership<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"page\" title=\"Page 14\">\n<div class=\"section\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<div class=\"page\" title=\"Page 12\">\n<div class=\"section\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p><strong>M3:<\/strong> Renounce ownership<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<h5 class=\"p5\"><b>Low severity<\/b><\/h5>\n<p class=\"p1\">No low severity issues were found.<\/p>\n<h5><b>Warning severity\u00a0<\/b><\/h5>\n<div class=\"page\" title=\"Page 15\">\n<div class=\"section\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<div class=\"page\" title=\"Page 12\">\n<div class=\"section\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p><strong>W1:<\/strong> Support for the meta-transactions<\/p>\n<div class=\"page\" title=\"Page 12\">\n<div class=\"section\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p><strong>W2:<\/strong> Variable shadowing of the <span style=\"color: #0000ff;\">owner<\/span> variable<\/p>\n<div class=\"page\" title=\"Page 12\">\n<div class=\"section\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p><strong>W3:<\/strong> Floating pragma<\/p>\n<div class=\"page\" title=\"Page 12\">\n<div class=\"section\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p><strong>W4:<\/strong> Usage of <span style=\"color: #0000ff;\">solc<\/span> optimizer<\/p>\n<div class=\"page\" title=\"Page 12\">\n<div class=\"section\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p><strong>W5:<\/strong> Missing package-lock.json<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<h5 class=\"p5\"><b>Informational severity\u00a0<\/b><\/h5>\n<div class=\"page\" title=\"Page 15\">\n<div class=\"section\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<div class=\"page\" title=\"Page 12\">\n<div class=\"section\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p><strong>I1:<\/strong> Unnecessary call for currentAssetPrice<\/p>\n<div class=\"page\" title=\"Page 12\">\n<div class=\"section\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p><strong>I2:<\/strong> Functions that could be external<\/p>\n<div class=\"page\" title=\"Page 12\">\n<div class=\"section\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p><strong>I3:<\/strong> Typos<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<h4 class=\"p2\"><b>Conclusion<\/b><\/h4>\n<p class=\"p1\">Our review resulted in <b>14 findings<\/b> ranging from <i>Informational<\/i> to <i>High <\/i>severity.<\/p>\n<div class=\"page\" title=\"Page 7\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>The most severe one was the possibility of DoS (H1).<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"page\" title=\"Page 8\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p><strong>We recommended Zunami to<\/strong>:<\/p>\n<div class=\"page\" title=\"Page 10\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<ul>\n<li>fix all high severity issues since it is not recommended for deployment and use in this state;<\/li>\n<li>reconsider Trust model of the protocol as long as it heavily depends on Owner;<\/li>\n<li>create documentation, including NatSpec code comments;<\/li>\n<li>address all other reported issues.<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p class=\"p1\"><b>Update:<\/b> Zunami provided an updated codebase that addresses the reported issues. We reviewed commit <code class=\"&quot;codehl\">335b852<\/code><em>\u00a0<\/em>on <strong>September 23, 2022<\/strong>. The scope was only related to the issues identified in this report.<\/p>\n<p>All findings were acknowledged and some of them (H2, H3, M1, M2, W2,\u00a0 W5, I1, I3) were fixed. <strong>The safety of the protocol now depends on the protocol administrators<\/strong> and the parameters they set up (such as withdraw\/deposit limits), see the discussion of issue H1 in the full audit report.<\/p>\n<p>&nbsp;<\/p>\n<p><b>Ackee Blockchain&#8217;s full <i>Zunami UZD<\/i>\u00a0audit report with a more detailed description of all findings and recommendations can be found <\/b><a href=\"https:\/\/github.com\/ZunamiProtocol\/ZunamiStable\/blob\/main\/audit\/abch-zunami-uzd-report.pdf\"><span class=\"s1\"><b>here<\/b><\/span><\/a><b>.<\/b><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Update (18th August 2023): this audit report was performed on commit 53dc20a. The hack was performed by a donation (price manipulation) into strategy MimCurveStakeDAO (step 3) that was first added in commit 6df0ae533a718a34df70984d745cc2d70fb7172d and was not in the scope of this audit. Zunami engaged Ackee Blockchain\u00a0to review and audit the Zunami UZD between September 12 and 16, 2022. The entire audit process&hellip;<\/p>\n","protected":false},"author":11,"featured_media":372,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20,10],"tags":[21,27,24,33,64,28,68,69,25],"class_list":["post-371","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-audits","category-ethereum","tag-audit","tag-blockchain","tag-ethereum","tag-evm","tag-security","tag-smart-contract","tag-solidity","tag-woke","tag-zunami-protocol"],"aioseo_notices":[],"featured_image_src":"https:\/\/ackee.xyz\/blog\/wp-content\/uploads\/2022\/10\/Zunami_cover-600x400.png","featured_image_src_square":"https:\/\/ackee.xyz\/blog\/wp-content\/uploads\/2022\/10\/Zunami_cover-600x600.png","author_info":{"display_name":"Andrea Nov\u00e1kov\u00e1","author_link":"https:\/\/ackee.xyz\/blog\/author\/andrea-novakova\/"},"_links":{"self":[{"href":"https:\/\/ackee.xyz\/blog\/wp-json\/wp\/v2\/posts\/371","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\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/ackee.xyz\/blog\/wp-json\/wp\/v2\/comments?post=371"}],"version-history":[{"count":0,"href":"https:\/\/ackee.xyz\/blog\/wp-json\/wp\/v2\/posts\/371\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ackee.xyz\/blog\/wp-json\/wp\/v2\/media\/372"}],"wp:attachment":[{"href":"https:\/\/ackee.xyz\/blog\/wp-json\/wp\/v2\/media?parent=371"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ackee.xyz\/blog\/wp-json\/wp\/v2\/categories?post=371"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ackee.xyz\/blog\/wp-json\/wp\/v2\/tags?post=371"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}