{"id":1055,"date":"2025-06-23T16:16:08","date_gmt":"2025-06-23T14:16:08","guid":{"rendered":"https:\/\/ackee.xyz\/blog\/?p=1055"},"modified":"2025-06-24T10:44:23","modified_gmt":"2025-06-24T08:44:23","slug":"safe-smart-account-audit-summary","status":"publish","type":"post","link":"https:\/\/ackee.xyz\/blog\/safe-smart-account-audit-summary\/","title":{"rendered":"Safe Smart Account Audit Summary"},"content":{"rendered":"<p class=\"p1\">Safe is a multi-signature smart contract wallet designed for collective management of digital assets. The wallet requires a predefined threshold of owner signatures before any transaction can be executed. To enhance functionality, Safe supports extensions through modules and fallback handlers.<\/p>\n<p class=\"p1\">Safe engaged Ackee Blockchain Security to perform a security review of Safe Smart Account with a total time donation of 20 engineering days in a period between April 14 and May 12, 2025. 6 engineering days were dedicated to manually-guided differential fuzzing using the <a href=\"https:\/\/getwake.io\"><span class=\"s1\">Wake<\/span><\/a> testing framework.<\/p>\n<p class=\"p1\">A second, fix review was performed between May 20 and May 27, 2025.<\/p>\n<h2><span style=\"font-weight: 400;\">METHODOLOGY<\/span><\/h2>\n<p class=\"p1\">We began our audit with a manual review of the codebase in parallel with manually-guided fuzzing using the <a href=\"https:\/\/getwake.io\"><span class=\"s1\">Wake<\/span><\/a> testing framework. For static analysis, we utilized <a href=\"https:\/\/getwake.io\"><span class=\"s1\">Wake<\/span><\/a> vulnerability and code quality detectors.<\/p>\n<p class=\"p1\">During the review, we focused on ensuring that:<\/p>\n<ul>\n<li class=\"p1\">basic concepts of Safe (such as owners management and signature checking) remain implemented correctly;<\/li>\n<li class=\"p1\">refactored assembly blocks labeled as memory-safe are indeed memory-safe;<\/li>\n<li class=\"p1\">reentrancy and front-running attacks are not possible;<\/li>\n<li class=\"p1\">standards such as <a href=\"https:\/\/eips.ethereum.org\/EIPS\/eip-165\"><span class=\"s1\">ERC-165<\/span><\/a>, <a href=\"https:\/\/eips.ethereum.org\/EIPS\/eip-1271\"><span class=\"s1\">ERC-1271<\/span><\/a> and <a href=\"https:\/\/eips.ethereum.org\/EIPS\/eip-712\"><span class=\"s1\">EIP-712<\/span><\/a> are implemented correctly;<\/li>\n<li class=\"p1\">integer overflows and underflows do not lead to security vulnerabilities;<\/li>\n<li class=\"p1\">the contract is compatible with <a href=\"https:\/\/eips.ethereum.org\/EIPS\/eip-4337\"><span class=\"s1\">ERC-4337<\/span><\/a> smart accounts;<\/li>\n<li class=\"p1\">backward compatibility is fully achieved through the <code class=\"codehl\">CompatibilityFallbackHandler<\/code><span class=\"s3\"> contract; and<\/span><\/li>\n<li class=\"p1\">common issues such as data validation are not present.<\/li>\n<\/ul>\n<h2><span style=\"font-weight: 400;\">SCOPE<\/span><\/h2>\n<p>The audit was performed on the commit <code class=\"codehl\">b115c4c<\/code>\u00a0in the <a href=\"https:\/\/github.com\/safe-global\/safe-smart-account\"><span class=\"s4\">safe-smart-account<\/span><\/a> repository. The scope of the audit included all Solidity files in the <code class=\"codehl\">contracts<\/code> <span class=\"s5\">directory, excluding <code class=\"codehl\">contracts\/examples<\/code><\/span><span class=\"s5\"> and <code class=\"codehl\">contracts\/test<\/code><\/span><span class=\"s5\">.\u00a0<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\"><code class=\"codehl\">d89d156<\/code><\/span> was initially used as the target commit, but it was later updated to include changes in the <code class=\"codehl\">CompatibilityFallbackHandler<\/code>\u00a0contract.<\/p>\n<p>The second, fix review was performed on commit <code class=\"codehl\">5d26505<\/code> in the <a href=\"https:\/\/github.com\/safe-global\/safe-smart-account\">safe-smart-account<\/a> repository.<\/p>\n<h2><span style=\"font-weight: 400;\">FINDINGS<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">The classification of a security finding is determined by two ratings: <\/span><b>impact<\/b><span style=\"font-weight: 400;\"> and <\/span><b>likelihood<\/b><span style=\"font-weight: 400;\">. This two-dimensional classification helps clarify the severity of individual issues. Issues which would be rated as <\/span><i><span style=\"font-weight: 400;\">medium<\/span><\/i><span style=\"font-weight: 400;\"> severity, but which would be likely discovered only by the team, are typically decreased by the likelihood factor to the <em>W<\/em><\/span><i><span style=\"font-weight: 400;\">arning<\/span><\/i><span style=\"font-weight: 400;\"> or <em>I<\/em><\/span><i><span style=\"font-weight: 400;\">nformational<\/span><\/i><span style=\"font-weight: 400;\"> severity ratings.<\/span><\/p>\n<p class=\"p1\">Our review resulted in 19 findings, ranging from Info to Medium severity. <strong>The most severe finding <span class=\"s1\">M1<\/span> was discovered through manually-guided fuzzing<\/strong>. The issue revealed a possibility of a front-running attack where an attacker could deploy a new Safe on behalf of a user without executing the intended callback. <span style=\"font-weight: 400;\">The issue sits in <code class=\"codehl\">SafeProxyFactory<\/code>, not the Safe account itself; it involves the (now-removed) <\/span><span style=\"font-weight: 400;\">createProxyWithCallback<\/span><span style=\"font-weight: 400;\"> method, and no existing Safes are affected. <\/span><b>The issue was not identified by earlier formal-verification checks and previous audits.<\/b><\/p>\n<p class=\"p1\"><span style=\"font-weight: 400;\">The M1 issue was found in already-deployed contracts of version 1.4.1 (and lower) across all supported chains.<\/span> Ackee Blockchain Security initiated an immediate responsible disclosure over a secure channel as soon as the finding was identified to mitigate any possible risk. The validity of the finding was promptly acknowledged by the Safe team, according to whom the issue has never been exploited. A <span style=\"font-weight: 400;\">fix is scheduled for Safe&#8217;s upcoming v1.5.0 release.<\/span><\/p>\n<p class=\"p1\">The code is well documented, and possible caveats and security considerations are explained. There is room for improvements in terms of user experience (<span class=\"s1\">W1<\/span>, <span class=\"s1\">W7<\/span>, <span class=\"s1\">I4<\/span>, <span class=\"s1\">I5<\/span>). The reviewed version of Safe is incompatible with <span class=\"s1\">EIP-7702<\/span> smart accounts.<\/p>\n<h3><span style=\"font-weight: 400;\">Critical severity<\/span><\/h3>\n<p>No critical severity issues were found.<\/p>\n<h3><span style=\"font-weight: 400;\">High severity<\/span><\/h3>\n<p>No high severity issues were found.<\/p>\n<h3><span style=\"font-weight: 400;\">Medium severity<\/span><\/h3>\n<p class=\"p1\">M1: Front-running attack can bypass callback execution during Safe deployment<\/p>\n<h3><span style=\"font-weight: 400;\">Low severity<\/span><\/h3>\n<p>L1: <code class=\"codehl\">CompatibilityFallbackHandler<\/code> does not provide full compatibility<\/p>\n<p>L2: Strict calldata check on <code class=\"codehl\">masterCopy<\/code><span class=\"s1\">\u00a0call<\/span><\/p>\n<h3><span style=\"font-weight: 400;\">Warning severity<\/span><\/h3>\n<p>W1: Misleading event emissions<\/p>\n<p class=\"p1\">W2: Use of precomputed <code class=\"codehl\">msg.data<\/code><\/p>\n<p class=\"p1\">W3: Scratch space assumed zeroed out<\/p>\n<p class=\"p1\">W4: Safe <code class=\"codehl\">setup<\/code> may emit outdated information<\/p>\n<p>W5: <code class=\"codehl\">onlyNonceZero<\/code><span class=\"s1\"> check can\u00a0<\/span>be bypassed<\/p>\n<p>W6: Locked tokens possibility<\/p>\n<p>W7: <code class=\"codehl\">ProxyCreationL2<\/code> nonce value is not user-given argument<\/p>\n<h3><span style=\"font-weight: 400;\">Informational severity<\/span><\/h3>\n<p class=\"p1\">I1: Documentation issues<\/p>\n<p class=\"p1\">I2: Unnecessary typecasts to <code class=\"codehl\">payable<\/code><\/p>\n<p class=\"p1\">I3: Code optimizations<\/p>\n<p>I4: Factory <code class=\"codehl\">initializer<\/code> error not propagated<\/p>\n<p>I5: No view function for <code class=\"codehl\">FallbackManager<\/code> handler address<\/p>\n<p>I6: <code class=\"codehl\">SafeStorage<\/code> can be defined as abstract<\/p>\n<p>I7: Missing L2-specific variant of <code class=\"codehl\">createChainSpecificProxyWithNonce<\/code><\/p>\n<p>I8: Interface type used for parameter that accepts zero address<\/p>\n<p>I9: <code class=\"codehl\">ChangedThreshold<\/code> event is emitted unconditionally<\/p>\n<h2><span style=\"font-weight: 400;\">TRUST MODEL<\/span><\/h2>\n<p class=\"p1\">Owners of a Safe have full control over the Safe. Any attached modules must be trusted, as they can execute arbitrary transactions from the Safe. Attached fallback handler must be trusted as it can verify <span class=\"s2\">ERC-1271 <\/span>signatures on behalf of the Safe.<\/p>\n<p class=\"p1\">Safe proxy factory may be trusted to provide a front-running protection when used correctly. I.e. it is guaranteed that a precomputed Safe address will belong to the intended owners as long as the Safe setup is performed as an initialization step of the proxy deployment.<\/p>\n<h2><span style=\"font-weight: 400;\">CONCLUSION<\/span><\/h2>\n<p class=\"p1\">Ackee Blockchain Security recommends Safe to:<\/p>\n<ul>\n<li class=\"p1\">\n<p class=\"p1\">document that the Safe account is not fully compatible with <span class=\"s1\">EIP-7702<\/span>;<\/p>\n<\/li>\n<li class=\"p1\">\n<p class=\"p1\">clearly mark files under <span class=\"s2\">contracts\/examples<\/span> as non-production code;<\/p>\n<\/li>\n<li class=\"p1\">\n<p class=\"p1\">document functionalities that are not supported by <code class=\"codehl\">CompatibilityFallbackHandler<\/code>;<span class=\"s3\">\u00a0and<\/span><\/p>\n<\/li>\n<li class=\"p1\">\n<p class=\"p1\">address all identified issues.<\/p>\n<\/li>\n<\/ul>\n<p><b><a href=\"https:\/\/ackee.xyz\">Ackee Blockchain Security<\/a>\u2019s full Safe audit report can be found <a href=\"https:\/\/github.com\/safe-global\/safe-smart-account\/blob\/8ce4fc7554290d8c29cfba4c005b527a35e74519\/docs\/Safe_Audit_Report_1_5_0_Ackee.pdf\">here<\/a><\/b><b>.<\/b><\/p>\n<p data-atomic=\"true\" data-lastedited=\"1749638433489.5\" data-sessionid=\"0d22f414-73be-471c-af6d-1efc00064dd3\" data-id=\"8cd026da-6619-4d7b-beb3-9e95ce7f5610\" data-pm-slice=\"1 1 [&quot;atom&quot;,{&quot;lastEdited&quot;:1749638433489.5,&quot;sessionId&quot;:&quot;0d22f414-73be-471c-af6d-1efc00064dd3&quot;,&quot;id&quot;:&quot;4e55bfde-654e-4271-a5f6-0cb4c402e73b&quot;,&quot;media&quot;:[],&quot;charCount&quot;:209,&quot;poll&quot;:null,&quot;isThreadFinisher&quot;:false,&quot;quoteURL&quot;:null,&quot;hideLinkPreview&quot;:false,&quot;linkPreview&quot;:null,&quot;numbering&quot;:null}]\">We are always delighted to work with Safe&#8217;s world-class team and look forward to auditing them again in the future.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Safe is a multi-signature smart contract wallet designed for collective management of digital assets. The wallet requires a predefined threshold of owner signatures before any transaction can be executed. To enhance functionality, Safe supports extensions through modules and fallback handlers. Safe engaged Ackee Blockchain Security to perform a security review of Safe Smart Account with a total time donation of 20 engineering&hellip;<\/p>\n","protected":false},"author":30,"featured_media":1057,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20,10,103],"tags":[21,89,24,101],"class_list":["post-1055","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-audits","category-ethereum","category-wake","tag-audit","tag-audit-summary","tag-ethereum","tag-safe"],"aioseo_notices":[],"featured_image_src":"https:\/\/ackee.xyz\/blog\/wp-content\/uploads\/2025\/06\/Safe-blog-600x400.png","featured_image_src_square":"https:\/\/ackee.xyz\/blog\/wp-content\/uploads\/2025\/06\/Safe-blog-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\/1055","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=1055"}],"version-history":[{"count":0,"href":"https:\/\/ackee.xyz\/blog\/wp-json\/wp\/v2\/posts\/1055\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ackee.xyz\/blog\/wp-json\/wp\/v2\/media\/1057"}],"wp:attachment":[{"href":"https:\/\/ackee.xyz\/blog\/wp-json\/wp\/v2\/media?parent=1055"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ackee.xyz\/blog\/wp-json\/wp\/v2\/categories?post=1055"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ackee.xyz\/blog\/wp-json\/wp\/v2\/tags?post=1055"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}