<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by StarShell on Medium]]></title>
        <description><![CDATA[Stories by StarShell on Medium]]></description>
        <link>https://medium.com/@starshellwallet?source=rss-eb71dcb199af------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*hKh528xgvRqlcgBNeMU3sw@2x.png</url>
            <title>Stories by StarShell on Medium</title>
            <link>https://medium.com/@starshellwallet?source=rss-eb71dcb199af------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 14:43:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@starshellwallet/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[The Failures of Web3 Wallet Security]]></title>
            <link>https://medium.com/@starshellwallet/the-failures-of-web3-wallet-security-90311631e08c?source=rss-eb71dcb199af------2</link>
            <guid isPermaLink="false">https://medium.com/p/90311631e08c</guid>
            <category><![CDATA[metamask]]></category>
            <category><![CDATA[computer-security]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[browser-extension]]></category>
            <category><![CDATA[web3]]></category>
            <dc:creator><![CDATA[StarShell]]></dc:creator>
            <pubDate>Tue, 03 May 2022 23:47:21 GMT</pubDate>
            <atom:updated>2022-05-03T23:47:21.304Z</atom:updated>
            <content:encoded><![CDATA[<h4>An indictment of non-custodial software wallet browser extension security affecting MetaMask, Phantom, Keplr, and many others.</h4><blockquote>In this article, I explain how even the most trusted Web3 extensions are doing a disservice to their user base by failing to adhere to higher security standards. I then provide some technical details about how <a href="https://starshell.net/">StarShell</a> is attempting to greatly reduce this attack surface by introducing novel key management techniques in Web-based JavaScript.</blockquote><blockquote><strong>These security issues do not apply to users who back their Web3 accounts with hardware wallets. </strong>I strongly urge any cryptocurrency user, who can afford one, to consider purchasing a reputable hardware wallet that is compatible with their existing assets.</blockquote><blockquote><a href="https://starshell.net/">StarShell</a> is an upcoming Web3 wallet that will deploy as a browser extension and is introducing novel security features that attempt to address such issues.</blockquote><blockquote>— by Blake Regalia, Creator of StarShell</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CQNUOvR4Ord8ZAoSzJxbkA.png" /></figure><p>In a <a href="https://medium.com/@starshellwallet/web3-wallets-have-serious-privacy-and-security-flaws-5023f8f872b1">previous article</a>, I pointed out a security flaw in other Web3 wallets where a malicious co-installed browser extension with minimal read/write page data permissions could perform MITM attacks by replacing page-generated transaction data in order to trick users into approving arbitrary transactions.</p><p>I have some more bad news.</p><h4>Cryptography on the Web</h4><p>Modern cryptographic functions can be difficult to implement properly as they typically involve more advanced mathematics such as polynomial evaluation, discrete logarithms, modular exponentiation, large primes, elliptic curves, and Galois fields, among others. Aside from the math being difficult to implement, the supporting algorithms also require extreme attention to detail as any mistakes can add up to major vulnerabilities. This is why projects usually opt to import third-party cryptography libraries that have been thoroughly evaluated for correctness.</p><p>On the Web, front-end applications have access to the Web Crypto API in today’s browsers. This is not only an enormously helpful feature, but also a crucial component for application security for a few very important reasons. The first of which is cryptographically-secure pseudorandom number generation (CSPRNG) without which, applications would be unable to produce private keys barring the need to manually introduce extra entropy.</p><p>The other crucial component of Web Crypto is the ability to import keys, where the browser is able to take advantage of platform-specific cryptographic primitives to store them in protected memory regions (either by the operating system or by a hardware-based key manager), while still allowing them to be used for things like signing, verifying, encrypting, decrypting and so on.</p><h4>Cryptocurrency on the Web</h4><p><a href="https://en.bitcoin.it/wiki/Secp256k1">Secp256k1</a> refers to the elliptic curve parameters used in Bitcoin, Ethereum, and many other cryptocurrencies (including all Cosmos-SDK chains). Satoshi chose secp256k1 because its parameters are non-randomly constructed, unlike the NIST P-256 curve (aka, secp256r1 or prime256v1) which some believe may have a backdoor. While Web Crypto <em>does</em> support NIST curves, it does not support <a href="https://github.com/w3c/webcrypto/issues/82">secp256k1, nor will it ever</a>.</p><p>This leaves any application running in the browser, most notably any Web3 wallet extension, forced to rely on JavaScript-based cryptography to perform secp256k1 operations <strong>with the private keys in plaintext</strong>.</p><h4>Put another way, software wallets keep private keys in plain memory, unencrypted, and unprotected!</h4><p>Albeit far less secure than any hardware-based cryptography, soft wallets do provide a greater reach in terms of making Web3 more accessible. Hardware wallets are not exactly cheap, and the burden of extra hardware can be a barrier to entry. However:</p><h4><strong>The ways in which these soft wallets manage private keys in (JavaScript) memory demonstrates a clear lack of understanding for how computer memory works, a total lack of appreciation for security best practices, and a critical failure on behalf of everyone involved with the development and security audits of such software.</strong></h4><p>It’s troubling to discover these types of neglected weaknesses. Millions of people trust these software to protect their assets and to safely mediate their connection to the decentralized platform that is Web3.</p><p>Suffice to say, the severity of these issues cannot be understated. While writing this article, I found a fantastic blog post on software wallet security written by the folks at Ledger which echoes many of the same security concerns raised here: <a href="https://blog.ledger.com/software-wallets/">https://blog.ledger.com/software-wallets/</a></p><h4>Enter StarShell</h4><p>A perfectly secure soft wallet, especially one that runs in the browser, is next to impossible with today’s tools that are available at developers’ disposal. Again, I strongly advise the use of hardware wallets whenever possible, but I also understand that this can be cost prohibitive for some. For those users, <strong>soft wallets should employ much stricter security practices </strong>in order to reduce the risks of <a href="https://en.wikipedia.org/wiki/Key_finding_attacks">key-finding attacks</a>.</p><blockquote>The rest of this article describes how StarShell will attempt to mitigate the aforementioned security concerns. Please note that these solutions can merely reduce the attack surface at best, and that they will be pending an independent security audit to verify their effectiveness.</blockquote><h4>Private keys in memory</h4><p>In elliptic curve cryptography, a private key is essentially a very large integer. Signing messages (ECDSA) with the private key requires the ability to perform arithmetic on such very large integers. Back in the day, developers were forced to use primitives such as hex-encoded strings or arrays of numbers to represent these keys. Today, there is BigInt, which greatly simplifies the implementation of the algorithms since arithmetic operations are handled by the runtime.</p><p>However, all of those datatypes, BigInt included, are problematic for private keys. The reason comes down to JavaScript’s garbage collection and how operating systems allocate and deallocate memory.</p><p>Essentially, private key material (including any intermediate values) have the ability to live in memory long after the algorithms are done using them. As Chow et al. describe in <em>“Shredding Your Garbage: Reducing Data Lifetime Through Secure Deallocation.”</em> (<a href="https://www.usenix.org/legacy/event/sec05/tech/full_papers/chow/chow.pdf">PDF</a>, <a href="https://www.usenix.org/legacy/event/sec05/tech/full_papers/chow/chow_html/">HTML</a>), the proper way to manage private key material is by zeroing out the memory immediately after it is no longer needed (a practice they refer to as secure deallocation).</p><p>Without using TypedArrays, JavaScript programs have no way to guarantee that private key material has been cleared from RAM. Depending on the system, private keys can continue to live in memory even after the browser is closed, or in some cases even across reboots. In those states, all a rogue program has to do is allocate some non-zeroed memory from the operating system and search it for old key material.</p><h4>Combining one-time pad with secure deallocation</h4><p>In StarShell, the approach I’ve taken attempts to greatly reduce the key-finding attack surface by only allowing plaintext private keys to exist in memory for very short periods of time (i.e., only when absolutely necessary). To the best of my knowledge, this approach has never been explored in a Web/JavaScript context.</p><p>The approach starts by storing the <em>encrypted</em> private key in memory, providing baseline security for <em>data in use</em>. If an attacker were to dump the browser’s memory in this state, the user’s private key would be protected. In order to use the private key however, we do need to be able to decrypt it and hold it in memory for a very short period of time.</p><p>This is where Web Crypto comes into play. Rather than completely abandon Web Crypto for secp256k1, we can still take advantage of its secure key management feature by using it to derive a <a href="https://en.wikipedia.org/wiki/One-time_pad">one-time pad key</a> that can be used to unwrap the encrypted version of the secp256k1 private key stored in memory. The following data flow diagram provides a high-level overview of the processes for generating and/or wrapping the private key, and subsequently unwrapping it:</p><figure><img alt="Data flow diagram of secp256k1 private keys in StarShell." src="https://cdn-images-1.medium.com/max/1024/1*VEb8fsyHQeDBDdy2Fw4UAw.png" /><figcaption>Notice that the private key only exists in plaintext for very short periods of time.</figcaption></figure><p>In order to emulate secure deallocation in JavaScript, it is imperative that private key material never exist in any primitive datatypes other than TypedArrays. <strong>This means no BigInt</strong> since there is no guarantee the browser will zero out garbage collected data. All large integer operations must instead be implemented and performed using TypedArrays since they can be explicitly zeroed out before deallocation.</p><p>While the proposed solution is by no means perfect security, it does greatly reduce the amount of time that plaintext private key material exists in memory (especially when compared to the competition). Naturally, this should reduce the key-finding attack surface since a malicious actor would have to access the program’s memory during a very small time window in order to recover the private key.</p><p>Whew! That got rather technical at the end. This topic in particular required a lot more work behind the scenes. If you care about security and the future of Web3, please consider following us on <a href="https://twitter.com/StarShellWallet">Twitter</a>, or joining our <a href="https://discord.gg/AguVmNxqBm">Discord</a> server.</p><p>Learn more about StarShell at our website: <a href="https://starshell.net/">https://starshell.net/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=90311631e08c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Web3 Wallets Have Serious Privacy and Security Flaws]]></title>
            <link>https://medium.com/@starshellwallet/web3-wallets-have-serious-privacy-and-security-flaws-5023f8f872b1?source=rss-eb71dcb199af------2</link>
            <guid isPermaLink="false">https://medium.com/p/5023f8f872b1</guid>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[wallet]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[browser-extension]]></category>
            <dc:creator><![CDATA[StarShell]]></dc:creator>
            <pubDate>Sun, 24 Apr 2022 07:27:58 GMT</pubDate>
            <atom:updated>2022-04-24T07:27:58.452Z</atom:updated>
            <content:encoded><![CDATA[<h4>The dangers of wallet browser extensions, and how to fix them.</h4><blockquote>When I started implementing the <a href="https://starshell.net/">StarShell</a> Wallet browser extension, I noticed a handful of unexposed privacy concerns and a security risk affecting (as far as I can tell) <strong>all</strong> current wallet extensions.</blockquote><blockquote>This article briefly describes those flaws and motivates the need for better privacy and stricter security in wallet extensions.</blockquote><blockquote><a href="https://starshell.net/">StarShell</a> is an upcoming Web3 wallet that will deploy as a browser extension and is introducing novel privacy and security features that address such issues.</blockquote><blockquote>—by Blake Regalia, Creator of StarShell</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*-DOCFqD3_5qPeIKdsLQ9lw.png" /></figure><p>Browser extensions such as MetaMask, Phantom, and Keplr have filled a very important role in the Web3 ecosystem. These extensions are what make rich decentralized web apps possible. They provide a mediated connection to your accounts on the blockchain. Everything from DeFi platforms to NFT markets rely on the so-called <em>Provider APIs</em> that these wallets enable in your browser.</p><p>As decentralized web apps (dApps) and the Web3 wallets that support them become more popular, they both become bigger targets for advertisers, aggregators, agencies and hackers — not only for the cryptocurrencies they handle but also for the sensitive information they are supposed to protect.</p><p>Surprisingly, all of these browser extension wallets are currently neglecting several major privacy concerns, and seem to be exposed to a certain attack vector that has not been widely discussed or acknowledged.</p><h3>Privacy Concern #1: Indiscriminate Transparency</h3><p>Wallet extensions make Provider APIs available by injecting a JavaScript variable into the global scope of every webpage you visit. These variables serve as entry points for dApps to connect with your wallet, but to every other site, these variables essentially act as a giant banner exclaiming, <em>“Hello world! This user has the following wallet extensions installed: […]”</em>.</p><p>Aside from enhancing browser fingerprinting, this leaky practice also <strong>informs every random website you visit which cryptocurrencies you use</strong>. Here is a list of at least some of the variables exposed by major network providers:</p><ul><li><em>window.ethereum</em></li><li><em>window.solana</em></li><li><em>window.cardano</em></li><li><em>window.keplr</em></li><li><em>window.klaytn</em></li></ul><p>However, it doesn’t have to be like this. <strong>Your wallet does not need to go around advertising its presence</strong> to every website you visit by default. In fact, if you are using one of these extensions now, you should consider taking advantage of improved browser privacy by limiting which sites the extension has access to read and change data on.</p><h3>Privacy Concern #2: Forced Doxxing</h3><p>As a Web3 user, you may be familiar with these sorts of prompts:</p><figure><img alt="Example prompt of website requesting connection to wallet" src="https://cdn-images-1.medium.com/max/866/1*uYLFxAWkgEuZRD_N9F6ccQ.png" /><figcaption>Nothing wrong with OpenSea and Stashh, just using them as examples :)</figcaption></figure><p>But did you know that every time you approve a connection, you are actually trusting the website with potentially compromising information about your identity? In addition to tracking cookies, browser fingerprinting, and your geo-locatable IP address, you are also sharing your wallet address, which is <strong>the last line of defense protecting the anonymity of your entire transaction history on chain</strong>. This extra dimension of information is like a treasure trove for organizations that are capable of leveraging it for their benefit, and let’s just say that their motivations are typically not aligned with your best interest.</p><p>It doesn’t have to be like this. Remember how <a href="https://www.ftc.gov/policy/advocacy-research/tech-at-ftc/2015/04/privacy-trade-offs-retail-tracking">MAC address tracking</a> was used to non-consensually track people via their mobile devices as they walked by wireless access points? Eventually, vendors started introducing MAC address anonymization to combat what had become a rampant violation of user privacy. <strong>We now need that in Web3.</strong></p><h3>An Underestimated Attack Vector</h3><p>Something that I have yet to see acknowledged is a potential attack vector from malicious web extensions co-installed in the browser.</p><p>The problem is that communication between websites and wallet extensions can easily be <strong>spoofed or intercepted by a malicious extension</strong>. This could lead to a situation where the user is tricked into approving actions generated by the attacker. For example, the attacker could act as a <strong>MITM by reading and modifying transaction data</strong> sent from the website to the wallet. All the while, any prompts to the user would appear as though they were produced by the trusted website, perhaps in response to user input.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SDfhnNrj_CQ09X36DTE09Q.png" /></figure><p>Unfortunately, it would appear that this attack vector is not seen as a threat by today’s wallet vendors because there do not seem to be any counter-measures being used. Perhaps the developers are placing their trust in extension stores’ anti-malware services, or they believe users will do their due diligence, or that it would complicate the API, or maybe they simply haven’t even realized it. <strong>None of these excuse relaxed security.</strong></p><p>History has shown that niche, obscure, malicious extensions have the potential to go undetected in stores for a while before they are discovered. Just take a look at the arms race currently taking place between browser vendors and extensions. There have been dozens of cases of malware and spyware extensions discovered after reaching millions of downloads, <a href="https://medium.com/mycrypto/discovering-fake-browser-extensions-that-target-users-of-ledger-trezor-mew-metamask-and-more-e281a2b80ff9">particularly in the cryptocurrency realm</a>. The bottom line is that <strong>wallet extensions should not take a secure browser environment for granted</strong>.</p><p>There are actually methods to protect against such MITM attacks from co-installed extensions — all it takes is a bit of clever engineering.</p><h3>Enter StarShell</h3><p><em>Privacy by default</em> is at the core of StarShell’s ethos. Users should not have take extra steps to protect their identity. Privacy settings should be enabled by default for everyone, not something they have to opt-in to take advantage of.</p><blockquote>The rest of this article describes how StarShell will address each of the aforementioned privacy and security issues. While I attempt to keep the explanations high-level, please be aware that some sections require more technical language.</blockquote><h4>Addressing Privacy Concern #1</h4><p>Rather than advertising its presence to every website by default, StarShell will employ a <em>Covert Discovery</em> process. This requires websites to first make a request in order to see if the wallet is installed, giving users the ability to browse undetected, i.e., without exposing the extension’s presence.</p><p>See the <a href="https://github.com/SolarRepublic/prerelease-docs/blob/main/StarShell-Wallet-API-Primer.md#web-apps-javascript-api">prerelease documentation</a> for a detailed explanation of this process.</p><h4>Addressing Privacy Concern #2</h4><p>Web dApps typically use your wallet address to generate transaction data, embedding the address into a smart contract call, or using the address as a key to store session data associated with the account. However, similar to the MAC address tracking debacle, this address is exploitable beyond its function.</p><p>To combat this type of exploitation, <strong>StarShell will offer an address randomization service </strong>when exporting accounts’ public keys to web dApps. This service, known as <em>Shadow Accounts,</em> ensures the integrity of produced transactions by replacing the shadow address with the real address before transactions are submitted. With Shadow Accounts, the shadow addresses are derived from the user’s mnemonic, ensuring that in the event a shadow address is used by the site outside the wallet’s control (for example, in the event a site records addresses to later be used for an airdrop), the user can still claim the shadow account by deriving its private key.</p><h4>Addressing the MITM (Malicious Extension) Attack Vector</h4><p>This problem took quite a bit of contemplation. How can a website’s JavaScript application and the wallet extension establish a private and trusted communication channel? I explored everything from stack trace checking to native function verification to cryptographic key exchange. The underlying challenge is that user scripts and so-called <em>inpage</em> content scripts have no guarantee that any <em>window</em> property hasn’t been redefined by an attacker. This means that none of the built-in functions and Web APIs can be trusted from the <em>“</em>MAIN<em>” world</em>.</p><p>A malicious actor could theoretically redefine any tools at the page’s disposal, <em>Math.random</em>, <em>crypto.subtle</em>, <em>Object.defineProperty</em>, <em>Function.prototype</em>, <em>Array.prototype</em>, and so on. In fact, the only operations that can be reliably used in the <em>MAIN</em> world of the browser’s JavaScript environment (assuming the presence of a malicious extension) are ones that cannot be redefined: <strong>operators</strong>.</p><p>It turns out this is a complex problem with a <em>somewhat-yet-also-not-so-simple</em> solution. The answer lies with non-configurable JavaScript properties, reference comparison<em>, </em>stack signing<em>, </em>and out-of-band authentication. Given its technical nature, I will present a detailed explanation of this process in the next revision of the <a href="https://github.com/SolarRepublic/prerelease-docs/blob/main/StarShell-Wallet-API-Primer.md">prerelease documentation</a>. Make sure to join our Discord server if you would like to be notified of new material.</p><p>That’s all for now! If you care about privacy and the future of Web3, please consider following us on <a href="https://twitter.com/StarShellWallet">Twitter</a>, or joining our <a href="https://discord.gg/AguVmNxqBm">Discord</a> server.</p><p>Learn more about StarShell at our website: <a href="https://starshell.net/">https://starshell.net/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5023f8f872b1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>