<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>Audit Your Contracts</title>
        <link>https://paragraph.com/@ayc</link>
        <description>FAFO with security on and off chain.</description>
        <lastBuildDate>Sat, 21 Nov 2026 19:28:50 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>en</language>
        <image>
            <title>Audit Your Contracts</title>
            <url>https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/518b34504c587f3933d5bee9058b1a7c.jpg</url>
            <link>https://paragraph.com/@ayc</link>
        </image>
        <copyright>All rights reserved</copyright>
        <item>
            <title><![CDATA[Recovering Safe Wallet Signatures]]></title>
            <link>https://paragraph.com/@ayc/recover-safe-wallet-signers</link>
            <guid>iSfqtinDU8usT8Iz2Jha</guid>
            <pubDate>Sun, 22 Sep 2024 23:27:34 GMT</pubDate>
            <description><![CDATA[I recently presented some analysis at the Ethereum Engineering Group Meetup on the WazirX hack. The analysis answered a recurring question that kept surfacing in my mind: Was it more cost-effective (time/complexity) for the WazirX attacker to find a vulnerability or bypass in Liminal Custody, or to compromise a 4th WazirX signatory? Answering this question is a challenge and requires you to calculate hashes from specific states and then recover the signers. To further my understan...]]></description>
            <content:encoded><![CDATA[<div class="relative header-and-anchor"><h3 id="h-introduction">Introduction</h3></div><p>I recently presented some analysis at the Ethereum Engineering Group Meetup (<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.youtube.com/watch?v=BYmAlhmTJ5s">Youtube</a> and <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.youtube.com/redirect?event=video_description&amp;redir_token=QUFFLUhqa3QtUDNyUXhCM1J2dXFpeUxSb0VaZ2tDTVdWQXxBQ3Jtc0tuNnFwOVNyWE1BM2xseXRUdFpmQThlUGJkWmhkTUhhR0RQd0s4R2dyWkdkRGpzUzhfME9uUS02SExRZE5QVENpT2FEb1ZGQzVMdVBLVUZlU3dJS2hlNm9FZjIyTFBCVXhjOUc4QzdGMFIwNWx2RG9DYw&amp;q=https%3A%2F%2Fdrive.google.com%2Ffile%2Fd%2F1_OnctLPo_Qymb5MV2zu5KRe3q22IQ7dF%2Fview%3Fusp%3Dsharing&amp;v=BYmAlhmTJ5s">Slides</a>) on the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://paragraph.xyz/@ayc/a-deep-dive-of-the-dollar230-million-wazirx-compromise">WazirX hack</a>. The analysis answered a recurring question that kept surfacing in my mind: Was it more cost-effective (time/complexity) for the WazirX attacker (Lazarus) to find a vulnerability or bypass in Liminal Custody, or to compromise a 4th WazirX signatory? Answering this question is a challenge and requires you to calculate hashes from specific states and then recover the signers.</p><p>To further my understanding, I set a learning objective: recover the signing addresses for the WazirX multisig from on-chain data. This investigation allowed me to explore tools like <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/alloy-rs">Alloy</a> and <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/foundry-rs/foundry/tree/master/crates/anvil">Anvil</a> while connecting various pieces of knowledge I had about Ethereum and the EVM.</p><p>If you want to catch up on the WazirX hack you can read my <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://paragraph.xyz/@ayc/a-deep-dive-of-the-dollar230-million-wazirx-compromise">previous post</a>.</p><div class="relative header-and-anchor"><h3 id="h-tldr">tl;dr</h3></div><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/audityourcontracts/secure-decoder/tree/main/src/onchain">onchain</a> is a Rust CLI application that deploys a custom signature decoder contract and iterates through events emitted by Gnosis Safe Wallets in chunks of 10,000 blocks to find occurrences of the event <code>ExecutionSuccess</code>. </p><div data-type="callout" type="info"><div class="callout-base callout-info" data-node-view-wrapper="" style="white-space:normal"><img src="https://paragraph.xyz/editor/callout/information-icon.png" class="callout-button"><div class="callout-content"><div><p>The source code for the project is <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/audityourcontracts/secure-decoder">here</a>.</p></div></div></div></div><p></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/7ded03e4f2b17d9b8c99ee5058bfbb62.png" blurdataurl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAYCAIAAAAUMWhjAAAACXBIWXMAAA7EAAAOxAGVKw4bAAADSUlEQVR4nLWVQUgbaRTHv4MHIQcvIh68eSiU7k0arLcwXZFpdiUQWEQIMpDqIRC8uZeUKmxdQbCEwBAY5jQmDrHTpp2aTh1DswEhMLhoQ9a0w0DlS8LabIVhbCdf+xXmqyFr3GbV9h2GIfne+73/+957A/DlzLZtjuPi8bgsyyzL5nK5UwfAJQEYYwghy7KEYdv2xQGozUi4RCIxPDxM0/T4+LimaeTkt1FgO4DJyUkAgMvlGhgYiEajFwQghGKxmKqq9XpdURRVVTeVzWqlijGenp7u7u4GAJDnKcfOAOSkI4piKBRiGOZ2MBiPx9eSyTuRyPzduxhjn883NDTEcRwAYHFxsYOC1hK3AgqFwtzc3NTU1Kqw+u6fd4Zh7P+1v5ZcwxhPTEwAxwYHBy9yB+gEZtt2uVzeUreKxSLLshDCjY0NjPHR0ZGu64Zj7e6nAaVSSXOsXC63RmcYxuVy6br+XFGqlYokSQcHB7Isn8q3M0DX9UQiIQhCM518Pj87OxsOh+fn5+v1uiiKbw8PLct6ubeXElPNJNon4AwAQkiSJIqiAoFAOp3GGEuSFA6HIYTNTEulUiqVSqfTD9bXSRJNlWdK+QIg/ymKMjo6StO0x+P58SaVz/9hWZZpmuQCvlKKYrEoiiI5eTaACGQYxu12e73eW17v9RsjMzMzGGPLsr7eaRBCjuOWl5cFQWhP4l8KotEoRVFjY2M//+Sl3deepBIY4wZCjZb6toYgafE873a7/X6/x+Pp0Kbvj49XVlauXvvhCgA3APgFgDev9/8+fNsaGiFUPzEiLhAIkDno7+/neb7DHDRsWzeM7RS/vvjrn2khk3kaCoVisRiEkLitJZP3V+7zPL+0tES6KBgMEkBXV1fnVdFeRNM0s9ksTdN9fX2mad777d6L7IudnR1BEH53FoPP56MoSlGUnp6ehYWF/zXJqNFA9odPHz82b3J3d3dkZOTl3l4ulzMMI6NkXr1+9dhpZb/fTxT09vZub29fZJuiE0ytVttUNjVNi0QimqY9yzwjP2YdKxQK7b7n+x7UajVJksj+ab6fb1V0lCLL8qOHj7bUrVVBUFW1dSy+AQA7c1etVKqVKoTwv/bPpQDnte8O+Axgpd852xdYFgAAAABJRU5ErkJggg==" nextheight="768" nextwidth="1024" class="image-node embed"><figcaption htmlattributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Upon detecting an event, the application constructs a Safe Transaction Hash and a Safe Data Hash using the <code>nonce</code> and <code>threshold</code> from the block prior to the transaction. Tools like <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/alloy-rs">Alloy</a> support contract calls at specific block numbers using <code>.block()</code>. Querying the <code>nonce</code>, <code>threshold</code>, and transaction <code>input</code> (to decode the calldata) can be done via a standard Ethereum RPC, so forking the main-net state isn't necessary.</p><p>A custom <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/audityourcontracts/secure-decoder/blob/main/forge/src/SafeDecoder.sol">Safe Decoder contract</a> is deployed to a local Anvil chain by the <code>onchain</code> program. This decoder contract is used to extract signers when provided with the Safe Transaction Hash, Safe Data Hash, <code>threshold</code>, and <code>signatures</code> parameters.</p><p>Putting it all together;</p><ol><li><p>Find all past transactions for the WazirX Safe Wallet that emit an event for <code>ExecutionSuccess</code>.&nbsp;</p></li><li><p>Decode the transaction <code>input</code> or calldata with respect to the ABI for the <code>executeTransaction</code> function giving you all the Safe Wallet transaction parameters including the operation type and the signers.</p></li><li><p>Query the <code>nonce</code> and the <code>threshold</code> from the block before the transaction to calculate the Safe Transaction Hash and the Safe Data Hash.</p></li><li><p>Pass the transaction hash, data hash, signatures and threshold to SafeDecoder and return a list of the signers.</p></li></ol><div class="relative header-and-anchor"><h3 id="h-alternatives-to-this-approach">Alternatives to this approach</h3></div><p>Safe Global provides an <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://safe-transaction-mainnet.safe.global/"><u>API</u></a> that returns signers<em> <u>if you know the safe transaction hash</u></em>. For example, you can use;</p><pre data-type="codeBlock" language="bash"><code>https://safe-transaction-mainnet.safe.global/api/v1/multisig-transactions/0x4e82121a3bc2fb62c0b06ab5fff5ca965ceab4f51cc949c6e50d85ed63e6aa70/confirmations/</code></pre><p>By passing in the transaction Safe Transaction Hash (not the Ethereum transaction hash), the API will return the list of signers and their signatures. Here's an example of the response:</p><pre data-type="codeBlock"><code><span class="hljs-punctuation">{</span>
  <span class="hljs-attr">"count"</span><span class="hljs-punctuation">:</span> <span class="hljs-number">4</span><span class="hljs-punctuation">,</span>
  <span class="hljs-attr">"next"</span><span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">null</span></span><span class="hljs-punctuation">,</span>
  <span class="hljs-attr">"previous"</span><span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">null</span></span><span class="hljs-punctuation">,</span>
  <span class="hljs-attr">"results"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
    <span class="hljs-punctuation">{</span>
      <span class="hljs-attr">"owner"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"0x9AF78003CecC2383d9D576A49c0C6b17fc34Ae34"</span><span class="hljs-punctuation">,</span>
      <span class="hljs-attr">"submissionDate"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"2024-07-18T06:17:47Z"</span><span class="hljs-punctuation">,</span>
      <span class="hljs-attr">"transactionHash"</span><span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">null</span></span><span class="hljs-punctuation">,</span>
      <span class="hljs-attr">"signature"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"0x3da7c6bd7c130430cf662de3d9af067c4a0629f849e29003c40ad3979cd670720c3ceb3a61e38fb7166353e3262eb6554c3f6571807cf22f9bdc4a83a56441661f"</span><span class="hljs-punctuation">,</span>
      <span class="hljs-attr">"signatureType"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"ETH_SIGN"</span>
    <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
    <span class="hljs-punctuation">{</span>
      <span class="hljs-attr">"owner"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"0xD83b89E261D02B0f2f9E384B44907f8d380E9AF0"</span><span class="hljs-punctuation">,</span>
      <span class="hljs-attr">"submissionDate"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"2024-07-18T06:17:47Z"</span><span class="hljs-punctuation">,</span>
      <span class="hljs-attr">"transactionHash"</span><span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">null</span></span><span class="hljs-punctuation">,</span>
      <span class="hljs-attr">"signature"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"0x8e64a89386af2f223b8433a1df65db8f0ff60544b2f02c56ec02b640d6fb15a11f7dffda5b99b0292b5e02d0cc44508d7d8f994515358e9da3016d8098b2258820"</span><span class="hljs-punctuation">,</span>
      <span class="hljs-attr">"signatureType"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"ETH_SIGN"</span>
    <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
    <span class="hljs-punctuation">{</span>
      <span class="hljs-attr">"owner"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"0xd967113224C354600B3151E27Aaba53e3034f372"</span><span class="hljs-punctuation">,</span>
      <span class="hljs-attr">"submissionDate"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"2024-07-18T06:17:47Z"</span><span class="hljs-punctuation">,</span>
      <span class="hljs-attr">"transactionHash"</span><span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">null</span></span><span class="hljs-punctuation">,</span>
      <span class="hljs-attr">"signature"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"0x000000000000000000000000d967113224c354600b3151e27aaba53e3034f372000000000000000000000000000000000000000000000000000000000000000001"</span><span class="hljs-punctuation">,</span>
      <span class="hljs-attr">"signatureType"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"APPROVED_HASH"</span>
    <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
    <span class="hljs-punctuation">{</span>
      <span class="hljs-attr">"owner"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"0xfA54B4085811aef6ACf47D51B05FdA188DEAe28b"</span><span class="hljs-punctuation">,</span>
      <span class="hljs-attr">"submissionDate"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"2024-07-18T06:17:47Z"</span><span class="hljs-punctuation">,</span>
      <span class="hljs-attr">"transactionHash"</span><span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">null</span></span><span class="hljs-punctuation">,</span>
      <span class="hljs-attr">"signature"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"0x40082eba0f71627a3451d47132b8f4c266bc9be2bebe4424848757d10f13e76963af0b543a2357765d9f290410e919301ad065f0f2efa1233eb8634c93111f0e20"</span><span class="hljs-punctuation">,</span>
      <span class="hljs-attr">"signatureType"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"ETH_SIGN"</span>
    <span class="hljs-punctuation">}</span>
  <span class="hljs-punctuation">]</span>
<span class="hljs-punctuation">}</span>
</code></pre><p>I didn’t have the Safe Transaction Hashes for the WazirX Safe Wallet until I calculated them from on-chain data. Once I had them, I found it easier to use my own decoder contract. However, I could have also submitted them to Safe’s API.</p><div class="relative header-and-anchor"><h3 id="h-finding-matching-events">Finding matching events</h3></div><p>When you examine the logs of <code>execTransaction()</code> on a <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://etherscan.io/tx/0x48164d3adbab78c2cb9876f6e17f88e321097fcd14cadd57556866e4ef3e185d#eventlog"><u>Safe Wallet</u></a>, you'll notice that it emits an <code>ExecutionSuccess</code> event. To find the corresponding event signature, you take the name of the event along with its parameters and compute a Keccak-256 hash to generate the topic hash.</p><p>For example in Chisel;</p><pre data-type="codeBlock"><code>➜ <span class="hljs-built_in">keccak256</span>(<span class="hljs-string">"ExecutionSuccess(bytes32,uint256)"</span>)
Type: <span class="hljs-keyword">bytes32</span>
└ Data: <span class="hljs-number">0x442e715f626346e8c54381002da614f62bee8d27386535b2521ec8540898556e</span></code></pre><p><strong>Note:</strong> Be sure to remove any whitespace and parameter names, leaving only the types when calculating the hash.</p><p>In the <code>onchain</code> application, the <code>event_signature</code> is defined, and the RPC is used to process 10,000 blocks at a time, searching for transactions that match the event signature:</p><pre data-type="codeBlock" language="rust"><code><span class="hljs-comment">// keccak256("ExecutionSuccess(bytes32,uint256)")</span>
<span class="hljs-keyword">let</span> <span class="hljs-variable">execution_event</span> = b256!(<span class="hljs-string">"442e715f626346e8c54381002da614f62bee8d27386535b2521ec8540898556e"</span>);

<span class="hljs-keyword">let</span> <span class="hljs-variable">filter</span> = Filter::<span class="hljs-title function_ invoke__">new</span>().<span class="hljs-title function_ invoke__">address</span>(safe_wallet_address).<span class="hljs-title function_ invoke__">event_signature</span>(execution_event).<span class="hljs-title function_ invoke__">from_block</span>(from_block).<span class="hljs-title function_ invoke__">to_block</span>(to_block);</code></pre><p>To improve efficiency, it's crucial to filter by the <code>safe_wallet_address</code> and search for all events emitted by that contract. This is much faster than looking for events across all contracts. Once the logs are iterated over, the transaction_hash can be used to query the RPC provider for the calldata (input) associated with the transaction. This calldata is then decoded using the ABI for <code>execTransaction()</code>.</p><div class="relative header-and-anchor"><h3 id="h-decoding-the-transaction-calldata">Decoding the transaction calldata</h3></div><p>Alloy makes it really easy to incorporate an ABI for a function using the <code>solc!</code> Macro. For example;</p><pre data-type="codeBlock" language="rust"><code>sol!(
    <span class="hljs-meta">#[allow(missing_docs)]</span>
    <span class="hljs-meta">#[derive(Debug)]</span>
    <span class="hljs-keyword">enum</span> <span class="hljs-title class_">Operation</span> {
        Call, 
        DelegateCall,
    }

    <span class="hljs-meta">#[allow(missing_docs)]</span>
    <span class="hljs-meta">#[derive(Debug)]</span>
    function <span class="hljs-title function_ invoke__">execTransaction</span>(
        address to,
        uint256 value,
        bytes calldata data,
        Operation operation,
        uint256 safeTxGas,
        uint256 baseGas,
        uint256 gasPrice,
        address gasToken,
        address payable refundReceiver,
        bytes memory signatures
    ) public payable <span class="hljs-keyword">virtual</span> <span class="hljs-title function_ invoke__">returns</span> (<span class="hljs-type">bool</span> success);
);</code></pre><p>Then I can use these types to <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/audityourcontracts/secure-decoder/blob/main/src/onchain/main.rs#L138"><u>decode</u></a> the transaction input;</p><pre data-type="codeBlock" language="rust"><code><span class="hljs-keyword">let</span> <span class="hljs-variable">decoded</span> = execTransactionCall::<span class="hljs-title function_ invoke__">abi_decode</span>(&amp;tx.<span class="hljs-title function_ invoke__">unwrap</span>().input, <span class="hljs-literal">false</span>);</code></pre><p><code>execTransactionCall</code> is generated for you without you needing to do anything else except define the <code>solc!</code> macro. Notice I was also able to define the <code>enum Operation</code> in the same declaration.</p><p>It begs the question as to why I want these decoded parameters to the original <code>execTranscation()</code>. The parameters are required to calculate the Safe Transaction Hash by calling <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/audityourcontracts/secure-decoder/blob/main/src/onchain/main.rs#L194"><u>getTransactionHash()</u></a> and the Safe Data hash by calling <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/audityourcontracts/secure-decoder/blob/main/src/onchain/main.rs#L219"><u>encodeTransactionData()</u></a>.</p><p>For the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/audityourcontracts/secure-decoder/blob/main/src/onchain/main.rs#L154"><u>nonce</u></a> and <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/audityourcontracts/secure-decoder/blob/main/src/onchain/main.rs#L168"><u>threshold</u></a> I call the contract and get the values for the block <em>before</em> the transaction that emitted the event. This is a little naive as there could be multiple transactions in a block but for the investigation of WazirX it was fine.</p><div class="relative header-and-anchor"><h3 id="h-returning-the-signers">Returning the Signers</h3></div><p>I knew the signers were returned by the <code>ecrecover</code> function in the Gnosis Safe Wallet <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/safe-global/safe-smart-account/blob/main/contracts/Safe.sol#L313"><u>checkNSignatures()</u></a> and I could see it when I ran the following cast command;</p><pre data-type="codeBlock" language="rust"><code>cast run <span class="hljs-number">0x48164d3adbab78c2cb9876f6e17f88e321097fcd14cadd57556866e4ef3e185d</span> --verbose --rpc-url=$ETH_RPC_URL --no-rate-limit --decode-internal</code></pre><p>However there was no way to programmatically access them. I toyed with the idea of porting <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/safe-global/safe-smart-account/blob/main/contracts/Safe.sol#L272">checkNSignatures()</a> to Rust however I wanted to do just enough to solve the problem and no more.</p><p>What I ultimately wanted was a function like <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/safe-global/safe-smart-account/blob/main/contracts/Safe.sol#L272">checkNSigatures()</a> but have it store and return an array of addresses for all the signers. So I copied the bulk of <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/safe-global/safe-smart-account/blob/main/contracts/Safe.sol#L272">checkNSignatures()</a> and required libraries across to SafeDecoder’s <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/audityourcontracts/secure-decoder/blob/main/forge/src/SafeDecoder.sol#L12"><u>returnSigners()</u></a>.</p><p>I removed all the <code>require</code> statements and appended each address to an array of addresses then returned them at the end of the function call. This <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/audityourcontracts/secure-decoder/blob/main/forge/src/SafeDecoder.sol#L62C1-L71C61"><u>snippet</u></a> is a good example of the approach;</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/231f0cac149ed3f33afc0dd1a96c1755.png" blurdataurl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAGCAIAAAAt7QuIAAAACXBIWXMAABYlAAAWJQFJUiTwAAABaElEQVR4nGOwsjKZOn9uXnFhY2N9V2dTcJCvrq6ejY2Nt7e3i4uro5OTPG4gQQRgEBQUMtA3qK2paWpqiY6OaayrriovrywrnTK5v76mctqU3qioKDU1NRsbG2dnZ10wcHZ2trGx0dXVFQQDCQkJCAONDQEMEhISUVFRe/fu27F7b1FR8erF8+dNnTKlv7Ovp2PV4nnr1yxpampKSkpydnYOCgpKSkrKysoKAgNvb+8oMHB2dvYGAxsbGxMTE29vb2cwgIiALPDw9V2xdPGvD0/PH923be2yvXv33bv/+MWLV3MXLImNjIcYB7EgKCgoKioqKCjIBgyioqK8vb3V1NTk5eUhJIQBB/Ly8gwycnLSUtIZqWlr1qxpa2mqLCuuqqqZPXvu1BkztHX0uTg42NjYIJ6FMNjAAFmEQBwoKsjnFhf39Xf1tdTOn9I7tb+toqxi6owZ8+bOs7O1iw6Nig6NIiYycVkAAAndl9dAG7h3AAAAAElFTkSuQmCC" nextheight="366" nextwidth="1952" class="image-node embed"><figcaption htmlattributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>After <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/audityourcontracts/secure-decoder/blob/main/src/onchain/main.rs#L245"><u>returnSigners()</u></a>  iterates through all the signature data, and recovers all the signers it <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/audityourcontracts/secure-decoder/blob/main/forge/src/SafeDecoder.sol#L95"><u>returns them as an array</u></a> at the end of the function.</p><p>I could even test using <code>forge test</code>, see the tests <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/audityourcontracts/secure-decoder/blob/main/forge/test/SafeDecoder.t.sol">here</a>;</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/a635182c70cbbd84fbfadaef1491a24e.png" blurdataurl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAHCAIAAADmsdgtAAAACXBIWXMAABYlAAAWJQFJUiTwAAACCElEQVR4nGNw9fYuqKjIzUyvKcvtairrba/qrC8vysuoa2/w8HCxMDcyMtIzMtKzMDdycrKxsjSxMDcSlxAXFBLkFxTgF+SHIDAXwgYJCgoJQkQkJSUZtHV1b96+fejQoRN79v1///nDrcffHr/8/+bT/y//X19/8Pf5+y/3X7y6fu/L/Rf/333///7LtwevZ3dPn9Y2ZVrblCVTFiyasGBmx/QJDX1zembP75s3r3f2hIa+yS0T5vTMbilvMtA3YFCQl584cdLhw0fmzVs0bdKs9pr2uKA4D3vPCJ+IML/w+LDE+NCE+NCEMO+wCJ+I9Jj0lOiU+PD42JDo3KTs0sySitzyspyy0syS6vxKCLsiu7w6v7KmoKausNbDxYNBTV29KC8jJye7oKIiMy+nvLwkKSWpqKysqKgwLSk6JyMxIiqisLQkIirC1883KzsrLCIcxMjJySvIT0hOUtfS5OLhRA4uOOLm4RaXEGdQVlb29fO9df7oiYM7N6xZvW7V+ndv3p87dWTu3LmlxUV2jk4aGpoG+vp6enpamloQUkNDQ09Pz0DfQE9PT0VFRUFeAReSk5NjUFJW1tHVy8/LT01KyExNTk1Mj4+Od3Z0TEtL8/f3U1VR0dPTkwQDOTk5CAMZyBECDBB3QRxlY2trbmFuY2tjY2tjZ2dnY2vjAgbKysoEDcJlAQBLztg0KjPXjgAAAABJRU5ErkJggg==" nextheight="502" nextwidth="2252" class="image-node embed"><figcaption htmlattributes="[object Object]" class="hide-figcaption"></figcaption></figure><p><code>onchain</code> <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/audityourcontracts/secure-decoder/blob/main/src/onchain/main.rs#L110"><u>deploys</u></a> the Safe Decoder Contract and then calls <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/audityourcontracts/secure-decoder/blob/main/src/onchain/main.rs#L245"><u>returnSigners()</u></a> to return an array of signing addresses.</p><p>To be able to deploy SafeDecoder you need to execute <code>forge build</code> and then navigate to the <code>out/</code> directory and find the JSON build artifact for SafeDecoder. See the figure below;</p><figure float="none" width="319px" data-type="figure" class="img-center" style="max-width: 319px;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/db11a02a6609a6fa79e538255195afce.png" blurdataurl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAgCAIAAAB7KQSlAAAACXBIWXMAABYlAAAWJQFJUiTwAAACsUlEQVR4nJWSMWgUQRSGR9iAsIpMig1bLIGJzpkXXIVJmMAoGc0U02wRhBP31BRHJAhRcoFT0nioTYqAlZVotAnaLJFrDsHiULSxiJEUFmkSBK8QxDSCsrIzGGKSzV1+huWWfd/97/3zkGfk+75SKggCSgsAQCkFAIwx55xSags8z8MYAwDCGCOEPK+n0Xjt+/7Y2EVKC5OTk5VKBQB+/frteR7PNOwYEUJQEASMsVLpSq12L45jIYSUkhDiui7G2P6WUgKA7/sAIIRAnPNGo9FsNpMkabVaq6urm5ubjDH7r0qp8fHxubm5crmstZ6dnZ2ens56A4BqtTo/P5/5IuQ4jjWxsmNYOY5DKc0YQkgcx0mSFIvFIAhwvlzXzRjXde1IzWazXq/Hcew4TnuGEGKHk1Ju76SNTxRFxWKRENIRg82U5XJ5amoKoey1Ix9qbp1zbpPZHtp+PowxpVQYhgBACGnPYIwppUIIrbW98jyr/xgwuSmlOOdKqY56o5SGYWjjZozZpW7DAABjTEqplLLYARitNedcCBEEgV3T/ebhplQZaa2VUkIIzrnv+7k+wuRmGSkl55wZ5TKUUqVUFEVSSiFE9gFl153bm2cYG4AV53zPxdubESbuAzBaa8aYDaOjrIXJwD5tALs3aCcjjfJSzvWRhtnaht3LuvNOlamLosj6WLXJgJuNtgHY3sIwzPPp9rwe21sURedGRqQ8f2F0VEp5sr/fVHZvHdc9SmkBHe5Cx450negjw0ODZwUfHhocgMLgmdOnBuB4Xy9CWcHWOYRQH+lFE7Xk6u0XD54168s/vvxMN/6k79fTz9/TD+vp27X0aePrtTuLE7Xk33l14/5LVJpZuHTrSfXh0qOl5ZVW+qmVvltLV8zz40a6+OZb8ebj0syCPZcrC9fvPv8Locwk0RYLAfkAAAAASUVORK5CYII=" nextheight="968" nextwidth="502" class="image-node embed"><figcaption htmlattributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Within this JSON file is the bytecode for the SafeDecoder contract that will be deployed on the local Anvil chain. In the SafeDecoder.json file there are two bytecode sections - <code>bytecode</code> and <code>deployed_bytecode</code>. We want to use the <code>bytecode</code>.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/00b57a58d9301ee251c0dbe91b933bdf.png" blurdataurl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAANCAIAAABHKvtLAAAACXBIWXMAABYlAAAWJQFJUiTwAAADnUlEQVR4nEVRTWgbRxTeiy7CyEjGsqhDL41SOcWGIntlSau119rd2Z3d2SySY0oSQ6qiBINaYYdQh+K21CFum0NbaJuSUMuuVCmWf/pDDwGTQ0+lpL2EtjIxdiRXxmoOubmUQpjyZmV3+Hi8933vvXnzhvP5unoCvZyrw+Xu9Hj9Hq+fc3V4vH6Xu9Pt6fL4ejxev9cX8HYHjnlvd8Dj9Qeee97l7gTS1+P2dHV0djvljs8dn1MnXxg3x+beOJ+bNPMZ+0r2bP6ilb9ozWTTV7Lp6Uxquk2eyU0a+Yw9k03nJs3pjA0hZBKWkD5vDE9oEQfnSHwc8WfVISF8kvvjm/doc5XuV2mjQlvr4Dz5to3WBuNLYFsbgL27dK9CD9bowTptrgB/jN0SoFGh9TI49QptVZ/8+DG3v/kBbVZpbZE+WqY7ZbD/O0t0pwQOqEW6XaS1Av3tDtjtIv1zFdJqBZZfojtFZkt0t0zrKyDtV39fe5t7fO8GPdiAuC18DahXgKlXaHMN6usrR1K5ndBOLsFNkMxaO30dvrZEn/5Q++46V7/3PryotsQmLYD2mHV3KmuL7XkdtVagW8sQNu6y61ehdq9Cm+sQ1svANKvgP1qmT79vbN7kWvdv0r826NaXsL7mCti9Cux96w7dXgRmt8hWXASpUaG7X8FnbBcPH9z699fbhz9/xvA5s58+e1j455fbzx4uHj744u+fPtm8leNeHZfnZzILs5fnchcWZi99+NbU/Exm/mrm+tXXbryZXZi9fG3qlXfzk3O5C4y5dG3q3EfvvJ7LTChjI6YmpyxTVyRdkZSxkTMGMjWF6GrKMk1NlhKx/r4XuaFhQRCTMWGUQRIlJMl6nDFxMZmQVEnGooTiYlJgSEiqICoKMlWkq0jH2ErKqo6JjgnGZDSpqEjXMVGRnkpPJMRRLsJHCDuyLCN2MDY0TVMVVVWQLMu2nWKqQojl8BhjXcMI6Qa2ENIwNhDSkrKCkI6QZmALY0OWFV3DQ4M8x/PDtp1yKEIsjAlCmiQlEdIJsQixFOhoKIrKVIPx9pGvsSrbaY2xgeEdhoN0ejwajcEFGBNJGpPZCIqiyrLiND0uIKQ96dEEum2n2ctsJ8G204RYThOHQbA9Eg4PcsFgiOcjojgSjcYEIRGNxkVxRBCEaDSGkCYIQjg8yPMRno+cPv2Sg1Cor79/IBTq4/nIwMDLweCpYDDohMwHhEJ94fBgb++J/wBqeFKbFC6+pwAAAABJRU5ErkJggg==" nextheight="1500" nextwidth="3668" class="image-node embed"><figcaption htmlattributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>The <code>bytecode</code> needs to be copied to the bytecode value in the <code>solc!</code> declaration for the SafeDecoder contract. I’ve truncated it here with <code>…</code> at the end.</p><pre data-type="codeBlock" language="rust"><code><span class="hljs-comment">// This is the decode contract in bytes. You need to build using forge build then navigate to the build `out` directory, </span>
<span class="hljs-comment">// find the SafeDedoder.sol json and copy out the bytecode (not the deployed bytecode) and copy here.</span>
sol! {
    <span class="hljs-meta">#[allow(missing_docs)]</span>
    <span class="hljs-comment">// Needs to bytecode not deployed_bytecode.</span>
    <span class="hljs-meta">#[sol(rpc, bytecode=<span class="hljs-string">"0x6080604052348015610010576000..."</span>)]</span>
    contract SafeDecoder {
        address[] public addresses;
    
        function <span class="hljs-title function_ invoke__">returnSigners</span>(
            bytes32 dataHash,
            bytes memory data,
            bytes memory signatures,
            uint256 requiredSignatures
        ) public <span class="hljs-title function_ invoke__">returns</span> (address[] memory){}
    }
}</code></pre><p>With the SafeDecoder ABI and contract <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/audityourcontracts/secure-decoder/blob/main/src/onchain/main.rs#L46-L60"><u>defined</u></a> it can be <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/audityourcontracts/secure-decoder/blob/main/src/onchain/main.rs#L110"><u>deployed</u></a> and then passed the parameters it needs to return the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/audityourcontracts/secure-decoder/blob/main/src/onchain/main.rs#L244-L252"><u>signers</u></a> - Safe Transaction Hash, Safe Data Hash, <code>signatures</code> and <code>threshold</code>.</p><pre data-type="codeBlock" language="rust"><code><span class="hljs-keyword">let</span> <span class="hljs-variable">signers</span> = safe_decoder
    .<span class="hljs-title function_ invoke__">returnSigners</span>(
        tx_hash.<span class="hljs-title function_ invoke__">clone</span>(),
        data_hash.<span class="hljs-title function_ invoke__">clone</span>(),
        decoded.signatures,
        threshhold._0
    )
    .<span class="hljs-title function_ invoke__">call</span>()
    .<span class="hljs-keyword">await</span>;</code></pre><p><code>onchain</code> will start and print comma-separated values to stdout. The WazirX safe wallet contract address, start and end blocks are set as default values.&nbsp;</p><pre data-type="codeBlock" language="rust"><code><span class="hljs-meta">#[derive(Parser, Debug)]</span>
<span class="hljs-meta">#[command(author, version, about, long_about = None)]</span>
<span class="hljs-keyword">struct</span> <span class="hljs-title class_">Args</span> {
    <span class="hljs-meta">#[arg(long, default_value = <span class="hljs-string">"0x27fD43BABfbe83a81d14665b1a6fB8030A60C9b4"</span>)]</span>
    safe_wallet_address: <span class="hljs-type">String</span>,

    <span class="hljs-meta">#[arg(long, default_value_t = 16132578)]</span>
    start_block: <span class="hljs-type">u64</span>,

    <span class="hljs-meta">#[arg(long, default_value_t = 20331566)]</span>
    end_block: <span class="hljs-type">u64</span>,

    <span class="hljs-meta">#[arg(long, default_value_t = 10000)]</span>
    chunk_size: <span class="hljs-type">u64</span>,
}</code></pre><p>If you run <code>onchain</code> and pipe to a file you end up with something like <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/audityourcontracts/secure-decoder/blob/main/notebook/transactions.csv"><u>transactions.csv</u></a>. It details every WazirX Safe Wallet transaction and what addresses signed it. If you execute the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/audityourcontracts/secure-decoder/blob/main/notebook/wazir-signers.ipynb"><u>wazir-signers.ipynb</u></a> python notebook you’ll see it creates a histogram of signers. <code>0xd967113224c354600b3151e27aaba53e3034f372</code> is the Liminal Co-Signer HSM.&nbsp;</p><pre data-type="codeBlock" language="rust"><code><span class="hljs-number">0xd83b89e261d02b0f2f9e384b44907f8d380e9af0</span>    <span class="hljs-number">1713</span>
<span class="hljs-number">0xd967113224c354600b3151e27aaba53e3034f372</span>    <span class="hljs-number">1709</span>
<span class="hljs-number">0x9af78003cecc2383d9d576a49c0c6b17fc34ae34</span>    <span class="hljs-number">1699</span>
<span class="hljs-number">0xfa54b4085811aef6acf47d51b05fda188deae28b</span>    <span class="hljs-number">1666</span>
<span class="hljs-number">0xae648f68823bc164ca3ad1f5f5dc0057d9d515ad</span>      <span class="hljs-number">51</span>
<span class="hljs-number">0x10f16cde93f1bc9c38a9e31c8db0eeb89a744824</span>      <span class="hljs-number">29</span>
<span class="hljs-number">0x711d01b75529aa700e821dc330a0addd2d869b0b</span>       <span class="hljs-number">1</span></code></pre><div class="relative header-and-anchor"><h3 id="h-what-does-this-analysis-tell-us">What does this analysis tell us?</h3></div><p>The histogram demonstrates there were 4 dominant signers and although the signature was a 4/6 there were three signers that were not active. Some of them for months and through to years.</p><ul><li><p><code>0xae648f68823bc164ca3ad1f5f5dc0057d9d515ad</code> not seen since <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://etherscan.io/tx/0xc4ba7e0b654eb028e6e5d0b2de7f3828e47ee39d525bf64d01ae1938d8f3b5c1"><u>Apr-13-2024</u></a>.</p></li><li><p><code>0x10f16cde93f1bc9c38a9e31c8db0eeb89a744824</code> not seen since <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://etherscan.io/tx/0x431a3c5fce600d0c9a7bcb0d1793f02e53536affb9e0e9e30da2267c4c875ac9"><u>May-28-2024</u></a>.</p></li><li><p><code>0x711d01b75529aa700e821dc330a0addd2d869b0b</code> not seen since <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://etherscan.io/tx/0x945d31852e6237905df66c8f0bac5b462958f8b26c858ac2087d8822252365a2"><u>Dec-09-2022</u></a>.</p></li></ul><p>The attack happened on <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://etherscan.io/tx/0x48164d3adbab78c2cb9876f6e17f88e321097fcd14cadd57556866e4ef3e185d">July 18th 2024</a> and if the adversary analyzed the signatures they would likely conclude that it was going to be easier to find some bypass in Liminal than having to compromise another WazirX Signer. Like alot of high value multisig wallets the quorum was optimised for availability rather than increasing the cost to any potential adversary. </p><p>As I noted in the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.youtube.com/watch?v=BYmAlhmTJ5s">talk</a> a 4 of 6 multisig where the same signers always sign means an adversary has to compromise the least number of signers. If <u>any</u> of the signers can sign any transaction then the adversary must compromise more of the quorum. Scaling trust to more signers and introducing randomness to the signing process increases the cost to the adversary.</p><p></p>]]></content:encoded>
            <author>ayc@newsletter.paragraph.com (ayc)</author>
        </item>
        <item>
            <title><![CDATA[LI.FI Bridge Hack could have been $24.5M USD!]]></title>
            <link>https://paragraph.com/@ayc/lifi-bridge-hack</link>
            <guid>2UFmML4KKvmI9L88uUyo</guid>
            <pubDate>Sat, 10 Aug 2024 11:06:11 GMT</pubDate>
            <description><![CDATA[IntroductionRecently the LI.FI bridge was upgraded and a new diamond facet was added 0xf28a352377663ca134bd27b582b1a9a4dad7e534. This fac...]]></description>
            <content:encoded><![CDATA[<div class="relative header-and-anchor"><h2 id="h-introduction">Introduction</h2></div><p>Recently the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="http://LI.FI">LI.FI</a> bridge was upgraded and a new diamond facet was added <code>0xf28a352377663ca134bd27b582b1a9a4dad7e534</code>. This facet, <code>GasZipFacet</code> was vulnerable to unrestricted external calls. As the LIFI bridge <code>0x1231deb6f5749ef6ce6943a275a1d3e7486f4eae</code> performed a <code>delegatecall</code> to the <code>GasZipFacet</code> all approvals made to the LIFI bridge were vulnerable and could have been stolen by the attacker <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://etherscan.io/address/0x8B3Cb6Bf982798fba233Bca56749e22EEc42DcF3">0x8B3Cb6Bf982798fba233Bca56749e22EEc42DcF3</a>. The total vulnerable value of approvals to the LIFI bridge was $24.5M USDC and approximately half of that was stolen.</p><p>LIFI on <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://x.com/lifiprotocol/status/1813207291778215955">X</a> (July 16th) and in their <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://li.fi/knowledge-hub/incident-report-16th-july/">Incident Report</a> (July 18th) reiterated that only accounts with "infinite approvals" were vulnerable and <u>this was wrong</u>. This advice might have led those who had used the LIFI interface and had finite approvals to not take action when they should have. A calculation such as TVV would have quickly informed LIFI they were in error and a much larger amount of customer funds were at risk including those that had finite approvals.</p><div data-type="twitter" tweetid="1813207291778215955"> 
  <div class="twitter-embed embed">
    <div class="twitter-header">
        <div style="display:flex">
          <a target="_blank" href="https://twitter.com/lifiprotocol">
              <img alt="User Avatar" class="twitter-avatar" src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/004baf0dc11b165c0d792c10981a021f.jpg">
            </a>
            <div style="margin-left:4px;margin-right:auto;line-height:1.2;">
              <a target="_blank" href="https://twitter.com/lifiprotocol" class="twitter-displayname">LI.FI</a>
              <p><a target="_blank" href="https://twitter.com/lifiprotocol" class="twitter-username">@lifiprotocol</a></p>
    
            </div>
            <a href="https://twitter.com/lifiprotocol/status/1813207291778215955" target="_blank">
              <img alt="Twitter Logo" class="twitter-logo" src="https://paragraph.xyz/editor/twitter/logo.png">
            </a>
          </div>
        </div>
      
    <div class="twitter-body">
      Please do not interact with any <a class="twitter-content-link" href="https://t.co/nlZEnqOyQz" target="_blank">LI.FI</a> powered applications for now! <br><br>We're investigating a potential exploit. If you did not set infinite approval, you are not at risk.  <br><br>Only users that have manually set infinite approvals seem to be affected.  <br><br>Revoke all…
      
      
       
    </div>
    
     <div class="twitter-footer">
          <a target="_blank" href="https://twitter.com/lifiprotocol/status/1813207291778215955" style="margin-right:16px; display:flex;">
            <img alt="Like Icon" class="twitter-heart" src="https://paragraph.xyz/editor/twitter/heart.png">
            800
          </a>
          <a target="_blank" href="https://twitter.com/lifiprotocol/status/1813207291778215955"><p>23:41 • 16 Jul 2024</p></a>
        </div>
    
  </div> 
  </div><p>And from LIFI's <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://li.fi/knowledge-hub/incident-report-16th-july/">incident report</a> (below);</p><figure float="none" width="845px" data-type="figure" class="img-center" style="max-width: 845px;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/bd754c060b633dec203637009981305e.png" blurdataurl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAALCAIAAACRcxhWAAAACXBIWXMAABYlAAAWJQFJUiTwAAADQklEQVR4nIVPXUwTWRj99EFNjJENJuVBMBEIiiD/Vk3LWiMgUqlSkYBgY80SUyVuo3F3JVZoqHZwNKOU3sZJb/+Ytrd6JcaiJKPhjURMNNkH44NEUQKRZXcfNtsqk90xU/yp+uDJyc25J+fc77tgsVhaW1v1er3VajUYDBqNxuFwyB8hSVK6+HT9Sqebn7DogCiKgiAEg0EhBYTQ2NiYJEnJZDI9Kn0P6fn0FkxMTIiiSAgZHR3leV4UxWAKGONgMMgwjMvlopQujl/cAyEkCALP84QQSikhJB6P8ylQSlmWRSnE43HlB5RShmEQQgzDcBxHKcUY22znHQ6H3W4nhNjt9sWOzXa+u7sbIQ/HcQzDnLPZwuEIw/TzPM9xXE9v70Wnk+OuXmLZPoeDEMKy7Pj4OAwPD/sDAb8vcNHpjESjXox9Pp8X40G324sxpRQhNOh2Y4x5/vpQyE9j0du3bgZ83tu3bo7E74SC/mh4KEbCoyN3aCw6FPJHwkJECMVI5PHjJ/Pzf0IsFr3ucUXDQ5f7GQ9yOS/0uV0DAZ834MMe5LrKXY6EQwMD3OC1K339A5t2GCvrWrT7zIYjZ2pbju88cMz406/bGw6rdx86eKx7T8dJ7T5zqc5Yubujl/XIsvyfLEMP46prNnee6jl41Npk6trb2tnWedrUdbat83Sz+ecmU5fpxG/NZmuTyVJrOgMZZaDaAms1oFJ/PrO2Qma54qvUkLUNVFWQWaU7YsM37t0dewS69l8gs0IJ5VRDZYsSzamGUqMiNjYonexqKNyrBFRqWL8T8mqguBGy1FBsgHXVUFAPFQegdL8yKa8GChugUK9QpQYoaLM6Qdd+CpYWwIoNkFkC2RrI2gJryiBjM+TXwg8lyjprymB1EazTwoYa2FT3gXlaKKpfUqaHvB8huwpytSurjIpfVL+svHFZeSPkaiFn2/3x30HdZIHlGyFXp7yVXwv5qQWzNbBepwwrboT8XZBRBKuKHzx8KsvyP4m3ieS7xIKkMPnu34TCxIL0QSQ/MhVYkCSYm/978vXs5IvpqZm5qZk/Xk6/eTn9Znbur6mZuclXM5OvZxXxYvrZ81eJ5FtZ/v9Lyt84X/nye/JSWW85RA5+AAAAAElFTkSuQmCC" nextheight="520" nextwidth="1558" class="image-node embed"><figcaption htmlattributes="[object Object]" class="hide-figcaption"></figcaption></figure><div class="relative header-and-anchor"><h2 id="h-lifi-total-vulnerable-value-dollar245m">LIFI Total Vulnerable Value ($24.5M)</h2></div><p>The total value the attacker could have captured from the attack was much greater than just victims with infinite approvals. My assumption is LIFI made a logical error in their accounting and thought that those who had made <u>finite</u> approvals and bridged their funds would no longer have a balance that could be stolen by the attacker. </p><p>There were three types of victims in this attack;</p><ol><li><p>Those with <u>infinite</u> approvals set to <code>type(uint256).max</code> or all FFs. This balance was vulnerable.</p></li><li><p>Those with <u>finite</u> approvals that at the time of the attack were greater than their balance. This balance was vulnerable.</p></li><li><p>Those with <u>finite</u> approvals that at the time of the attack were less than their balance. This approved amount was vulnerable.</p></li></ol><p>On ETH L1 there were 78 victims who lost USDC, 37 of them (or 47.8%) had infinite approvals. <strong><em>The majority (52.2%) had finite approvals and still lost money</em></strong>.</p><p>For USDT there were 59 victims and the majority were infinite approvals (55.9%) and the rest were finite approvals (44.1%).<strong><em>Those with finite approvals still lost money</em></strong>.</p><p>For DAI there were 2 victims, all were finite approvals and <strong><em>they both lost money</em></strong>.</p><p>Take the example of <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://etherscan.io/address/0x44735671ac65db3ccf8bd3f4ca041e19a5e7d100">0x44735671ac65db3ccf8bd3f4ca041e19a5e7d100</a> who set finite approvals in blocks <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://etherscan.io/tx/0x505b232516d4cfa46ef18717d42e28c721e377bc547c36b53474a0f667505f15">20244286</a>, <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://etherscan.io/tx/0xd9523db4cb763b947d7eff27497ba79ca245eb4ac9c2dbf5c4addb52088a0db1">20258007</a> and <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://etherscan.io/tx/0xdd45eecf99d4ece54450cc4837691c7220df1518256be1e88a9f3905a266d344">20258008</a> then lost $195,504.10 USDC in block <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://etherscan.io/tx/0x86fe6933f03c14f75167e560e6635a23fab59b268e68c86d60c4d46afe0aeabc">20318976</a>. The final approval in block <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://etherscan.io/tx/0xdd45eecf99d4ece54450cc4837691c7220df1518256be1e88a9f3905a266d344">20258008</a> was for $400,000 and the attacker took the entire balance.</p><p>If you take all approvals and check the current balance of each address (for each ERC20) you can determine the total vulnerable value (TVV);</p><ul><li><p>If the Approval &gt; Balance the balance is vulnerable and at risk.</p></li><li><p>If the Approval &lt; Balance the approved amount is vulnerable and at risk.</p></li></ul><p>The assumption LIFI seem to have made was that for finite approvals there should be no balance in the account (they might have bridged it) but over time this balance can return due to the fungibility of ERC20 tokens.</p><p>LIFI had significant funds at risk, significantly more than what was exploited. All of the values in the table below are for ETH L1. Arbitrum was also impacted but I've focused on ETH L1 as that's where the majority of value was stolen.</p><table style="minWidth: 338px"><colgroup><col style="width: 263px"><col><col><col></colgroup><tbody><tr><th colspan="1" rowspan="1" colwidth="263"><p style="text-align: center"><strong>ERC20 Token</strong></p></th><th colspan="1" rowspan="1"><p style="text-align: center"><strong>Total Vulnerable Value (USD) of Approvals</strong></p></th><th colspan="1" rowspan="1"><p style="text-align: center"><strong>Stolen</strong></p></th><th colspan="1" rowspan="1"><p style="text-align: center"><strong>Attacker Yield %</strong></p></th></tr><tr><td colspan="1" rowspan="1" colwidth="263"><p style="text-align: center"><strong>USDC</strong></p></td><td colspan="1" rowspan="1"><p style="text-align: center">13,730,617</p></td><td colspan="1" rowspan="1"><p style="text-align: center">3,191,913</p></td><td colspan="1" rowspan="1"><p style="text-align: center">23.2%</p></td></tr><tr><td colspan="1" rowspan="1" colwidth="263"><p style="text-align: center"><strong>USDT</strong></p></td><td colspan="1" rowspan="1"><p style="text-align: center">9,428,517</p></td><td colspan="1" rowspan="1"><p style="text-align: center">6,335,888</p></td><td colspan="1" rowspan="1"><p style="text-align: center">67.19%</p></td></tr><tr><td colspan="1" rowspan="1" colwidth="263"><p style="text-align: center"><strong>DAI</strong></p></td><td colspan="1" rowspan="1"><p style="text-align: center">1,432,717</p></td><td colspan="1" rowspan="1"><p style="text-align: center">169,533</p></td><td colspan="1" rowspan="1"><p style="text-align: center">11.83%</p></td></tr></tbody></table><p><strong>There was $24,591,851 USD of Total Vulnerable Value (TVV) in approvals</strong> made my accounts to the LIFI bridge contract and roughly half of that value was stolen by the attacker.</p><div class="relative header-and-anchor"><h2 id="h-attacker-leaves-dollar6-million-usd-on-the-table">Attacker leaves $6 million USD on the table</h2></div><p>The TVV represents all balances accessible via approvals (24.5M USD) but there’s obviously a long tail of small balances where the effort / reward starts to reduce. The attacker might not have been interested in working that hard after already taking ~11M USD in funds. However I believe there were errors in targeting that would have added a lot more yield (200%).</p><p>For example <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://etherscan.io/address/0x960f8bd0b4351863c659b57fe5b097969e81e105">0x960f8bd0b4351863c659b57fe5b097969e81e105</a> had $1,000,000 USDC approved to the vulnerable LIFI bridge contract in block <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://etherscan.io/tx/0x7330f67921671e053e210d5c8b6340d8eb0f7ed577c085dd1635f37e823ec9d9">19234368</a> and a balance of $2,776,941 USDC at block height 20319130 (when the attacker finished their attack) but was not impacted. Similarly <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://etherscan.io/address/0xceb4581add9b665fdd5d73ef6983f026d8fbaf4c">0xceb4581add9b665fdd5d73ef6983f026d8fbaf4c</a> had $500,000 approved to the vulnerable contract in block <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://etherscan.io/tx/0x0900ebcf49cf132a5940464e8698096183f0fe87a8894e3b3563e1d89d7405ee">20006660</a> and a balance of $482,811 USDC at block height 20319130 and wasn’t impacted. </p><p>If the attacker had targeted just 10 more victims on USDC, USDT and DAI they would have increased their payout by $6,084,785 USD from $9,697,334 USD on ETH L1 to $15,782,119 USD. See the table below;</p><table style="minWidth: 338px"><colgroup><col style="width: 263px"><col><col><col></colgroup><tbody><tr><th colspan="1" rowspan="1" colwidth="263"><p style="text-align: center"><strong>ERC20 Token</strong></p></th><th colspan="1" rowspan="1"><p style="text-align: center"><strong>Total Vulnerable Value (USD) of Approvals</strong></p></th><th colspan="1" rowspan="1"><p style="text-align: center"><strong>Targeting 10 more victims</strong></p></th><th colspan="1" rowspan="1"><p style="text-align: center"><strong>Attacker Yield %</strong></p></th></tr><tr><td colspan="1" rowspan="1" colwidth="263"><p style="text-align: center"><strong>USDC</strong></p></td><td colspan="1" rowspan="1"><p style="text-align: center">13,730,617</p></td><td colspan="1" rowspan="1"><p style="text-align: center">7,658,880*</p><p style="text-align: center">(3,191,913 + 4,466,967)</p></td><td colspan="1" rowspan="1"><p style="text-align: center">55.7%</p></td></tr><tr><td colspan="1" rowspan="1" colwidth="263"><p style="text-align: center"><strong>USDT</strong></p></td><td colspan="1" rowspan="1"><p style="text-align: center">9,428,517</p></td><td colspan="1" rowspan="1"><p style="text-align: center">7,038,396</p><p style="text-align: center">(6,335,888 + 702,508)</p></td><td colspan="1" rowspan="1"><p style="text-align: center">74.65%</p></td></tr><tr><td colspan="1" rowspan="1" colwidth="263"><p style="text-align: center"><strong>DAI</strong></p></td><td colspan="1" rowspan="1"><p style="text-align: center">1,432,717</p></td><td colspan="1" rowspan="1"><p style="text-align: center">1,084,843</p><p style="text-align: center">(169,533 + 915,310)</p></td><td colspan="1" rowspan="1"><p style="text-align: center">75.7%</p></td></tr></tbody></table><p>NB: * there may have been a second attacker or a change in tactics of the primary attacker when targeting USDC funds (see below).</p><div class="relative header-and-anchor"><h2 id="h-a-second-attacker">A second attacker?</h2></div><p>This has not been documented in many write-ups. There was an additional $1.8M of USDC transferred from <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://etherscan.io/address/0x9fc3b6191927b044ef709addd163b15c933ee205">0x9fc3b6191927b044ef709addd163b15c933ee205</a> to <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://etherscan.io/address/0x7742Ed59E9ecF1712BC4c6bDd0c526e903a7f2C8">0x7742Ed59E9ecF1712BC4c6bDd0c526e903a7f2C8</a>. I've left it out of the table above as the majority of funds transfers were to the attacker <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://etherscan.io/address/0x8B3Cb6Bf982798fba233Bca56749e22EEc42DcF3">0x8B3Cb6Bf982798fba233Bca56749e22EEc42DcF3</a>. My assumption is there was a copycat attacker that started towards the end of the primary attack and was able to work out there was a $1.8M approval sitting there and exploited it in this <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://etherscan.io/tx/0x65a92b189e4ae0b8a8a02cd59c5e9f6832586bd5167d41a24eb4f4d2ac692755">transaction</a>. It could also be the same attacker that noticed they missed the $1.8M and attacked it via another account.</p><div class="relative header-and-anchor"><h2 id="h-summary">Summary</h2></div><ol><li><p>LIFI were in error stating that only accounts with infinite approvals were vulnerable attack. This blog cited multiple examples where customers did not have infinite approvals and still lost money. </p></li><li><p>52.2% of victims holding USDC and almost half of USDT victims (44.1%) had finite approvals. They were told they weren't affected by the attack but they were and the lost money.</p></li><li><p>The Total Vulnerable Value of all approvals was $24.5M USDC and approximately half of that value was stolen.</p></li><li><p>There was a change in tactics or a second (copycat) attacker with $1.8M of USDC being stolen from a finite approval.</p></li></ol><p></p><p></p><p></p>]]></content:encoded>
            <author>ayc@newsletter.paragraph.com (ayc)</author>
        </item>
        <item>
            <title><![CDATA[A deep dive of the $230 Million WazirX Compromise]]></title>
            <link>https://paragraph.com/@ayc/a-deep-dive-of-the-dollar230-million-wazirx-compromise</link>
            <guid>x4jcCyKfXKQjDmSY9ueb</guid>
            <pubDate>Fri, 26 Jul 2024 06:59:28 GMT</pubDate>
            <description><![CDATA[TL;DR WazirX had their Gnosis Safe wallet compromised after three (3) signers from Wazir were lured into signing a transaction that performed a delega...]]></description>
            <content:encoded><![CDATA[<div class="relative header-and-anchor"><h2 style="text-align: start" id="h-tldr"><strong>TL;DR</strong></h2></div><p style="text-align: start"><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://wazirx.com/">WazirX</a> had their <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://etherscan.io/address/0x27fD43BABfbe83a81d14665b1a6fB8030A60C9b4">Gnosis Safe wallet</a> compromised after three (3) signers from WazirX were lured into signing a transaction that performed a delegatecall to an attack contract that changed the implementation address of the wallet. This gave locked WazirX out of the Gnosis Safe Wallet and gave the adversary the ability to transfer all value out of the wallet, to the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://rekt.news/wazirx-rekt/">tune of $230M</a>.</p><p style="text-align: start">The Gnosis Safe Wallet had been <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out cc-1rn59kg" href="https://etherscan.io/tx/0xfda0801c5f916fc17d042a8297af15ccdfa91bc12d530fda4708c159e992b19a">enrolled</a> in Liminal’s Custody service and a Liminal private key was used to sign transactions that were broadcast on chain. The multi-sig was a 4 of 6 that operated with 3 signers from WazirX (Ledger hardware wallets) and a co-signer (fourth signer) from Liminal (a HSM). Note, there's no requirement for Liminal to be the 4th signature, it could have easily been one of WazirX's other signers.</p><p style="text-align: start">Liminal maintain they <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out cc-1rn59kg" href="https://www.liminalcustody.com/blog/update-on-wazirx-incident/">were not breached </a>and that the malicious transactions originated from the WazirX signers themselves. There seems to be a difference between Safe wallets migrated to the Liminal platform and Safe wallets that are created there - <code>"The WazirX team requested Liminal to import an existing SAFE contract on the Liminal platform and our team helped them with the same. This is the only wallet that was compromised in the incident"</code>. This may explain why the allowlist was subverted.</p><p style="text-align: start">WazirX stated that the wallets were all separate <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out cc-1rn59kg" href="https://wazirx.com/blog/wazirx-cyber-attack-day-wise-report/">hardware wallets in three different locations</a> and that links to Liminal’s custody service were bookmarked. They also stated that the attack was not the result of a phishing link. This would seemingly rule out phishing, spear-phishing or clickjacking (weaponised reflected XSS).</p><div data-type="twitter" tweetid="1814949731522486436"> 
  <div class="twitter-embed embed">
    <div class="twitter-header">
        <div style="display:flex">
          <a target="_blank" href="https://twitter.com/NischalShetty">
              <img alt="User Avatar" class="twitter-avatar" src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/d56cd93950878d91b908c318a2d3b8b2.jpg">
            </a>
            <div style="margin-left:4px;margin-right:auto;line-height:1.2;">
              <a target="_blank" href="https://twitter.com/NischalShetty" class="twitter-displayname">Nischal (Shardeum) 🔼</a>
              <p><a target="_blank" href="https://twitter.com/NischalShetty" class="twitter-username">@NischalShetty</a></p>
    
            </div>
            <a href="https://twitter.com/NischalShetty/status/1814949731522486436" target="_blank">
              <img alt="Twitter Logo" class="twitter-logo" src="https://paragraph.xyz/editor/twitter/logo.png">
            </a>
          </div>
        </div>
      
    <div class="twitter-body">
      The WazirX hack was not due to a Phishing link.<br><br>3 signatures of WazirX from 3 different devices that each use different hardware wallets were used. All 3 devices were at different locations and the links were bookmarked. <br><br>Even if we assume that all 3 WazirX devices ended up…
      
      
      <div class="twitter-quoted">
        
  <div class="twitter-quoted twitter-embed">
    <div class="twitter-header">
        <div style="display:flex">
          <a target="_blank" href="https://twitter.com/CryptooAdy">
              <img alt="User Avatar" class="twitter-avatar" src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/acd483882de3488a791e7590a9aeb0b9.jpg">
            </a>
            <div style="margin-left:4px;margin-right:auto;line-height:1.2;">
              <a target="_blank" href="https://twitter.com/CryptooAdy" class="twitter-displayname">Aditya Singh</a>
              <p><a target="_blank" href="https://twitter.com/CryptooAdy" class="twitter-username">@CryptooAdy</a></p>
    
            </div>
            <a href="https://twitter.com/CryptooAdy/status/1814943768673726945" target="_blank">
              <img alt="Twitter Logo" class="twitter-logo" src="https://paragraph.xyz/editor/twitter/logo.png">
            </a>
          </div>
        </div>
      
    <div class="twitter-body">
      Most hack starts with a click on a Phishing Link.
      
      
       
    </div>
    
  </div> 
   
    </div> 
    </div>
    
     <div class="twitter-footer">
          <a target="_blank" href="https://twitter.com/NischalShetty/status/1814949731522486436" style="margin-right:16px; display:flex;">
            <img alt="Like Icon" class="twitter-heart" src="https://paragraph.xyz/editor/twitter/heart.png">
            675
          </a>
          <a target="_blank" href="https://twitter.com/NischalShetty/status/1814949731522486436"><p>19:05 • 21 Jul 2024</p></a>
        </div>
    
  </div> 
  </div><p style="text-align: start">Liminal note that the WazirX team created multiple transactions before the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://etherscan.io/tx/0x48164d3adbab78c2cb9876f6e17f88e321097fcd14cadd57556866e4ef3e185d">attack transaction</a> changed the proxy implementation (<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out cc-1rn59kg" href="https://www.liminalcustody.com/blog/update-on-wazirx-incident/">more detail here</a>);</p><ol><li><p>A transaction related to GALA token from Victim 1 that had a signature mismatch and was rejected by Liminal.</p></li><li><p>A transaction related to GALA token from Victim 2 that was rejected by Liminal “owing to the mismatch in transaction information and the payload”.</p></li><li><p>A transfer of $500,000 USDT was initiated by Victim 1, signed by 2 other co-signers and submitted by the Liminal Co-Signer (HSM) on chain. It had 2 valid WazirX signatures and one invalid signature so it <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out cc-1rn59kg" href="https://etherscan.io/tx/0x8b99ae634e1e7180b3fcc66e8fe5d076351477077051a7bbf5ec626a9d0588ef">reverted</a> with error <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out cc-1rn59kg" href="https://github.com/safe-global/safe-smart-account/blob/b6692f9549262c3217c6547efdf1bd4cf7ff81a6/contracts/Safe.sol#L320">GS026</a>. The signature that reverted was that of Victim 3.</p></li><li><p>The <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out cc-1rn59kg" href="https://etherscan.io/tx/0x48164d3adbab78c2cb9876f6e17f88e321097fcd14cadd57556866e4ef3e185d">attack transaction</a> signed by all 3 WazirX signers and the Liminal Co-signer is submitted on chain. This changed the implementation of the Gnosis Safe Proxy via a delegatecall.</p></li></ol><p style="text-align: start">The adversary now had full control of all funds held in the proxy and can continue to delegatecall to the attack contract through the proxy.</p><div class="relative header-and-anchor"><h2 id="h-accruing-signatures-through-failed-transactions"><strong>Accruing signatures through failed transactions</strong></h2></div><p style="text-align: start">As noted above there were a number of transactions performed that failed off-chain (2) and on-chain (1) before the attack transaction. Liminal refer to these as “sequences” in their <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out cc-1rn59kg" href="https://www.liminalcustody.com/blog/update-on-wazirx-incident/">interim report</a>.</p><ol><li><p>Sequence #1 (off-chain) is the first GALA transaction from Victim 1 that had the wrong signature.</p><ol><li><p><code>8e64a89386af2f223b8433a1df65db8f0ff60544b2f02c56ec02b640d6fb15a11f7dffda5b99b0292b5e02d0cc44508d7d8f994515358e9da3016d8098b2258820</code></p></li><li><p>This was blocked by Liminal due to "signature mismatch" (see interim report).</p></li></ol></li><li><p>Sequence #3 (off-chain) is the second GALA transaction from Victim 2 where the transaction and payload did not match.</p><ol><li><p><code>3da7c6bd7c130430cf662de3d9af067c4a0629f849e29003c40ad3979cd670720c3ceb3a61e38fb7166353e3262eb6554c3f6571807cf22f9bdc4a83a56441661f</code></p></li><li><p>Blocked by Liminal due to "mismatch in transaction information and the payload" (see interim report).</p></li></ol></li><li><p>Sequence #8 (<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out cc-1rn59kg" href="https://etherscan.io/tx/0x8b99ae634e1e7180b3fcc66e8fe5d076351477077051a7bbf5ec626a9d0588ef">on-chain</a>) is the failed USDT transaction that reverted as one of the signers from WazirX , Victim 3 (<code>0xfa54b4085811aef6acf47d51b05fda188deae28b</code>) was not correct.</p><ol><li><p><code>40082eba0f71627a3451d47132b8f4c266bc9be2bebe4424848757d10f13e76963af0b543a2357765d9f290410e919301ad065f0f2efa1233eb8634c93111f0e20</code></p></li><li><p>Submitted by Liminal but reverted on chain due to an invalid ecrecover.</p></li></ol></li></ol><p style="text-align: start">All three of these signatures from failed transactions are used as the signatures for the final <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out cc-1rn59kg" href="https://etherscan.io/tx/0x48164d3adbab78c2cb9876f6e17f88e321097fcd14cadd57556866e4ef3e185d">attack transaction</a>. See below;</p><p style="text-align: start"><code>0x3da7c6bd7c130430cf662de3d9af067c4a0629f849e29003c40ad3979cd670720c3ceb3a61e38fb7166353e3262eb6554c3f6571807cf22f9bdc4a83a56441661f8e64a89386af2f223b8433a1df65db8f0ff60544b2f02c56ec02b640d6fb15a11f7dffda5b99b0292b5e02d0cc44508d7d8f994515358e9da3016d8098b2258820000000000000000000000000d967113224c354600b3151e27aaba53e3034f37200000000000000000000000000000000000000000000000000000000000000000140082eba0f71627a3451d47132b8f4c266bc9be2bebe4424848757d10f13e76963af0b543a2357765d9f290410e919301ad065f0f2efa1233eb8634c93111f0e20</code></p><p style="text-align: start">Breaking this out signature by signature;</p><p style="text-align: start"><code>0x3da7c6bd7c130430cf662de3d9af067c4a0629f849e29003c40ad3979cd670720c3ceb3a61e38fb7166353e3262eb6554c3f6571807cf22f9bdc4a83a56441661f - From Sequence #3 and Victim #2</code></p><p style="text-align: start"><code>8e64a89386af2f223b8433a1df65db8f0ff60544b2f02c56ec02b640d6fb15a11f7dffda5b99b0292b5e02d0cc44508d7d8f994515358e9da3016d8098b2258820 - From Sequence #1 and Victim #1</code></p><p style="text-align: start"><code>000000000000000000000000d967113224c354600b3151e27aaba53e3034f372000000000000000000000000000000000000000000000000000000000000000001 - From Liminal Co-Signer</code></p><p style="text-align: start"><code>40082eba0f71627a3451d47132b8f4c266bc9be2bebe4424848757d10f13e76963af0b543a2357765d9f290410e919301ad065f0f2efa1233eb8634c93111f0e20 - From Sequence #8 and Victim #3</code></p><p style="text-align: start">The attacker required 3 valid WazirX signatures for the attack transaction and accrues them by manipulating the signing requests that are submitted to three valid transactions (GALA, GALA and USDT). The WazirX signers thought they were signing transfers of GALA and USDT but each of these transactions failed because they were actually signing the attack transaction. The fourth signature is from the Liminal Co-signer.</p><p style="text-align: start">After receiving the signatures for the failed transactions in Sequence #1 and #3 the adversary does not MITMiddle/MITBrowser Victim 1 or Victim 2 in Sequence #8 (the USDT transfer) as they already have their attack transaction signatures from the failed GALA transactions. The USDT transfer fails because the attacker needed to MITM Victim 3 to get the signature for the attack transaction. Victim 3 was signing the attack transaction in the USDT transfer and that is why it failed with an invalid signature.</p><div data-type="callout" type="info"><div class="callout-base callout-info" data-node-view-wrapper="" style="white-space:normal"><img src="https://paragraph.xyz/editor/callout/information-icon.png" class="callout-button"><div class="callout-content"><div><p style="text-align: start">The adversary has to deal with any of the WazirX victims signing a transaction in any order. Once they have the signature for the attack transaction they either need to accrue a new signature or block valid transactions or the nonce will change. We don't know if Sequence #8 happened before or after #1 and #3 but it strongly suggests accruing signatures and blocking valid transaction was co-ordinated via a command-and-control (C2) server.</p></div></div></div></div><p style="text-align: start">The signatures must match the transaction Gnosis Safe transaction hash and this is built up from the following code (<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out cc-1rn59kg" href="https://github.com/safe-global/safe-smart-account/blob/b6692f9549262c3217c6547efdf1bd4cf7ff81a6/contracts/Safe.sol#L127C1-L142C49">link</a>);</p><pre data-type="codeBlock" language="solidity"><code>  txHash <span class="hljs-operator">=</span> getTransactionHash( <span class="hljs-comment">// Transaction info</span>
      to,
      value,
      data,
      operation,
      safeTxGas,
      <span class="hljs-comment">// Payment info</span>
      baseGas,
      gasPrice,
      gasToken,
      refundReceiver,
      <span class="hljs-comment">// Signature info</span>
      <span class="hljs-comment">// We use the post-increment here, so the current nonce value </span>
      <span class="hljs-comment">// is used and incremented afterwards.</span>
      nonce<span class="hljs-operator">+</span><span class="hljs-operator">+</span>
  );
  checkSignatures(txHash, signatures);</code></pre><div data-type="callout" type="info"><div class="callout-base callout-info" data-node-view-wrapper="" style="white-space:normal"><img src="https://paragraph.xyz/editor/callout/information-icon.png" class="callout-button"><div class="callout-content"><div><p style="text-align: start">I've linked to the latest version of the Gnosis Safe Wallet implementation rather than the original code from the implementation at block 20331564 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://etherscan.io/address/0xd9db270c1b5e3bd161e8c8503c55ceabee709552">0xd9db270c1b5e3bd161e8c8503c55ceabee709552</a>. There's little difference and it's easier to link to on Github. However if you want the exact code download it from the link above.</p></div></div></div></div><p style="text-align: start">In summary;</p><ul><li><p style="text-align: start">Sequence #1, the first GALA transaction fails because the Victim 1 tries to sign the GALA transaction but really signs the attack transaction (with the predicted nonce) that will be submitted later.</p></li><li><p style="text-align: start">Sequence #3, the second GALA transaction fails because Victim 2 tries to sign the GALA transaction but really signs the attack transaction (with the predicted nonce) that will be submitted later.</p></li><li><p style="text-align: start">Sequence #8, Victim 1 and Victim 2 successfully sign the USDT transfer but Victim 3 really signs the attack transaction (with the predicted nonce) that will be submitted later.</p></li></ul><p style="text-align: start">With the three signatures the attacker submits the attack transaction as one of the victims. This would require them to be logged in and have an authenticated session to the Liminal website as one of the victims. </p><p style="text-align: start">Note that the Liminal Co-Signer (HSM) does not provide a signature for the Gnosis Safe Wallet transaction but is required to sign the EVM transaction and broadcast it on chain. There's a subtle difference in the way the submitting signer works in the safe wallet implementation.</p><p style="text-align: start">The Liminal Co-Signer only needs to provide their address and a <code>v</code> of 1. It’s signature is;</p><p style="text-align: start"><code>000000000000000000000000d967113224c354600b3151e27aaba53e3034f372000000000000000000000000000000000000000000000000000000000000000001</code></p><p style="text-align: start">Looking at the Gnosis Safe <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out cc-1rn59kg" href="https://github.com/safe-global/safe-smart-account/blob/b6692f9549262c3217c6547efdf1bd4cf7ff81a6/contracts/Safe.sol#L308">source</a> the code checks the message sender is an owner and if it is it passes the signature check. The attacker doesn’t need Liminal to sign the Safe wallet transaction hash, only to sign and submit the attack transaction.</p><div data-type="callout" type="info"><div class="callout-base callout-info" data-node-view-wrapper="" style="white-space:normal"><img src="https://paragraph.xyz/editor/callout/information-icon.png" class="callout-button"><div class="callout-content"><div><p style="text-align: start">Using the Liminal co-signer as the 4th signer is lower cost in terms of complexity than compromising a 4th WazirX signer. As long as the adversary has the Victim's authenticated session to the Liminal website the 4th signature is free and there's no requirement to get a 4th WazirX signer to fail a transaction to grab their signature.</p></div></div></div></div><div class="relative header-and-anchor"><h2 style="text-align: start" id="h-the-whitelist-and-the-nonce"><strong>The Whitelist and the Nonce</strong></h2></div><p style="text-align: start">The <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out cc-1rn59kg" href="https://etherscan.io/tx/0x48164d3adbab78c2cb9876f6e17f88e321097fcd14cadd57556866e4ef3e185d">attack transaction</a> was submitted on-chain with signatures that were accrued across three failed transactions. The nonce (<code>1718</code>) would have been predicted by the adversary and all transactions would need to fail to be executed on chain so the nonce didn’t change at the time of the attack. For example, if any successful transaction was executed the nonce would have been incremented and all accrued signatures would have failed because the nonce is incremented in the <code>txHash</code> and signed.</p><p style="text-align: start">An allowlist was configured at Liminal but appears to have been bypassed;</p><p style="text-align: start"><code>A policy to whitelist destination addresses was also in place to enhance security. These whitelisted addresses were earmarked and facilitated on the interface by Liminal; consequently, the WazirX team had the ability to initiate transactions to the said whitelisted addresses.</code> (<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out cc-1rn59kg" href="https://wazirx.com/blog/wazirx-cyber-attack-day-wise-report/">WazirX</a>)</p><p style="text-align: start">And Liminal note;</p><p style="text-align: start"><code>After all authorized signatures required for tx were received, Liminal provided the final signature. The transaction was crafted in such a way that the fields used to verify policies were using legit transaction details.</code> (<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out cc-1rn59kg" href="https://www.liminalcustody.com/blog/update-on-wazirx-incident/">Liminal</a>)</p><p style="text-align: start">The allowlist may have only applied to transfers and approvals and not to arbitrary calldata. For example it may have only applied to the transfer function signature. This seems to be the case with the allowlist only focused on <code>Send</code> transactions as described in <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out cc-1rn59kg" href="https://youtu.be/Kfu1HapZ1P0">this example</a>.</p><p style="text-align: start">Either way the transaction was able to be submitted to Liminal using an authenticated browser session and then broadcast on chain via the Liminal Co-Signer - <code>0xd967113224c354600b3151e27aaba53e3034f372</code>.</p><p>There's some outstanding questions as to why the two GALA transactions failed off-chain but the USDT transaction was broadcast and failed on-chain. Liminal describe some of the validation they perform on the fields to compute the <code>safeTxHash</code> off-chain;</p><p><code>The Liminal platform rejected the transaction and displayed an error stating that the transaction creation has failed. Now the fact that Liminal provides the correct safeTxHash in the transaction pre-build and receives malicious safeTxhash and signature from the user’s device in return points to the fact that this was a malicious GALA transaction from the victim’s machine, which was already compromised.</code></p><p>What's different between the GALA transactions that failed off-chain and the USDT transaction that failed on-chain? It makes more sense if you separate these transactions into whether they were new or existing transactions. </p><p>Assume Sequence #1 (the GALA transaction) is a new transaction, Victim 1 entered the correct fields into the UI but then submitted a signature for the attack transaction (due to the MITM/MITB and the adversary changing the sign request). Liminal checked the values the victim entered into the user interface and calculated the <code>safeTxHash</code> and compared it to the attack transaction signature and it failed. Liminal has a demo of how transaction signing and validation is performed in this <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.youtube.com/watch?v=lKRh8zvIBr8">video</a>. </p><p>When Victim 3 was asked to sign an existing transaction for USDT the <code>safeTxHash</code> could not have been compared to the signed data otherwise the transaction would have been blocked and never submitted on-chain by the Liminal co-signer.</p><p>It's likely that Liminal only check the <code>safeTxHash</code> when transactions are initiated and not on additional signatures to an initiated transaction. This would explain why the two GALA transactions were blocked (as they were new transactions) and why the USDT transaction was broadcast on chain (existing transaction).</p><p>There still needs to be a whitelist bypass and I would say there is the ability to submit a properly formatted transaction to a Liminal API and have it co-signed and broadcast on chain. Or the adversary might have used an authenticated Liminal session to add the destination as a whitelisted address without the WazirX team knowing.</p><div class="relative header-and-anchor"><h2 style="text-align: start" id="h-the-compromise"><strong>The Compromise</strong></h2></div><p style="text-align: start">The adversary was able to MITM/MITB three transaction signing requests and then submits a transaction as one of the victims to the Liminal custody service. WazirX state in this <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out cc-1rn59kg" href="https://x.com/WazirXIndia/status/1813981143437611440">X/Twitter</a> post;</p><p style="text-align: start"><code>» Nature of the Cyber Attack: The cyber attack stemmed from a discrepancy between the data displayed on Liminal's interface and the transaction's actual contents. During the cyber attack, there was a mismatch between the information displayed on Liminal's interface and what was actually signed. We suspect the payload was replaced to transfer wallet control to an attacker.</code></p><p style="text-align: start">There’s a number of popular ways javascript execution can be hijacked by an adversary;</p><ul><li><p>Direct compromise of the endpoint, malware installation and web injects.</p></li><li><p>Direct compromise of the endpoint, restarting the browser in debug mode <code>(--silent-debugger-extension-api</code>) and then injecting javascript into the tab for the Liminal web application.</p></li><li><p>Malicious browser extension install via supply chain or social engineering. I think this is the most likely scenario.</p></li></ul><p style="text-align: start"><code>Rilide</code> is an example of a malicious browser extension that targets crypto users and play to earn games.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/a38e63aa84def1e160bbc26823a42038.png" blurdataurl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAACXBIWXMAAAsTAAALEwEAmpwYAAAJS0lEQVR4nH1WC5AU1RV9lmKlylgJGi3xg6hRg0ESo9lCBT8hRiGgUX6GKFhIQDSmsmWCUCmxotGYGBABjRJ/cV1XVtjNLuvuwrqwDLO/WWZ2Zpjf9nRP905/p6f79fTvTU/P9HSqZxAQrJzq6nld/XrOvffce98FoihaloVOg2mauq4bum7WUFtr1GQ6GB4OhUei8TFeYCzLqr81TROZRkFTZShz6QAeGcCjPjx6hMNGkWmwLAtUVXW/DsdxkGWphqGqasG7tJLt5GRIMVmKoTNZkhcYt1rf6f1oyOL0kqghfLTJ3/H60Y5tvvatqSP/qpaLMoRnETiOjKW48SA15vMNHEpTfI7FQgd3jQ98EPM1hft3C5hP01HZtivFYknTtTw/EWrBxv5DRz7Hj7VS4X3M8TY51SoxMdd1JUk6k6CMdDkZN3Wdx5NDfn8ojrHUxLHutwIH3gv2vxfofos63m+gYskwxPFAgSDocR/R+Z3A+6DtVfDFG6DzddC3E6RawOSxHfIEKWSpswkQTMYVKa8qOats6EW17JSrrheSWlTckm1DVS0WCio+4bquoWtZfCQd+9KEaSzcLWaPCdlQKtxTKAgFKsMS+JkEtqFxw/58Ota+7dPG5X9/ce2uf/+lY/dL+97dsnfX5s+2NTZ1N/l0VWYZgYgnECoaukpj/ZHRFoEcjAXbyNRBLPpFbPTTgsLoDOMR6LpWdd2i7VRqipU0TSYI161uXLbzIrDgarCs4dw1d09dP+fcNVeCR6aCBetu/7OUGo+OBiPhKD0WUKQ8FOLp+KFMyleQMCYzkoj08+SoLPNaNsuRmTM98AgwzHWdl5/cfTVYeuf5axdOb1w4vXHBVX+48/y114Nfb1z8moxFIZ7WSZwbOuI4ju04Ti2AJ++lcsVxXcSxLEEA2zJGJmDDC4c/PpRxXbdYKMhEuuo6G5ds/x64bwZYcitYdStYfRt44mqw9CJw/9PzX4aZOMxknFIx09uhMPmM709HdoN9W6d3bJvW+o8r+naAzKG1MgvFsSEvRLaFwIYeMPud+a8M2061bGhqltQNI8flaJJjKUHg8gKf55kcQwk0yYk5OZ/jZCzplIr86FF6ZCw7/m50/8MjbSvG9z+e6FsfbF/MhbcbekmZSLB4GhSRtuCVYbCgFYArtmzahHhGiITL5bLjVByn4smjQAQlz3fvsVp1q5ZpKCTuum61Ui1ZtqzojCDTnCgrqqajLM3IEJbKFZPJMnWCrIhe+XD4p7fPfel368URPz8+BnHMdd2K4/AyTESj8UgkTdHIKp2oxVJRwZKWZRXyGR2SmkQYCmV4i7QqUUXTtE2zbNsqjnke6LpesopEOobjOEKoZldFwZKO4yiqyYoygZMETjKCJEiKbZdrxV5R0mk2Nhz+AAy+CZo2g6bnQcsLYHg7SHw2JZ9lIY6pDCUEBj2CehbVu4qXDl5aeOS2XZ6kc/F44mD/wJcDPv/gMEEyimp6FtT80FQFC3eEj34UHm6Jj7UHjzZPhPYRsV4TIddLK9dksqcKzamh/sJ1Kio+Ua1UNB3JGmLJSZaclAq6rKieB19tK1qW6qFQb72qWqg315Jt1yNpMJPfUMn1EHltoKYyL8NULJ6IxihOLNbi8/9hluxomgxEYoFogojFeYI45cHp+8RIUMUntGwG6ZDjqLzIaoaqQVaVJnUlq0qMzrNWAVoKtBQJyXlLgYYkciQVD4dDgcDY4NCQfxAbHvqqkj0FqhXPYkevnTNVxzZkhUkTe3a0v/u35t2vtTS92d78+icf/PX9tze/PdTVTyePU7FYJhahkwkhnWQjYSRyhiRYkmhByYISynnrvCh6WWTbdpbKlsteBExkCkIuMU6E/VgqnJkJVt4EfnMTePQGsOIG8OjNYPWl4MFdL+zhDDVBZOMEmaRYXla5REzFJ5xSqWQVTVS0v5LBOw80VVu59HEAwKtb/slQXPhYNORPcJjsui6ZYm8DT9wIlt9z8VPzLvztPRetmzPlicvB4uadPQyU4hiJ05ykIbFg6LpRINLJkdFB/9CBvoFAMEJlBVkxRDEPynb5+itvAl/HQ798xHVdCmfvn/bsnHPWLJ25cfms51fM3jz/kmdmg8f3vNPHymIihU/gGQ0hDVmmqVdd1x8IdXV1Dwz4/P7BZDJF0QLHC0DXDfBNKJo2Q/D3XrzhZrBq0YzGB69tfPi65+48f91MsLJ5Zw/Js6FogmQEaCCx4MlWLlfGgpFQMOj3+YLBIM9zKYzkhRyQ8vCaq64HAFzy7Wlzbpk34/LrFj3w8Jh/vBYi+o7z1l4Dlt0CVt978YY556z5AVg5HSz5eHs3DfPRFJEV8rJRzEHNRMhxqv7BQE93dzQWSyQTkXA4nsQ9gpN1UDStbDqHECpZpXrWZpL0j8CqaeBXs8Bjc6asuRWsvhYsvRQs/nBrF6fAOEamsywvwxzUdF13nOrw6LEDvT2Dfn8sHkOmQbM5L0SqqtaLGGmITtKWXdQNo1yrKYbg517w1Czw2KIZjQuv+v1D33/urgvXXwOWfbSti+TZSDwViifTFC1rpolQxakGgpGj/sGxsfEszfJCDiOZugaePo5dOpIRX/wypiHkeL3a6zc0yd132bO/uOzZpTM3LZ+1ecWszctmbpoNVn24tYvJC/FkOokRaYKUNVM3DNd1Vd0ykK0alqKasqIXdHRqbKGgCl7uBDv6nukIuW61XK7UPbhn6tN3nLf2rm89Ne+C9fMuWH/31A03gpXvv9YpqEqKmMRpDiMnubyMUPEbO8cpAqFggJc6wZa2P+4fP0lAk3zDuU/+GKyae+G6hilrGqZ4p/808OAnW3u9Aae258QkWOvzjlM9/TpFUHVdo6AcCBx/ca9PEATLsuoiEyQDZj0ELpsLfrho6h0rwU+WgBnzwXcb3nhvX42gfAbB6ai351MeyBCSGVzJ8zRNn/xSN4yBYOSLI4H+4VD/SLhvKHTAH+z2BQiaL9v2yeG3PiDX//F0nPBAEASe5yGEMjwBSZIghKLotSooScg0VAg1tWAYagHKulqAEJ5t8um2e/oJ/AO3NIQ7e8Do6OjevXu7urra2tp6e3s7Ojq7u7sPHz68v4bW1taDB/uam1va2tr7+vpaWz//b0dHb29vOp2WJEkQBPEsCIIgSRJN0/f97Od7Pm35Hzoih6K3W3GlAAAAAElFTkSuQmCC" nextheight="835" nextwidth="827" class="image-node embed"><figcaption htmlattributes="[object Object]" class="">Source: <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.trustwave.com/en-us/resources/blogs/spiderlabs-blog/new-rilide-stealer-version-targets-banking-data-and-works-around-google-chrome-manifest-v3/">https://www.trustwave.com/en-us/resources/blogs/spiderlabs-blog/new-rilide-stealer-version-targets-banking-data-and-works-around-google-chrome-manifest-v3/</a></figcaption></figure><p>The attacker's goal is to predict the nonce, fail any legitimate transactions (so they don't have to regather all signatures) and retrieve a signed transaction from each of the victims, exactly once. If the nonce changes they need to throw away everything they've gathered and start again.</p><p>Therefore there needs to be a command-and-control (C2) server the browser extension or malware is communicating with to receive tasking, gather signatures and then submit the final transaction via one of the victims authenticated session (or directly if there's an unauthenticated API endpoint at Liminal).</p><div class="relative header-and-anchor"><h2 style="text-align: start" id="h-gnosis-safe-wallets"><strong>Gnosis Safe Wallets</strong></h2></div><p style="text-align: start">WazirX had what they thought was a layered security model. Multiple signers, a third-party co-signer and an allowlist that would block transactions to contract addresses not explicitly approved. WazirX assumed there was no transaction type that could give an adversary full access to funds however there are <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out cc-1rn59kg" href="https://medium.com/coinmonks/avoiding-pitfalls-with-delegatecall-27a3c3dd31eb">pitfalls with delegatecall</a> and it should have been disabled irrespective of the allowlist.</p><p style="text-align: start">Gnosis Safe Wallets have the notion of “Guards” which are contracts that can check a transaction and revert based on conditions. See the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out cc-1rn59kg" href="https://github.com/safe-global/safe-smart-account/blob/2556b945ebd7a9e5efd1bf65731f93b1db7e3cc5/contracts/Safe.sol#L144C1-L164C10">code here</a>;</p><pre data-type="codeBlock" language="solidity"><code><span class="hljs-keyword">address</span> guard <span class="hljs-operator">=</span> getGuard();
{
    <span class="hljs-keyword">if</span> (guard <span class="hljs-operator">!</span><span class="hljs-operator">=</span> <span class="hljs-keyword">address</span>(<span class="hljs-number">0</span>)) {
        ITransactionGuard(guard).checkTransaction(
            <span class="hljs-comment">// Transaction info</span>
            to,
            value,
            data,
            operation,
            safeTxGas,
            <span class="hljs-comment">// Payment info</span>
            baseGas,
            gasPrice,
            gasToken,
            refundReceiver,
            <span class="hljs-comment">// Signature info</span>
            signatures,
            <span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>
        );
    }
}</code></pre><p style="text-align: start">The WazirX Safe Wallet had no guards (the SetGuard Event never occurs), WazirX relied solely on the allowlist protection offered by Liminal. With Liminal not blocking particular function signatures or operations involving delegatecall (or a allowlist bypass) the attacker was able to submit the attack transaction and change the implementation of the Safe wallet.</p><p style="text-align: start">Interestingly if you look at all transactions (1,719 in total) that emit the <code>ExecutionSuccess</code> event from the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out cc-1rn59kg" href="https://etherscan.io/address/0x27fd43babfbe83a81d14665b1a6fb8030a60c9b4">WazirX Safe Wallet</a> (0x27fd43babfbe83a81d14665b1a6fb8030a60c9b4) none of them use a delegatecall (operation is set to 1) except for the attack transaction <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out cc-1rn59kg" href="https://etherscan.io/tx/0x48164d3adbab78c2cb9876f6e17f88e321097fcd14cadd57556866e4ef3e185d">0x48164d3adbab78c2cb9876f6e17f88e321097fcd14cadd57556866e4ef3e185d</a>.</p><p style="text-align: start">As delegatecall was never used a guard blocking delegatecall would have been advantageous. The guard could have been disabled for contract upgrades.</p><div class="relative header-and-anchor"><h2 style="text-align: start" id="h-the-attack"><strong>The Attack</strong></h2></div><p style="text-align: start">The <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out cc-1rn59kg" href="https://etherscan.io/tx/0x48164d3adbab78c2cb9876f6e17f88e321097fcd14cadd57556866e4ef3e185d">attack transaction</a> triggers the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out cc-1rn59kg" href="https://etherscan.io/address/0x27fd43babfbe83a81d14665b1a6fb8030a60c9b4">WazirX Safe Wallet</a> to delegatecall <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out cc-1rn59kg" href="https://etherscan.io/address/0xfbfFEF83b1C172fE3BC86C1CCB036AB9F3efCAF2">0xfbfFEF83b1C172fE3BC86C1CCB036AB9F3efCAF2</a> with the calldata <code>0x804e1f0a000000000000000000000000ef279c2ab14960aa319008cbea384b9f8ac35fc6</code> which is passing an address <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out cc-1rn59kg" href="https://etherscan.io/address/0xef279c2ab14960aa319008cbea384b9f8ac35fc6">0xef279c2ab14960aa319008cbea384b9f8ac35fc6</a> to the function selector <code>0x804e1f0a</code>.</p><p style="text-align: start">The decompiled attack contract <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out cc-1rn59kg" href="https://etherscan.io/address/0xfbfFEF83b1C172fE3BC86C1CCB036AB9F3efCAF2">0xfbfFEF83b1C172fE3BC86C1CCB036AB9F3efCAF2</a> shows how the address parameter is received by <code>0x804e1f0a</code> and then stored in part of storage slot 0. Due to the fact this is a delegatecall it is the storage of the WazirX Safe wallet that modified, overwriting the implementation or singleton with that of <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out cc-1rn59kg" href="https://etherscan.io/address/0xef279c2ab14960aa319008cbea384b9f8ac35fc6">0xEf279c2aB14960Aa319008cbEa384b9f8aC35fC6</a>.</p><pre data-type="codeBlock" language="solidity"><code># Palkeoramix decompiler. 
def <span class="hljs-keyword">storage</span>:
  stor0 <span class="hljs-keyword">is</span> <span class="hljs-keyword">uint128</span> at <span class="hljs-keyword">storage</span> <span class="hljs-number">0</span> offset <span class="hljs-number">160</span>
  stor0 <span class="hljs-keyword">is</span> addr at <span class="hljs-keyword">storage</span> <span class="hljs-number">0</span>
def _fallback() <span class="hljs-keyword">payable</span>: # default <span class="hljs-function"><span class="hljs-keyword">function</span>
  <span class="hljs-title"><span class="hljs-keyword">revert</span></span>
<span class="hljs-title">def</span> <span class="hljs-title">unknown804e1f0a</span>(<span class="hljs-params">addr _param1</span>) <span class="hljs-title"><span class="hljs-keyword">payable</span></span>: 
  <span class="hljs-title"><span class="hljs-built_in">require</span></span> <span class="hljs-title"><span class="hljs-keyword">calldata</span></span>.<span class="hljs-title">size</span> - 4 &gt;= 32
  <span class="hljs-title">addr</span>(<span class="hljs-params">stor0.field_0</span>) = <span class="hljs-title">_param1</span>
  <span class="hljs-title">Mask</span>(<span class="hljs-params"><span class="hljs-number">96</span>, <span class="hljs-number">0</span>, stor0.field_160</span>) = 0</span></code></pre><p>At the end of the transaction the implementation contract for the WazirX Safe Wallet Proxy is changed from 0xd9db270c1b5e3bd161e8c8503c55ceabee709552 to <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out cc-1rn59kg" href="https://etherscan.io/address/0xef279c2ab14960aa319008cbea384b9f8ac35fc6">0xEf279c2aB14960Aa319008cbEa384b9f8aC35fC6</a> .</p><p style="text-align: start">The adversary <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out cc-1rn59kg" href="https://etherscan.io/address/0xef279c2ab14960aa319008cbea384b9f8ac35fc6">deployed</a> the attack contracts <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out cc-1rn59kg" href="https://etherscan.io/address/0xfbfFEF83b1C172fE3BC86C1CCB036AB9F3efCAF2">0xfbfFEF83b1C172fE3BC86C1CCB036AB9F3efCAF2</a> and <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out cc-1rn59kg" href="https://etherscan.io/address/0xef279c2ab14960aa319008cbea384b9f8ac35fc6">0xEf279c2aB14960Aa319008cbEa384b9f8aC35fC6</a> approximately 8 days before the attack.</p><p style="text-align: start">With the WazirX Safe wallet implementation changed to <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out cc-1rn59kg" href="https://etherscan.io/address/0xef279c2ab14960aa319008cbea384b9f8ac35fc6">0xEf279c2aB14960Aa319008cbEa384b9f8aC35fC6</a> the attacker can delegatecall through the Safe wallet proxy and execute the logic from the attack contract. The decompiled form is shown below;</p><pre data-type="codeBlock" language="solidity"><code># Palkeoramix decompiler. 
def _fallback() <span class="hljs-keyword">payable</span>: # default <span class="hljs-function"><span class="hljs-keyword">function</span>
  <span class="hljs-title"><span class="hljs-keyword">revert</span></span>
<span class="hljs-title">def</span> <span class="hljs-title">unknown48d3c273</span>(<span class="hljs-params"><span class="hljs-keyword">uint256</span> _param1, <span class="hljs-keyword">uint256</span> _param2</span>) <span class="hljs-title"><span class="hljs-keyword">payable</span></span>: 
  <span class="hljs-title"><span class="hljs-built_in">require</span></span> <span class="hljs-title"><span class="hljs-keyword">calldata</span></span>.<span class="hljs-title">size</span> - 4 &gt;= 64
  <span class="hljs-title"><span class="hljs-keyword">if</span></span> 0<span class="hljs-title">x6eedf92fb92dd68a270c3205e96dccc527728066</span> != <span class="hljs-title">caller</span>:
      <span class="hljs-title"><span class="hljs-keyword">revert</span></span> <span class="hljs-title">with</span> 0, '<span class="hljs-title">Ownable</span>: <span class="hljs-title">caller</span> <span class="hljs-title"><span class="hljs-keyword">is</span></span> <span class="hljs-title">not</span> <span class="hljs-title">the</span> <span class="hljs-title">owner</span>'
  <span class="hljs-title">stor</span>[<span class="hljs-title">_param1</span>] = <span class="hljs-title">_param2</span>
<span class="hljs-title">def</span> <span class="hljs-title">unknowne11fbb75</span>(<span class="hljs-params">addr _param1, <span class="hljs-keyword">uint256</span> _param2</span>) <span class="hljs-title"><span class="hljs-keyword">payable</span></span>: 
  <span class="hljs-title"><span class="hljs-built_in">require</span></span> <span class="hljs-title"><span class="hljs-keyword">calldata</span></span>.<span class="hljs-title">size</span> - 4 &gt;= 64
  <span class="hljs-title"><span class="hljs-keyword">if</span></span> 0<span class="hljs-title">x6eedf92fb92dd68a270c3205e96dccc527728066</span> != <span class="hljs-title">caller</span>:
      <span class="hljs-title"><span class="hljs-keyword">revert</span></span> <span class="hljs-title">with</span> 0, '<span class="hljs-title">Ownable</span>: <span class="hljs-title">caller</span> <span class="hljs-title"><span class="hljs-keyword">is</span></span> <span class="hljs-title">not</span> <span class="hljs-title">the</span> <span class="hljs-title">owner</span>'
  <span class="hljs-title"><span class="hljs-keyword">if</span></span> <span class="hljs-title">_param2</span> != -1:
      <span class="hljs-title"><span class="hljs-keyword">if</span></span> <span class="hljs-title">eth</span>.<span class="hljs-title">balance</span>(<span class="hljs-params"><span class="hljs-built_in">this</span>.<span class="hljs-keyword">address</span></span>) &lt; <span class="hljs-title">_param2</span>:
          <span class="hljs-title"><span class="hljs-keyword">revert</span></span> <span class="hljs-title">with</span> 0, '<span class="hljs-title">Insufficient</span> <span class="hljs-title">balance</span>'
      <span class="hljs-title">call</span> <span class="hljs-title">_param1</span> <span class="hljs-title">with</span>:
         <span class="hljs-title">value</span> <span class="hljs-title">_param2</span> <span class="hljs-title"><span class="hljs-literal">wei</span></span>
           <span class="hljs-title">gas</span> 2300 * <span class="hljs-title">is_zero</span>(<span class="hljs-params">value</span>) <span class="hljs-title"><span class="hljs-literal">wei</span></span>
  <span class="hljs-title"><span class="hljs-keyword">else</span></span>:
      <span class="hljs-title"><span class="hljs-keyword">if</span></span> <span class="hljs-title">eth</span>.<span class="hljs-title">balance</span>(<span class="hljs-params"><span class="hljs-built_in">this</span>.<span class="hljs-keyword">address</span></span>) &lt; <span class="hljs-title">eth</span>.<span class="hljs-title">balance</span>(<span class="hljs-params"><span class="hljs-built_in">this</span>.<span class="hljs-keyword">address</span></span>):
          <span class="hljs-title"><span class="hljs-keyword">revert</span></span> <span class="hljs-title">with</span> 0, '<span class="hljs-title">Insufficient</span> <span class="hljs-title">balance</span>'
      <span class="hljs-title">call</span> <span class="hljs-title">_param1</span> <span class="hljs-title">with</span>:
         <span class="hljs-title">value</span> <span class="hljs-title">eth</span>.<span class="hljs-title">balance</span>(<span class="hljs-params"><span class="hljs-built_in">this</span>.<span class="hljs-keyword">address</span></span>) <span class="hljs-title"><span class="hljs-literal">wei</span></span>
           <span class="hljs-title">gas</span> 2300 * <span class="hljs-title">is_zero</span>(<span class="hljs-params">value</span>) <span class="hljs-title"><span class="hljs-literal">wei</span></span>
  <span class="hljs-title"><span class="hljs-keyword">if</span></span> <span class="hljs-title">not</span> <span class="hljs-title">ext_call</span>.<span class="hljs-title">success</span>:
      <span class="hljs-title"><span class="hljs-keyword">revert</span></span> <span class="hljs-title">with</span> <span class="hljs-title">ext_call</span>.<span class="hljs-title">return_data</span>[0 <span class="hljs-title">len</span> <span class="hljs-title">return_data</span>.<span class="hljs-title">size</span>]
<span class="hljs-title">def</span> <span class="hljs-title">unknown2d8a122e</span>(<span class="hljs-params">addr _param1, <span class="hljs-keyword">uint256</span> _param2</span>) <span class="hljs-title"><span class="hljs-keyword">payable</span></span>: 
  <span class="hljs-title"><span class="hljs-built_in">require</span></span> <span class="hljs-title"><span class="hljs-keyword">calldata</span></span>.<span class="hljs-title">size</span> - 4 &gt;= 96
  <span class="hljs-title"><span class="hljs-keyword">if</span></span> 0<span class="hljs-title">x6eedf92fb92dd68a270c3205e96dccc527728066</span> != <span class="hljs-title">caller</span>:
      <span class="hljs-title"><span class="hljs-keyword">revert</span></span> <span class="hljs-title">with</span> 0, '<span class="hljs-title">Ownable</span>: <span class="hljs-title">caller</span> <span class="hljs-title"><span class="hljs-keyword">is</span></span> <span class="hljs-title">not</span> <span class="hljs-title">the</span> <span class="hljs-title">owner</span>'
  <span class="hljs-title"><span class="hljs-built_in">require</span></span> <span class="hljs-title">ext_code</span>.<span class="hljs-title">size</span>(<span class="hljs-params">_param1</span>)
  <span class="hljs-title">static</span> <span class="hljs-title">call</span> <span class="hljs-title">_param1</span>.<span class="hljs-title">balanceOf</span>(<span class="hljs-params"><span class="hljs-keyword">address</span> tokenOwner</span>) <span class="hljs-title">with</span>:
          <span class="hljs-title">gas</span> <span class="hljs-title">gas_remaining</span> <span class="hljs-title"><span class="hljs-literal">wei</span></span>
         <span class="hljs-title">args</span> <span class="hljs-title"><span class="hljs-built_in">this</span></span>.<span class="hljs-title"><span class="hljs-keyword">address</span></span>
  <span class="hljs-title"><span class="hljs-keyword">if</span></span> <span class="hljs-title">not</span> <span class="hljs-title">ext_call</span>.<span class="hljs-title">success</span>:
      <span class="hljs-title"><span class="hljs-keyword">revert</span></span> <span class="hljs-title">with</span> <span class="hljs-title">ext_call</span>.<span class="hljs-title">return_data</span>[0 <span class="hljs-title">len</span> <span class="hljs-title">return_data</span>.<span class="hljs-title">size</span>]
  <span class="hljs-title"><span class="hljs-built_in">require</span></span> <span class="hljs-title">return_data</span>.<span class="hljs-title">size</span> &gt;= 32
  <span class="hljs-title"><span class="hljs-keyword">if</span></span> <span class="hljs-title">_param2</span> != -1:
      <span class="hljs-title"><span class="hljs-keyword">if</span></span> <span class="hljs-title">ext_call</span>.<span class="hljs-title">return_data</span> &lt; <span class="hljs-title">_param2</span>:
          <span class="hljs-title"><span class="hljs-keyword">revert</span></span> <span class="hljs-title">with</span> 0, '<span class="hljs-title">Insufficient</span> <span class="hljs-title">token</span> <span class="hljs-title">balance</span>'
      <span class="hljs-title">call</span> <span class="hljs-title">_param1</span> <span class="hljs-title">with</span>:
           <span class="hljs-title">gas</span> <span class="hljs-title">gas_remaining</span> <span class="hljs-title"><span class="hljs-literal">wei</span></span>
          <span class="hljs-title">args</span> <span class="hljs-title">Mask</span>(<span class="hljs-params"><span class="hljs-number">224</span>, <span class="hljs-number">32</span>, _param2</span>) &lt;&lt; 224, <span class="hljs-title">mem</span>[260 <span class="hljs-title">len</span> 4]
  <span class="hljs-title"><span class="hljs-keyword">else</span></span>:
      <span class="hljs-title"><span class="hljs-built_in">require</span></span> <span class="hljs-title">ext_code</span>.<span class="hljs-title">size</span>(<span class="hljs-params">_param1</span>)
      <span class="hljs-title">static</span> <span class="hljs-title">call</span> <span class="hljs-title">_param1</span>.<span class="hljs-title">balanceOf</span>(<span class="hljs-params"><span class="hljs-keyword">address</span> tokenOwner</span>) <span class="hljs-title">with</span>:
              <span class="hljs-title">gas</span> <span class="hljs-title">gas_remaining</span> <span class="hljs-title"><span class="hljs-literal">wei</span></span>
             <span class="hljs-title">args</span> <span class="hljs-title"><span class="hljs-built_in">this</span></span>.<span class="hljs-title"><span class="hljs-keyword">address</span></span>
      <span class="hljs-title"><span class="hljs-keyword">if</span></span> <span class="hljs-title">not</span> <span class="hljs-title">ext_call</span>.<span class="hljs-title">success</span>:
          <span class="hljs-title"><span class="hljs-keyword">revert</span></span> <span class="hljs-title">with</span> <span class="hljs-title">ext_call</span>.<span class="hljs-title">return_data</span>[0 <span class="hljs-title">len</span> <span class="hljs-title">return_data</span>.<span class="hljs-title">size</span>]
      <span class="hljs-title"><span class="hljs-built_in">require</span></span> <span class="hljs-title">return_data</span>.<span class="hljs-title">size</span> &gt;= 32
      <span class="hljs-title"><span class="hljs-keyword">if</span></span> <span class="hljs-title">ext_call</span>.<span class="hljs-title">return_data</span> &lt; <span class="hljs-title">ext_call</span>.<span class="hljs-title">return_data</span>[0]:
          <span class="hljs-title"><span class="hljs-keyword">revert</span></span> <span class="hljs-title">with</span> 0, '<span class="hljs-title">Insufficient</span> <span class="hljs-title">token</span> <span class="hljs-title">balance</span>'
      <span class="hljs-title">call</span> <span class="hljs-title">_param1</span> <span class="hljs-title">with</span>:
           <span class="hljs-title">gas</span> <span class="hljs-title">gas_remaining</span> <span class="hljs-title"><span class="hljs-literal">wei</span></span>
          <span class="hljs-title">args</span> <span class="hljs-title">Mask</span>(<span class="hljs-params"><span class="hljs-number">480</span>, <span class="hljs-number">-256</span>, ext_call.return_data &lt;&lt; <span class="hljs-number">256</span>, mem[<span class="hljs-number">260</span> len <span class="hljs-number">4</span>]
  <span class="hljs-keyword">if</span> not ext_call.success:
      <span class="hljs-keyword">revert</span> with <span class="hljs-number">0</span>, <span class="hljs-string">'Token transfer failed'</span></span></span></code></pre><p>All functions check that the <code>msg.sender</code> is <code>0x6eedf92fb92dd68a270c3205e96dccc527728066</code>, you can check this address on Etherscan <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out cc-1rn59kg" href="https://etherscan.io/address/0x6eedf92fb92dd68a270c3205e96dccc527728066">here</a>.</p><p style="text-align: start">There’s two functions the attacker used to transfer ETH (0xe11fbb75 or <code>unknowne11fbb75</code> in the decompilation above) and the other to transfer ERC20s (0x2d8a122e or <code>unknown2d8a122e</code>).</p><p style="text-align: start">Let’s look at ETH transfer functionality and the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://etherscan.io/tx/0xe3dba30431bcd1d8b9189460cb973ff0addf332ea423c5b2349ba57e536f0495">transaction</a> where 15,298 ETH was transferred from the WazirX Safe Wallet to <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out cc-1rn59kg" href="https://etherscan.io/address/0x04b21735e93fa3f8df70e2da89e6922616891a88">0x04b21735e93fa3f8df70e2da89e6922616891a88</a>. The attacker specifies the calldata <code>0xe11fbb7500000000000000000000000004b21735e93fa3f8df70e2da89e6922616891a88ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff</code> which can be split into;</p><ul><li><p><code>0xe11fbb75</code> function selector</p></li><li><p><code>0x04b21735e93fa3f8df70e2da89e6922616891a88</code> as the destination address and</p></li><li><p><code>0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff</code> as the uint256 or bytes32 value. Note a value of all Fs could be <code>type(uint256).max</code> or <code>-1</code>.</p></li></ul><p style="text-align: start">Looking at the <code>unknowne11fbb75</code> function, it checks if the <em>param2 </em>is all Fs and if it’s not it checks that sufficient balance exists before sending the value of <em> _param2</em> to the destination address. If <em>_param2</em> is set to all Fs it just sends the entire balance.</p><p style="text-align: start">The ERC20 transfer has similar functionality,<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out cc-1rn59kg" href="https://etherscan.io/tx/0x1e523051a8a481c5a57fe8261cced4cb3e775ce9315168b041fd34fc25d563ac"> this transaction</a> is a good example where all the SHIB is transferred out of the WazirX wallet. The adversary uses the calldata;</p><p style="text-align: start"><code>0x2d8a122e00000000000000000000000095ad61b0a150d79219dcf64e1e6cc01f0b64c4ce00000000000000000000000004b21735e93fa3f8df70e2da89e6922616891a88ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff</code> which can be split into;</p><ul><li><p><code>0x2d8a122e</code> function selector</p></li><li><p><code>0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce</code> ERC20 contract address for Shiba Inu.</p></li><li><p><code>0x04b21735e93fa3f8df70e2da89e6922616891a88</code> the address to send tokens to.</p></li><li><p><code>0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff</code> as the uint256 or bytes32 value (see above).</p></li></ul><p style="text-align: start">The <code>unknown2d8a122e</code> operates similar to the ETH transfer. If the attacker asks to transfer less than all Fs then the balance is checked and the value sent. If the max is requested then it is sent. Note there’s two address parameters - one for the ERC20 token and one for the destination or <code>to</code>.</p><div class="relative header-and-anchor"><h2 id="h-what-can-treasury-operators-learn-from-this-attack">What can treasury operators learn from this attack?</h2></div><ol><li><p>Delegatecall is a serious risk to Gnosis Safe Wallets and is not used often except for wallet upgrades. A guard should be implemented that checks the operation field is set to 0 (call) and not to 1 (delegatecall). There was an over reliance on the Liminal allowlist that could have been mitigated by WazirX deploying their own guard contract.</p></li><li><p>Any signing failure should incur a mandatory delay in signing future transactions (24 hours). All three signers failed signing a transaction and each of these situations was a chance to review the process. This would have given WazirX time to raise the issue with Liminal and for Liminal to confirm the signatures were invalid.</p></li><li><p>Introduce randomness into the signing process. The multi-sig was a 4/6 so there are 5 signers at WazirX. If they had of run a random function for who should sign each transaction the adversary would have had to exploit more endpoints. Common signers become a well worn groove and the signing information is available on chain. It aids adversary targeting.</p></li><li><p>Closely vet all browser extensions and preferably use a separate machine for signing. This machine should be up to date in terms of operating system and application patches and have minimal to no additional software or browser extensions.</p></li><li><p>Move from general purpose operating systems to iOS. General purpose operating systems and browsers increase the risk of remote code execution and the use of browser extensions. A zero day vulnerability is much cheaper to purchase for Windows or Mac than it is for iOS. I'm not suggesting the mobile phone be the wallet but rather it should render a QR code for an offline wallet to scan (see Metamask Mobile and Keystone wallet for example). ChromeBooks and ChromeOS with minimal to no browser extensions would also be a good approach.</p></li><li><p>Endpoint Detection and Response software should be running on all signing machines. This software alerts on malware and any communication to known command and control servers. </p></li><li><p>Real time response capabilities that allow a snapshot of all browser configuration, plugins, cookies etc. Providing this kind of snapshot to an internal or external digital forensics and incident response team would be able to answer a number of outstanding questions.</p></li></ol><p></p><p></p>]]></content:encoded>
            <author>ayc@newsletter.paragraph.com (ayc)</author>
        </item>
    </channel>
</rss>