Sample audits · Open-source projects, first eight

anza-xyz/wallet-adapter

The standard way Solana web apps connect to wallets.

Summary card for this audit: 29 findings after review, 0 High, 3 Medium, 19 Low, 7 Info
Auditedanza-xyz/wallet-adapter at commit 3663416165b9a1af734c451e588b40cacd7091c1
Date11 October 2026 (audited again; first audit 11 October 2026)
How it ranlocal run on our workstation, full audit, Standard review
Verdict after reviewPass with notes (Fail if a High finding remains after review, otherwise Pass with notes)
0
High after review
3
Medium after review
19
Low after review
7
Info after review
0
excluded on review

Compared with the first audit

Same commit as the first audit: the project's default branch has no later commits (checked 11 October 2026), so nothing could have been fixed upstream in between. Each finding of the first audit (11 October 2026) was checked again against the code audited now. 21 findings in the first audit; 21 still open (16 found again, 5 not reported again but still present). This audit has 29 findings after review, 11 of them new.

First auditFindingReviewed rating thenNowIn this audit
#1Example reports success for failed txLowStill open#4
#2Sign fallback || transactionLowStill open#5
#3Sign-in example has no nonce/expiryInfoStill open#7
#4No secure-context checkInfoStill open#9
#5Re-selected connected mobile wallet shown as disconnectedMediumStill open#10
#6Detection polls every second foreverLowStill open#14, #15
#7Solflare leaves accountChanged listenerLowStill open#18
#8Ledger/Trezor leave device session open on failed connectMediumStill open#12, #13
#9Mobile decision memoised without readyStateLowStill opennot reported again
#10connecting/disconnecting kept in ref + stateLowStill opennot reported again
#11Generic localStorage keys, unvalidated JSONInfoStill open#17
#12Changing storage key writes old value to new slotLowStill open#11
#13Second connect() resolves immediatelyLowStill open#23, #21
#14Example buttons can double-fireLowStill opennot reported again
#15Lifecycle code duplicated, has driftedLowStill open#24
#16Modal text hard-codedLowStill opennot reported again
#17Buffer polyfill copied 4 timesLowStill open#25
#18Two "missing provider" message buildersInfoStill open#26
#19MathWallet message handler ignores senderLowStill open#29
#20Keystone signMessage un-awaited promiseLowStill open#3
#21ConnectionProvider default config new each renderLowStill opennot reported again
How to read this page

Each finding keeps the number it has in the audit report. The rating shown first is the one after review; the first automated rating is listed with it. 13 findings were first rated Medium or High; 3 of them are Medium or High after review. Text marked "From the report" is quoted from the audit report; fixes are suggestions and were not tested. Code locations link to the file and line at the audited commit.

Medium after review (3)

10. Medium Provider does not pick up the state of an adapter that is already connected
First rating: Medium · Reviewed rating: Medium · Review: confirmed · also in the first audit (#5)
From the report
Evidence
useEffect(() => {
    if (!adapter) return;
Why it matters

connected and publicKey are read from the adapter only on the first render (lines 44–45). When the selected adapter changes, the effect's cleanup sets both to disconnected, and nothing re-reads the new adapter. The mobile wallet adapter is deliberately not disconnected when the user switches away (WalletProvider.tsx line 93). If the user switches back to it, the provider shows "disconnected" while the adapter is connected. connect() then returns early on wallet?.adapter.connected (line 255), so the UI is stuck.

Suggested fix, not tested

in the effect, after subscribing, call setPublicKey(adapter.publicKey) and setConnected(adapter.connected).

13. Medium Trezor Connect is not released after a failed connect
First rating: Medium · Reviewed rating: Medium · Review: confirmed · also in the first audit (#8)
From the report
Evidence
await wallet.init({
Why it matters

after init() succeeds, a failed public-key request (lines 116–122) leaves the initialised instance, its iframe and its listeners alive. The next connect() calls init() again on the already initialised instance. In addition, _disconnected calls wallet.dispose() without await (line 214), so a rejection escapes the surrounding try/catch as an unhandled rejection.

Suggested fix, not tested

on every failure after init(), await wallet.dispose() inside a try/catch. Add await on line 214.

28. Medium Extra signers are ignored when sending a versioned transaction
First rating: Medium · Reviewed rating: Medium · Review: confirmed · new in this audit
From the report
Evidence
transaction = await this.signTransaction(transaction);
const rawTransaction = transaction.serialize();
return await connection.sendRawTransaction(rawTransaction, options);
Why it matters

in the base signer's versioned-transaction branch, the signers option is never applied, unlike the legacy branch (lines 61–65). Any versioned transaction that needs an extra signer, such as a new account keypair, is submitted without that signature and fails. The whole options object, signers included, is also passed to sendRawTransaction. This affects every adapter built on the base signer (Ledger, Trezor, Keystone, Torus, Particle, the unsafe burner, and others).

Suggested fix, not tested

destructure signers before the branch, call transaction.sign(signers) when present before the wallet signs, and pass only the remaining send options to sendRawTransaction.

Low after review (19)

1. Low Signing errors in the Fractal adapter escape error handling
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence
try {
    return wallet.signTransaction(transaction);
} catch (error: any) {
Why it matters

the promise is returned without await, so if the wallet rejects, neither catch block runs:

  • the error is not wrapped in WalletSignTransactionError;
  • the adapter's error event never fires;
  • the app's onError handler is never called, and callers get a raw, unclassified rejection.

The same applies to signAllTransactions (line 145) and signMessage (line 161).

Suggested fix, not tested

use return await wallet.signTransaction(transaction); (and the same for the other two methods).

2. Low Nightly message signing is not awaited, reports the wrong error type and alters the message
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence
return wallet.signMessage(new TextDecoder().decode(message));
Why it matters

this line has three problems:

  • It is not awaited, so a rejection bypasses error wrapping and the error event.
  • The catch block throws WalletSignTransactionError for a message-signing failure.
  • The bytes are decoded to text with a lenient decoder, which replaces invalid UTF-8 sequences. A signature over non-text bytes therefore covers different data than the caller supplied.
Suggested fix, not tested

return await; throw WalletSignMessageError. Pass the raw bytes if the wallet API allows it; otherwise reject non-UTF-8 input with new TextDecoder('utf-8', { fatal: true }).

3. Low Keystone message signing escapes error handling
First rating: Medium · Reviewed rating: Low · Review: rated too high · also in the first audit (#20)
From the report
Evidence
try {
    return keyring.signMessage(publicKey, message);
} catch (error: any) {
Why it matters

this is the same missing await as in finding 1. A rejected or failed hardware signature is neither wrapped nor emitted, and the catch block uses the transaction error class.

Suggested fix, not tested

return await keyring.signMessage(...) and throw WalletSignMessageError.

4. Low Example app reports failed transactions as successful
First rating: Medium · Reviewed rating: Low · Review: rated too high · also in the first audit (#1)
From the report
Evidence
await connection.confirmTransaction({ blockhash, lastValidBlockHeight, signature });
notify('success', 'Transaction successful!', signature);
Why it matters

confirmTransaction resolves even when the transaction was processed and failed on chain; the failure is only in value.err. The user is told the transaction succeeded when it did not. Developers copy this example, so the flaw spreads. The same pattern is in SendLegacyTransaction.tsx (line 43), SendV0Transaction.tsx (line 56) and RequestAirdrop.tsx (line 21).

Suggested fix, not tested

read the result and throw when value.err is set, before showing success.

5. Low An empty signing result is silently replaced by the unsigned input
First rating: Low · Reviewed rating: Low · Review: confirmed · also in the first audit (#2)
From the report
Evidence
return (await wallet.signTransaction(transaction)) || transaction;
return (await wallet.signAllTransactions(transactions)) || transactions;
Why it matters

if a wallet ever resolves with nothing, for example on a silent cancel, the caller receives the original unsigned transaction as if it had been signed. The failure then surfaces later and less clearly, when the transaction is sent. The same fallback is in most injected-wallet adapters (solflare, torus, coinbase, trust, mathwallet, and others).

Suggested fix, not tested

treat an empty result as a rejection (WalletSignTransactionError). For batches, also check that the result length matches the input.

6. Low Nightly connect dereferences a public key that may be missing
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence
if (wallet.publicKey.toString() === '11111111111111111111111111111111') throw new WalletAccountError();
Why it matters

if the wallet resolves connect() without an account, this throws a raw TypeError instead of the account error the other adapters raise.

Suggested fix, not tested

check !wallet.publicKey first and throw WalletAccountError.

11. Low Changing the storage key overwrites or erases the saved value of the new key
First rating: Medium · Reviewed rating: Low · Review: rated too high · also in the first audit (#12)
From the report
Evidence
useEffect(() => {
    if (isFirstRenderRef.current) {
Why it matters

the value is read from storage once, at mount, but the write effect also runs when key changes. If a consumer changes the key at runtime (for example localStorageKey on WalletProvider), the old key's value is written under the new key. When that value is null, the new key's saved value is deleted.

Suggested fix, not tested

re-read storage when key changes and skip the write for that render, or document and enforce that the key is fixed.

12. Low Ledger device stays open after a failed connect
First rating: Medium · Reviewed rating: Low · Review: rated too high · also in the first audit (#8)
From the report
Evidence
publicKey = await getPublicKey(transport, this._derivationPath);
} catch (error: any) {
    throw new WalletPublicKeyError(error?.message, error);
Why it matters

the HID transport opened on line 81 is never closed when reading the public key fails (wrong app open, locked device, user rejection). The page keeps holding the device. Retries and other tabs or apps can find the Ledger busy until the page is reloaded.

Suggested fix, not tested

in that catch block, await transport.close() (ignoring its errors) before rethrowing.

14. Low Wallet detection timer never stops for wallets that are not installed
First rating: Low · Reviewed rating: Low · Review: confirmed · also in the first audit (#6)
From the report
Evidence
const interval =
    // TODO: #334 Replace with idle callback strategy.
    setInterval(detectAndDispose, 1000);
Why it matters

the interval is cleared only when the wallet is detected. Every adapter constructed for a wallet the user does not have keeps a 1-second timer for the life of the page. The timers also accumulate if adapters are re-created.

Suggested fix, not tested

return a dispose function and stop after a bounded window, or back off after the load event.

16. Low Most adapters never refresh the cached public key when the account changes
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence
wallet.on('disconnect', this._disconnected);
this._wallet = wallet;
this._publicKey = publicKey;
Why it matters

only the Phantom and Solflare adapters listen for account changes. In the others, if the user switches account inside the wallet, the adapter keeps reporting the old address. The app may then build transactions for one address while the wallet signs with another.

Suggested fix, not tested

subscribe to the wallet's account-change event where one exists. Otherwise re-read and compare the key before signing.

18. Low Solflare leaves the account-change listener attached after an external disconnect
First rating: Low · Reviewed rating: Low · Review: confirmed · also in the first audit (#7)
From the report
Evidence
wallet.off('disconnect', this._disconnected);

this._wallet = null;
Why it matters

disconnect() removes both listeners (line 167), but the externally triggered _disconnected path removes only one. Each such disconnect then leaves a stale accountChanged handler attached.

Suggested fix, not tested

also call wallet.off('accountChanged', this._accountChanged) here.

20. Low Solflare sets its connecting flag too late
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence
this._connecting = true;
Why it matters

the flag is set only after the awaited SDK import (line 117). Two near-simultaneous connect() calls both pass the guard, create two SDK instances and open two approval prompts, and one instance is orphaned. Every other adapter sets the flag before its first await.

Suggested fix, not tested

set this._connecting = true before the dynamic import, or keep and return the in-flight connect promise.

21. Low A repeat connect call clears the in-flight guard of the first call
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence
if (this.connected || this.connecting) return;
...
} finally { this._connecting = false; }
Why it matters

the early return sits inside the try whose finally resets the flag. The sequence is:

  1. A first connect() is still pending.
  2. A second call made during that time returns early, and its finally sets _connecting back to false.
  3. A third call then passes the guard and starts a parallel connect, which registers the wallet listeners twice.

The same shape is in about 33 adapters. The React provider has its own guard, but code that uses the adapters directly does not.

Suggested fix, not tested

move the guard above the try, or store the in-flight promise and return it to repeat callers.

22. Low NuFi discards the send options, a drift between copied adapter code
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence
sendOptions.preflightCommitment = sendOptions.preflightCommitment || connection.commitment;
const { signature } = await wallet.signAndSendTransaction(transaction);
Why it matters

the options are computed and then never passed to the wallet, so callers' skipPreflight, maxRetries and preflightCommitment are silently ignored. This is a direct result of the send logic being copied into each adapter instead of shared: the copies drift.

Suggested fix, not tested

pass sendOptions to signAndSendTransaction. Move the shared send-preparation logic into the base adapter so each adapter keeps only its vendor-specific call.

23. Low Provider connect does not share the in-flight operation with repeat callers
First rating: Low · Reviewed rating: Low · Review: confirmed · also in the first audit (#13)
From the report
Evidence
if (isConnectingRef.current || isDisconnectingRef.current || wallet?.adapter.connected) return;
Why it matters

a second connect() resolves immediately while the first is still pending. Code that awaits it can continue as if the wallet were connected.

Suggested fix, not tested

keep a ref to the in-flight promise and return it to later callers.

24. Low Adapter lifecycle code is hand-copied into dozens of adapters
First rating: Low · Reviewed rating: Low · Review: confirmed · also in the first audit (#15)
From the report
Evidence
private _disconnected = () => {
    const wallet = this._wallet;
Why it matters

these pieces are repeated in 20–35 adapters:

  • the disconnect handler;
  • the readiness-detection block;
  • the wrapping of each sign call in a try/catch that emits an error event.

Every fix has to be applied to each copy, and findings 1, 3, 18 and 22 show the copies already differ.

Suggested fix, not tested

move the common pieces into the base adapter or a shared helper, and leave only the vendor-specific calls in each adapter.

25. Low The same Buffer polyfill is copied into four packages
First rating: Low · Reviewed rating: Low · Review: confirmed · also in the first audit (#17)
From the report
Evidence
if (typeof window !== 'undefined' && window.Buffer === undefined) {
    (window as any).Buffer = Buffer;
}
Why it matters

identical copies also live in the coin98, keystone and trezor packages, so any change has to be made four times.

Suggested fix, not tested

move the polyfill to one shared internal module and import it from all four.

27. Low Published stylesheet loads a font from a third-party host
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&display=swap');
Why it matters

every dApp that includes this stylesheet makes a request to a third-party font service and sends the visitor's IP address to it. The integrating app has no say in this.

Suggested fix, not tested

bundle the font files with same-origin @font-face rules, or drop the import and rely on the system-font fallback. Confirm afterwards in a browser request log that no request goes to the font host.

29. Low Window message handler accepts a disconnect command from any sender
First rating: Medium · Reviewed rating: Low · Review: rated too high · also in the first audit (#19)
From the report
Evidence
const data = event.data;
if (data && data.origin === 'mathwallet_internal' && data.type === 'lockStatusChanged' && !data.payload) {
    this._disconnected();
Why it matters

the handler checks only a field inside the message body, not who sent it. Any embedded frame, popup or third-party script on the page can post this message and force-disconnect the user's wallet session.

Suggested fix, not tested

act only when event.source === window and event.origin matches the expected origin. Do not treat a self-declared field in the payload as proof of the sender.

Info after review (7)

7. Info Sign-in example has no server nonce or expiry
First rating: Low · Reviewed rating: Info · Review: rated too high · also in the first audit (#3)
From the report
Evidence
const input: SolanaSignInInput = {
    domain: window.location.host,
Why it matters

the sign-in input is built and verified entirely in the browser, with no nonce, issue time or expiry. As a pattern copied into a real app, the signed proof could be replayed. The same pattern is in the auto sign-in in ContextProvider.tsx (lines 91–98).

Suggested fix, not tested

fetch a one-time nonce and expiry from the backend, include them in the input, and verify the output on the server. Label the client-only verification as a demo.

8. Info Message-signing login example uses a fixed, replayable text
First rating: Low · Reviewed rating: Info · Review: rated too high · new in this audit
From the report
Evidence
const message = new TextEncoder().encode(
Why it matters

the signed text contains only the host and the address. Any captured signature stays valid forever if the pattern is reused for login.

Suggested fix, not tested

include a server-issued nonce and an expiry in the signed text, and verify on the server.

9. Info No warning when the page is served from an insecure origin
First rating: Low · Reviewed rating: Info · Review: rated too high · also in the first audit (#4)
From the report
Evidence
if (window?.isPhantomInstalled && (window.phantom?.solana?.isPhantom || window.solana?.isPhantom)) {
Why it matters

browser wallets refuse to inject into plain-HTTP pages other than localhost. A search of the packages found no protocol or secure-context check, so the wallet simply never appears and the developer gets no hint why.

Suggested fix, not tested

when window.isSecureContext is false, log a clear warning or report the wallet as not ready with an explanatory message.

15. Info Wallet presence is detected by fixed one-second polling
First rating: Low · Reviewed rating: Info · Review: rated too high · also in the first audit (#6)
From the report
Evidence
scopePollingDetectionStrategy(() => {
    if (window?.isPhantomInstalled && (window.phantom?.solana?.isPhantom || window.solana?.isPhantom)) {
Why it matters

almost every legacy adapter polls instead of using a native signal. That costs work on every page and adds up to a second of detection latency.

Suggested fix, not tested

prefer the Wallet Standard registration event or the wallet's own initialisation event. Keep polling only as a bounded fallback.

17. Info Generic, unprefixed storage key for the selected wallet
First rating: Low · Reviewed rating: Info · Review: rated too high · also in the first audit (#11)
From the report
Evidence
localStorageKey = 'walletName',
Why it matters

a bare key like walletName can collide with other code on the same origin. Nothing checks that the stored value is of the expected kind, and no storage listener handles other tabs. The example app also uses the bare key autoConnect.

Suggested fix, not tested

use a prefixed default (for example solana-wallet-adapter:walletName), check on read that the value is a string, and decide explicitly how other tabs are handled.

19. Info UI timers are not cleared on unmount
First rating: Low · Reviewed rating: Info · Review: rated too high · new in this audit
From the report
Evidence
setTimeout(() => setCopied(false), 400);
Why it matters

the timeout can fire after the component unmounts and update state that no longer exists. WalletModal.tsx (lines 43 and 105) has the same pattern.

Suggested fix, not tested

keep the timeout id in a ref and clear it in an effect cleanup.

26. Info Missing-provider error helper is written twice
First rating: Low · Reviewed rating: Info · Review: rated too high · also in the first audit (#18)
From the report
Evidence
function constructMissingProviderErrorMessage(action: string, valueName: string) {
Why it matters

packages/core/react/src/useWallet.ts builds the same message separately, so the two can drift.

Suggested fix, not tested

use one helper that takes the provider name, shared by both.

Want this for your code?

Upload a ZIP or link a public GitHub repo, pick the areas and the depth, and get findings by severity with fixes.