Sample audits · Open-source projects and documentation, eight more

trustwallet/wallet-core

Trust Wallet's cross-platform key and signing library.

Summary card for this audit: 135 findings after review, 0 High, 18 Medium, 110 Low, 7 Info
Auditedtrustwallet/wallet-core at commit d40d24a63d92619167903369308bf0e2f7eb3a59
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
18
Medium after review
110
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. 53 findings in the first audit; 53 still open (36 found again, 17 not reported again but still present). This audit has 135 findings after review, 97 of them new.

First auditFindingReviewed rating thenNowIn this audit
#1ed25519 hand-ported signingLowStill open#3
#2Cardano extended-key TODOLowStill opennot reported again
#3secp256k1 ECDH hand-writtenLowStill opennot reported again
#4Polkadot zero-hash fallbackLowStill opennot reported again
#5Polymesh zero-hash fallbackLowStill opennot reported again
#6Pactus id hides encode errorsLowStill opennot reported again
#7FFI sign returns empty sig on errorLowStill opennot reported again
#8AES-CBC PKCS7 unpad unvalidatedLowStill open#1
#9Keystore failures all "invalid password"LowStill opennot reported again
#10Missing PBKDF2 c defaultsLowStill open#4
#11Jetifier still enabledLowStill opennot reported again
#12Android sample old Kotlin pluginLowStill open#7
#13Decrypt ignores stored dklenLowStill open#92
#14Unknown keystore type read as private keyLowStill opennot reported again
#15C API decryptors skip key-kind checkLowStill opennot reported again
#16Encoded export falls back to mnemonicLowStill opennot reported again
#17Private-key derivation accepts xpubLowStill opennot reported again
#18addAccount drops new detailsLowStill opennot reported again
#19Filled address applied to copyLowStill open#22
#20Account uniqueness not enforced on loadLowStill open#21
#21CBOR decoder unbounded recursionLowStill open#31
#22CBOR quadratic validation / key renderingLowStill opennot reported again
#23CBOR count truncated in one walkerLowStill open#89
#24ABI array decoder no budgetMediumStill open#24
#25Pactus decoder allocates declared lengthMediumStill open#26
#26Base58 decode no length capLowStill opennot reported again
#27Waves amounts as bare JSON numbersLowStill opennot reported again
#28lcov .deb via HTTP, installed as rootMediumStill open#45
#29Build inputs no checksumLowStill open#53
#30CI sonar scanner no checksumLowStill open#55
#31emsdk moving branch, boost unverifiedLowStill open#54
#32CocoaPods spec no sha256LowStill open#58
#33Dev containers unverified binariesLowStill open#57
#34Release scripts succeed after failed publishLowStill open#50, #51
#35Codegen create_dir before skipLowStill open#47
#36Scaffold re-run duplicates entriesLowStill open#127
#37Mobile test skeleton overwrites filesLowStill open#46, #62
#38Template writer truncates by defaultLowStill open#63
#39Dependency cache setup driftedLowStill open#67
#40Duplicated publish stepsLowStill opennot reported again
#41NUL in ABI JSON aborts processLowStill open#73
#42AES-CBC encrypt, empty data + zero paddingLowStill open#78
#43Keystore account parsing UB on absent keysMediumStill open#77
#44Keystore file overwritten in placeLowStill open#81, #94
#45Android random source no error handlingLowStill open#91
#46Wallet id unsanitised in file pathLowStill open#93
#47Wallet delete ignores passwordInfoStill open#95
#48Wallet-id index lost updateLowStill open#14
#49scrypt p=0 / r=0 division by zeroMediumStill open#76
#50Failed public derivation returns parent keyLowStill open#79
#51BC sign-off gate passes on PR openLowStill open#128
#52BC sign-off accepted from any commenterLowStill open#129
#53new-blockchain script wrong pathLowStill open#133
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. 95 findings were first rated Medium or High; 18 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 (18)

8. Medium Swift KeyStore.watch() saves only the new batch and erases earlier watches on disk
First rating: Medium · Reviewed rating: Medium · Review: confirmed · new in this audit
From the report
Evidence

Evidence: self.watches.append(contentsOf: watches) then let data = try JSONEncoder().encode(watches)

Why it matters

the parameter shadows the property. Each call overwrites watches.json with only the new items, so earlier watches are lost at the next launch.

Suggested fix, not tested

encode self.watches and write the file atomically.

9. Medium Swift KeyStore rename or password change drops non-default-derivation accounts
First rating: Medium · Reviewed rating: Medium · Review: confirmed · new in this audit
From the report
Evidence

Evidence: importHDWalletWithEncryption(mnemonic: mnemonic, ..., coin: coins[0], ...) followed by getAccounts(password: newPassword, coins: coins)

Why it matters

the key is rebuilt from scratch and only default-derivation accounts are added back. Custom accounts and the key ID are lost silently.

Suggested fix, not tested

re-encrypt the existing payload in place, or carry every account field and the ID over to the new key.

15. Medium WASM keystore getKey ignores the account's derivation
First rating: Medium · Reviewed rating: Medium · Review: confirmed · new in this audit
From the report
Evidence

Evidence: let privateKey = storedKey.privateKey(coin, Buffer.from(password));

Why it matters

an account added with a non-default derivation gets the default derivation's private key, which does not match its address.

Suggested fix, not tested

add the derivation to the account type and pass it when deriving the key.

24. Medium Ethereum ABI decoder has no output budget, so small input can expand to gigabytes
First rating: High · Reviewed rating: Medium · Review: rated too high · also in the first audit (#24)
From the report
Evidence

Evidence: let tail = &data[tail_offset..]; ... for elem_idx in 0..len { let res = decode_param(kind, tail, new_offset)

Why it matters

array elements may all point at the same inner data. Calldata of about 1 MB for bytes[] or nested arrays can then expand to gigabytes, and the expansion grows exponentially with nesting. Contract-call decoding takes calldata supplied by a website, so a malicious site can crash the wallet.

Suggested fix, not tested

decode against a total budget for elements and bytes, tied to the input length. Reject offsets that point backwards or overlap.

25. Medium EIP-712 typed-data encoder recurses forever on a self-referencing type
First rating: High · Reviewed rating: Medium · Review: rated too high · new in this audit
From the report
Evidence

Evidence: let field_value = &data[&field.name]; ... let mut encoded = encode_data(custom_types, field_property, field_value)?;

Why it matters

a missing field reads as JSON null, so a type that refers to itself recurses without end. The stack overflows and the app aborts. The input is typed data supplied by a website through the sign-typed-data request.

Suggested fix, not tested

carry a depth counter (limit about 32), require object values, fail on missing fields and reject cyclic type graphs.

26. Medium Pactus decoder allocates from an untrusted length prefix
First rating: Medium · Reviewed rating: Medium · Review: confirmed · also in the first audit (#25)
From the report
Evidence

Evidence: let len = *VarInt::decode(r)?; let mut buf = vec![0; len as usize];

Why it matters

about ten bytes of input can request an allocation of up to 2^64 bytes. That aborts the process, for example through the transaction-hash utility.

Suggested fix, not tested

limit the length by the bytes remaining, or read through a bounded reader.

31. Medium CBOR decoder has no nesting-depth limit
First rating: Medium · Reviewed rating: Medium · Review: confirmed · also in the first audit (#21)
From the report
Evidence

Evidence: if (!nextElem.isValid()) { return false; } (recursive validity, length and dump walks)

Why it matters

deeply nested arrays or tags in WebAuthn or Cardano input cause unbounded recursion. A stack overflow is not caught by the surrounding try/catch.

Suggested fix, not tested

add a depth counter (32 to 64) to every recursive walk and fail when it is exceeded.

45. Medium Build dependency installed as root from plain HTTP with no integrity check
First rating: High · Reviewed rating: Medium · Review: rated too high · also in the first audit (#28)
From the report
Evidence

Evidence: wget -O "$LCOV_DEB" http://mirrors.kernel.org/ubuntu/pool/universe/l/lcov/lcov_1.15-1_all.deb then sudo apt-get install "$LCOV_DEB"

Why it matters

a network attacker can replace the package and run code as root on any developer machine or CI runner that bootstraps the build.

Suggested fix, not tested

download over HTTPS and verify a pinned SHA-256 before installing.

70. Medium Stellar token payment with a malformed issuer is signed as a native XLM payment
First rating: High · Reviewed rating: Medium · Review: rated too high · new in this audit
From the report
Evidence

Evidence: if (asset.issuer().length() > 0 && Address::isValid(asset.issuer()) && asset.alphanum4().length() > 0) { assetType = 1; (otherwise native)

Why it matters

if the issuer is invalid or the code is empty, the payment silently becomes a native XLM payment of the same amount. That is a different and possibly far more valuable transfer than the one requested. Codes longer than four characters are also truncated.

Suggested fix, not tested

if any asset field is set but invalid, return an invalid-parameters error. Reject codes that are too long.

76. Medium Key-file scrypt parameter check divides by zero for p=0 or r=0
First rating: Medium · Reviewed rating: Medium · Review: confirmed · also in the first audit (#49)
From the report
Evidence

Evidence: if ((r > std::numeric_limits<uint32_t>::max() / 128 / p) ||

Why it matters

a crafted key file reaches this check on import or load. Integer division by zero is undefined behaviour and traps on x86.

Suggested fix, not tested

reject p = 0 and r = 0 before dividing.

77. Medium Key-file account parser reads missing fields and a short derivation path out of bounds
First rating: Medium · Reviewed rating: Medium · Review: confirmed · also in the first audit (#43)
From the report
Evidence

Evidence: if (json[CodingKeys::derivationPath].is_object()) { ... coin = TWCoinType(uint32_t(derivationPath.indices[1].value));

Why it matters

a crafted account entry triggers undefined behaviour or an out-of-bounds read on import.

Suggested fix, not tested

check that each key is present and that there are at least two path indices, and throw otherwise.

80. Medium Mnemonic and passphrase are not normalised, and long passphrases are truncated
First rating: Medium · Reviewed rating: Medium · Review: confirmed · new in this audit
From the report
Evidence

Evidence: mnemonic_to_seed(mnemonic.c_str(), passphrase.c_str(), seed.data(), nullptr);

Why it matters

non-ASCII passphrases derive different seeds than other BIP-39 wallets, so a restore can appear to lose funds. Passphrases longer than 256 bytes are truncated, so different long passphrases can produce the same seed.

Suggested fix, not tested

normalise both to NFKD and reject passphrases longer than 256 bytes.

90. Medium JNI string conversion uses modified UTF-8, so non-BMP passphrases derive different seeds
First rating: Medium · Reviewed rating: Medium · Review: confirmed · new in this audit
From the report
Evidence

Evidence: const auto *chars = env->GetStringUTFChars(string, nullptr);

Why it matters

an emoji in a passphrase produces a different seed on Android than on iOS or WASM.

Suggested fix, not tested

convert from UTF-16 to standard UTF-8 and check for null.

97. Medium Asset-id parser crashes on a string made only of separators
First rating: Medium · Reviewed rating: Medium · Review: confirmed · new in this audit
From the report
Evidence

Evidence: let parts = string.split(separator: "_") ... parts[0].hasPrefix(prefix),

Why it matters

the input "_" crashes any caller, including Codable decoding of remote JSON.

Suggested fix, not tested

guard let first = parts.first, parts.count <= 2.

102. Medium Solana instruction insertion uses unchecked header arithmetic on external transactions
First rating: Medium · Reviewed rating: Medium · Review: confirmed · new in this audit
From the report
Evidence

Evidence: (self.message_header_mut().num_required_signatures - self.message_header_mut().num_readonly_signed_accounts) as usize - 1

Why it matters

an inconsistent header wraps around, and the later insert panics, which aborts the process.

Suggested fix, not tested

validate the header on decode and use checked arithmetic.

106. Medium Sending to a crafted Taproot address aborts the process
First rating: Medium · Reviewed rating: Medium · Review: confirmed · new in this audit
From the report
Evidence

Evidence: let internal_key = XOnlyPublicKey::from_slice(xonly.as_slice()).unwrap();

Why it matters

any valid v1 address whose program is not on the curve panics during signing.

Suggested fix, not tested

build OP_1 <32 bytes> directly, or return an error.

114. Medium Cardano token input selection sums the wrong amounts
First rating: Medium · Reviewed rating: Medium · Review: confirmed · new in this audit
From the report
Evidence

Evidence: [key]([[maybe_unused]] auto&& sum, auto&& si) { return si.tokenBundle.getAmount(key); } and selectedAmount += i.amount;

Why it matters

a token spread over several UTXOs causes a spurious low-balance error or too few inputs being selected.

Suggested fix, not tested

accumulate sum + token amount, and add token amounts in the loop.

115. Medium EOS account names map invalid characters to dots instead of failing
First rating: Medium · Reviewed rating: Medium · Review: confirmed · new in this audit
From the report
Evidence

Evidence: if (c >= '1' && c <= '5') return c - '1' + 1; return 0;

Why it matters

a recipient such as alice6 or Bob is serialised as a different account, possibly one that exists.

Suggested fix, not tested

throw on characters outside [a-z1-5.].

Low after review (110)

1. Low Hand-written PKCS7 unpadding accepts invalid padding
First rating: Medium · Reviewed rating: Low · Review: rated too high · also in the first audit (#8)
From the report
Evidence

Evidence: const byte paddingSize = result[result.size() - 1]; if (paddingSize <= result.size()) {

Why it matters

the code never checks that the padding byte is between 1 and 16, or that the padding bytes all match. A wrong key or corrupt ciphertext is returned as successfully decrypted garbage instead of an error.

Suggested fix, not tested

require 1 ≤ padding ≤ 16 and check that every padding byte equals it, in constant time, or else throw. Prefer an authenticated mode (AES-GCM, or encrypt-then-MAC).

2. Low Missing or empty EVM chain ID silently becomes 0
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: let chain_id = U256::from_big_endian_slice(&input.chain_id)

Why it matters

an absent chain ID is not treated as an error. A legacy transaction is then signed without replay protection and can be replayed on other EVM chains.

Suggested fix, not tested

reject an empty or zero chain ID for legacy and enveloped transactions. Apply the same check in the compiler path.

3. Low Ed25519 signing and verification assembled by hand from low-level primitives
First rating: Low · Reviewed rating: Low · Review: confirmed · also in the first audit (#1)
From the report
Evidence

Evidence: let r = Scalar::from_hash(h); ... let s = k * self.key + r;

Why it matters

custom signature code has to reproduce every check of a maintained implementation, and an earlier advisory about this routine is cited in its own comments.

Suggested fix, not tested

use a maintained Ed25519 API for the standard variants. Confine the custom routine to the non-standard variants and cover it with test vectors and fuzzing.

4. Low Missing PBKDF2 iteration count falls back to a default
First rating: Low · Reviewed rating: Low · Review: confirmed · also in the first audit (#10)
From the report
Evidence

Evidence: if (json.count(CodingKeys::iterations) != 0) { iterations = json[...]; }

Why it matters

a required key-derivation parameter that is missing is replaced by a default instead of being reported.

Suggested fix, not tested

treat a missing iteration count as an import error.

6. Low Absent Aptos gas fields override the safe defaults with 0
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: .with_gas_unit_price(input.gas_unit_price).with_max_gas_amount(input.max_gas_amount)

Why it matters

fields left unset arrive as 0 and replace the built-in defaults. The chain ID is also truncated with as u8.

Suggested fix, not tested

apply these values only when they are non-zero, and reject chain IDs above 255.

7. Low Android sample pairs an old Kotlin plugin with a newer Gradle, AGP and Java
First rating: Medium · Reviewed rating: Low · Review: rated too high · also in the first audit (#12)
From the report
Evidence

Evidence: ext.kotlin_version = '1.3.50' with com.android.tools.build:gradle:7.2.1 and JavaVersion.VERSION_17

Why it matters

Kotlin 1.3.50 predates Gradle 7 and JDK 17. The sample will most likely fail to build, with errors that look like project problems. It also uses the removed kotlin-android-extensions.

Suggested fix, not tested

raise the Kotlin plugin to a release that supports this Gradle and JDK, and replace synthetic view access with view binding.

10. Low Swift KeyStore rename or password change drops the encoded private key payload
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: } else if let key = StoredKey.importPrivateKeyWithEncryption(privateKey: privateKeyData, ...)

Why it matters

the encoded-key form is not re-imported, so hasPrivateKeyEncoded turns false after the update.

Suggested fix, not tested

when the wallet has an encoded key, re-import it through the encoded import path.

11. Low Swift KeyStore adds a wallet to memory before it is saved, with no rollback
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: wallets.append(wallet) then try save(wallet: wallet)

Why it matters

if the save fails, the caller gets an error but an unsaved wallet stays in the list.

Suggested fix, not tested

save first, then append. Alternatively, remove the entry when the save fails.

12. Low Swift KeyStore loads leftover temporary files as wallets
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: for url in accountURLs { if url.lastPathComponent == KeyStore.watchesFileName { continue } guard let key = StoredKey.load(path: url.path)

Why it matters

a crash between the temp-file write and the rename leaves a temp file. On the next launch it loads as a duplicate wallet with the same key ID.

Suggested fix, not tested

load only files with the key-file naming pattern, skip .tmp files, deduplicate by ID and clean up stale temp files.

13. Low Browser-extension keystore writes wallets under bare ids in a shared storage area
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: return this.storage.set({ [id]: wallet, [this.walletIdsKey]: ids,

Why it matters

wallet records share a namespace with the ID index and with anything else in the extension's storage. An imported wallet whose ID collides with another key overwrites that key.

Suggested fix, not tested

put every wallet key under an owner prefix, validate the ID format, and store and check a record kind.

14. Low Browser-extension wallet index is updated by unserialised read-modify-write
First rating: Medium · Reviewed rating: Low · Review: rated too high · also in the first audit (#48)
From the report
Evidence

Evidence: return this.getWalletIds().then((ids) => { if (ids.indexOf(id) === -1) { ids.push(id); }

Why it matters

two concurrent saves or deletes read the same list, and the later write drops the other wallet's ID. That wallet then disappears from loadAll(). In addition, delete() returns early for a wallet missing from the index and leaves its data behind.

Suggested fix, not tested

serialise index changes through one promise queue, and always remove the record on delete.

16. Low WASM keystore leaks native key objects whenever an operation fails
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: let hdWallet = storedKey.wallet(Buffer.from(password)); ... storedKey.delete(); hdWallet.delete();

Why it matters

a wrong password or other error skips the cleanup. Each failed call leaks WASM heap, including HD wallet objects that hold seed material.

Suggested fix, not tested

release native objects in try/finally in every keystore method.

17. Low Swift KeyStore watches list is publicly writable, bypassing persistence
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: public var watches = [Watch]()

Why it matters

callers can change the list without it being saved.

Suggested fix, not tested

make it public private(set).

18. Low Swift KeyStore destroy() and delete() leave memory and disk out of step
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: wallets.removeAll(keepingCapacity: false) ... try? fileManager.removeItem(at: url)

Why it matters

watches stay in memory after destroy(). Deletion errors are swallowed, and delete() removes the wallet from the list before removing its file.

Suggested fix, not tested

clear watches, surface deletion errors, and delete the file before the list entry.

19. Low Address repair skips any account whose address merely looks valid
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: if (!account.address.empty() && !account.publicKey.empty() && TW::validateAddress(account.coin, account.address)) { continue;

Why it matters

the skip test checks only the address format. It does not check that the address matches the public key and derivation, so a mismatched address is never repaired.

Suggested fix, not tested

skip only when re-deriving from the public key gives the stored address.

20. Low Stored account fields that must agree are never checked together
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: account.address = TW::deriveAddress(account.coin, pubKey, account.derivation);

Why it matters

the key comes from the derivation path, while the address format comes from the derivation enum. No write site checks that these agree.

Suggested fix, not tested

state the invariant, assert it on add, load and update, and add a verify step.

21. Low Unique-address rule is not enforced when a key file is loaded
First rating: Low · Reviewed rating: Low · Review: confirmed · also in the first audit (#20)
From the report
Evidence

Evidence: for (auto& accountJSON : json[CodingKeys::SK::activeAccounts]) { accounts.emplace_back(accountJSON);

Why it matters

duplicate accounts in an imported file are kept and saved again.

Suggested fix, not tested

clear the list before loading and apply the unique-address check.

22. Low Derived address is filled into a copy and never stored
First rating: Low · Reviewed rating: Low · Review: confirmed · also in the first audit (#19)
From the report
Evidence

Evidence: Account accountLval = account.value(); return fillAddressIfMissing(accountLval, wallet);

Why it matters

callers that read the stored list see an empty address, while callers of account() see a filled one.

Suggested fix, not tested

write the derived values back into the stored entry.

23. Low Derivation list is maintained by hand in several places and unknown names fall back to default
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: /// TODO generate like CoinType.

Why it matters

each new derivation must be patched into several copies. An unknown name in the registry is silently read as the default derivation.

Suggested fix, not tested

generate the enum from the registry, and make unknown names a parse error.

27. Low TON cell re-serialisation runs a quadratic reordering loop on caller data
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: let mut verify_order = true; while verify_order { verify_order = false;

Why it matters

a crafted bag of 4,096 cells forces about n passes of O(n) lookups, which is seconds of CPU time on a phone.

Suggested fix, not tested

use one linear topological sort.

28. Low Everscale cell parser has no depth limit and recurses over a chain of cells
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: if (index > cellCount || index <= i) { (only forward references required); recursive fillContext(*ref, ctx);

Why it matters

a long linear chain of cells in the account-state data overflows the stack, both while serialising and while freeing the cells.

Suggested fix, not tested

cap the cell count and depth (1,024), and make the serialiser and destructor iterative.

29. Low Tron raw JSON is kept whole and re-serialised with no nesting limit
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: auto parsed = nlohmann::json::parse(rawJson); ... output.set_json(parsed.dump());

Why it matters

the only limit is a 1 MB byte cap. A deeply nested document passes through a recursive parser and serialiser.

Suggested fix, not tested

parse with a depth limit, or build the output from the validated fields only.

30. Low Hedera address validation runs a regex over an unbounded string
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: if (std::regex_match(string, match, gEntityIDRegex)) {

Why it matters

the standard library's regex engine is recursive on some platforms. A long run of digits can exhaust the stack during address validation.

Suggested fix, not tested

reject strings longer than about 64 characters before matching, or parse the three parts by hand.

32. Low Imported key files can set unbounded or trivially weak key-derivation costs
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: iterations = json[CodingKeys::iterations];

Why it matters

a crafted key file can set PBKDF2 iterations to 0 or 4 billion, or scrypt costs that need gigabytes of memory. Decryption then hangs or runs out of memory, or a trivially weak setting goes unflagged.

Suggested fix, not tested

validate minimum and maximum iterations, key length and salt for PBKDF2, and practical bounds for scrypt's n, r and p.

33. Low Bit reader allocates the requested size before checking remaining data
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: let mut res = vec![0_u8; byte_count];

Why it matters

an oversized count would abort on allocation instead of returning an error. Current callers pass a constant size.

Suggested fix, not tested

check byte_count * 8 against the remaining bits with checked arithmetic before allocating.

34. Low Sui transaction indices are narrowed to 16 bits without a cap
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: .map(|j| Argument::NestedResult(split_primary, j as u16))

Why it matters

with 65,536 or more recipients, indices wrap and amounts are routed to earlier recipients.

Suggested fix, not tested

use u16::try_from and reject counts that are too large.

35. Low TON cell-bag header and cell fields are not fully validated
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: // TODO: Check crc32 ... let ref_num = d1 & 0b111;

Why it matters

up to 7 references per cell are accepted where 4 is the limit, and the size fields and checksum are not checked.

Suggested fix, not tested

enforce the protocol limits and verify the CRC when it is present.

36. Low Base32 alphabet cache grows without bound
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
Location: rust/tw_encoding/src/base32.rs:18 (line corrected on review; the report cites :44)
From the report
Evidence

Evidence: static ENCODINGS: RefCell<EncodingMap> = RefCell::new(HashMap::new());

Why it matters

every distinct alphabet string passed by a caller is cached permanently.

Suggested fix, not tested

cap the cache, or cache only the default alphabets.

37. Low ABI recursion-depth check runs only after the nested message is fully decoded
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: const MAX_RECURSION_DEPTH: usize = 20;

Why it matters

the recursive protobuf message is fully decoded, recursively, before the depth check runs.

Suggested fix, not tested

limit input size or depth at decode time, and keep the later check as a second layer.

38. Low TON cell debug printing and hashing are exponential over shared references
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: #[derive(PartialEq, Eq, Clone, Hash)] pub struct Cell { ... references: Vec<CellArc>,

Why it matters

on a graph where references are shared, printing or deriving a hash visits 2^depth nodes.

Suggested fix, not tested

compare and hash by the cell hash, and print a bounded summary.

39. Low Everscale cell parser reserves memory from the header count
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: intermediate.reserve(cellCount);

Why it matters

the reservation is sized from a 32-bit count in the header, not from the bytes actually present.

Suggested fix, not tested

reject counts larger than the remaining bytes allow, and bounds-check the skip at line 140.

40. Low Everscale cell depth wraps silently at 16 bits
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: depth = std::max(depth, static_cast<uint16_t>(ref->depth + 1));

Why it matters

very deep input produces a wrong hash with no error.

Suggested fix, not tested

reject depths above 1,024.

41. Low Bitcoin per-input signature hashing is quadratic in input count
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: auto hashPrevouts = getPrevoutHash(); (inside the per-input pre-image)

Why it matters

hashes shared by all inputs are recomputed for every input. A plan supplied by the caller has no input cap.

Suggested fix, not tested

compute the shared hashes once per transaction and cap the input count in the signer.

46. Low New-coin skeleton generator overwrites existing hand-written sources
First rating: Medium · Reviewed rating: Low · Review: rated too high · also in the first audit (#37)
From the report
Evidence

Evidence: path = File.join(folder, fileName) File.write(path, result)

Why it matters

running the documented example against an existing coin replaces its sources, proto and tests with templates. They can only be recovered from version control.

Suggested fix, not tested

skip or abort when the target exists, as the newer generator does.

47. Low Generator creates a directory before its existence check and aborts mid-run
First rating: Medium · Reviewed rating: Low · Review: rated too high · also in the first audit (#35)
From the report
Evidence

Evidence: fs::create_dir(coin_tests_dir)?; if tw_coin_type_tests_path.exists() {

Why it matters

the skip branch can never be reached. The run fails after earlier files have already been edited.

Suggested fix, not tested

use create_dir_all and run all checks before making any edits.

48. Low The two code generators place integration tests in different folders
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: integration_tests_directory().join("chains").join(coin.coin_type())

Why it matters

the newer generator ignores the registry's test-folder name, so the same coin gets tests in two places.

Suggested fix, not tested

honour testFolderName, and ideally retire one of the generators.

49. Low Protobuf versions are hard-coded in several places and have drifted
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: protobuf-3.20.3 (also in the podspec, xcconfig and dependency list); swift-protobuf is 1.18.0 in one file and 1.29.0 in another

Why it matters

the generator and the linked runtime must match, and the copies already disagree.

Suggested fix, not tested

make one file the single source and pass the version through to the build files.

50. Low Android release script swallows a failed publish and reports success
First rating: Medium · Reviewed rating: Low · Review: rated too high · also in the first audit (#34)
From the report
Evidence

Evidence: ./gradlew publishAllPublicationsToGitHubPackagesRepository ... || echo "Warning: GitHub Packages publishing failed"

Why it matters

a failed release prints "Android build uploaded".

Suggested fix, not tested

fail on a publish error and verify the published artifact.

51. Low Kotlin release script swallows a failed publish and reports success
First rating: Medium · Reviewed rating: Low · Review: rated too high · also in the first audit (#34)
From the report
Evidence

Evidence: ... publishAllPublicationsToGitHubPackagesRepository -Pversion="$version" || echo "Warning: ..."

Why it matters

same as finding 50 for the Kotlin package.

Suggested fix, not tested

same as finding 50.

53. Low Build-input archives downloaded without checksum
First rating: Low · Reviewed rating: Low · Review: confirmed · also in the first audit (#29)
From the report
Evidence

Evidence: curl -fSsOL https://github.com/protocolbuffers/protobuf/releases/download/... tar xzf ...

Suggested fix, not tested

record a SHA-256 for each archive and check it before extracting.

54. Low WASM toolchain installed from an unpinned branch and an unverified archive
First rating: Low · Reviewed rating: Low · Review: confirmed · also in the first audit (#31)
From the report
Evidence

Evidence: git clone https://github.com/emscripten-core/emsdk.git

Suggested fix, not tested

pin a tag or commit, and verify the boost archive.

55. Low Code-scanner binary that receives CI tokens is not verified
First rating: Low · Reviewed rating: Low · Review: confirmed · also in the first audit (#30)
From the report
Evidence

Evidence: curl -sSfL ".../sonar-scanner-cli/${TARGET}" --output "${TARGET}"

Suggested fix, not tested

pin and verify the scanner's SHA-256.

56. Low Go toolchain unpacked with sudo and no checksum in CI
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: curl -O -L ... "https://golang.org/dl/go${GO_VERSION}.linux-${GO_ARCH}.tar.gz"

Suggested fix, not tested

use a SHA-pinned setup action or verify the published checksum. Go 1.19 is also end of life.

57. Low Swift toolchain in the dev container is not verified
First rating: Low · Reviewed rating: Low · Review: confirmed · also in the first audit (#33)
From the report
Evidence

Evidence: curl -sSL ... swift-5.8-RELEASE-ubuntu22.04.tar.gz -o swift-5.8.tar.gz

Suggested fix, not tested

verify a checksum or signature, as the same file already does for rustup.

58. Low Generated CocoaPods spec has no archive checksum
First rating: Low · Reviewed rating: Low · Review: confirmed · also in the first audit (#32)
From the report
Evidence

Evidence: s.source = { http: '${download_url}' }

Suggested fix, not tested

add sha256: to the source, as the Swift package path already does.

59. Low Dockerfile linter binary downloaded and run without checksum
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: curl -L ... hadolint-Linux-x86_64 -o hadolint && chmod +x hadolint

Suggested fix, not tested

verify the checksum or use a SHA-pinned action, and add a permissions: block.

60. Low Documentation tool jars downloaded without checksum
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: curl -fSsOL $DOKKA_CLI_JAR

Suggested fix, not tested

pin a SHA-256 for each jar.

61. Low Release upload silently replaces an already published asset
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: gh release upload $tag $filename --clobber

Suggested fix, not tested

refuse to overwrite unless replacement is requested explicitly.

62. Low Skeleton generation force-overwrites the coin-type test file
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: coin_test_gen.generate_coin_test_file(coin, 'TWCoinTypeTests.cpp.erb', true)

Suggested fix, not tested

pass false so an existing, possibly hand-edited file is kept.

63. Low Shared template writer truncates its target
First rating: Low · Reviewed rating: Low · Review: confirmed · also in the first audit (#38)
From the report
Evidence

Evidence: let file_to_write = fs::File::create(write_to_path)?;

Suggested fix, not tested

open the file with create_new(true).

65. Low CI regenerates tracked files but never checks the committed copies match
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
Location: .github/workflows/linux-ci.yml:45 (line corrected on review; the report cites :43)
From the report
Evidence

Evidence: tools/generate-files native

Suggested fix, not tested

run git diff --exit-code after generation.

66. Low The same paths-ignore list is copied across five workflows
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: paths-ignore: (repeated in the iOS, Kotlin, Kotlin-sample and Rust workflows)

Suggested fix, not tested

generate the list from one source.

67. Low Dependency-cache steps are repeated in eight workflows with differing keys
First rating: Low · Reviewed rating: Low · Review: confirmed · also in the first audit (#39)
From the report
Evidence

Evidence: - name: Cache internal dependencies ... uses: actions/cache@...

Suggested fix, not tested

extract a composite action with one key formula.

68. Low Rust toolchain pin and cbindgen install have diverged across environments
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
Location: Dockerfile:61
From the report
Evidence

Evidence: RUN rustup default nightly-2025-12-11 RUN cargo install --force cbindgen --locked

Suggested fix, not tested

have both Dockerfiles call the shared install script.

69. Low The one workflow with write permissions does not pin its actions by commit
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence

Evidence: uses: actions/checkout@v4 ... uses: actions/github-script@v7

Suggested fix, not tested

pin by commit SHA, as the other workflows do.

71. Low Exported private-key validity check aborts the process for a short key on the Cardano curve
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: ed25519::cardano::ExtendedPrivateKey::try_from(&bytes[Self::EXTENDED_CARDANO_RANGE])

Why it matters

a 32-byte key passes the general length test, then is sliced to 192 bytes and panics. The build aborts on panic, so the exported validity function kills the host.

Suggested fix, not tested

check the exact length for the selected curve before slicing.

72. Low Exported hash and encode functions pass a possibly null pointer into a slice constructor
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: let input = std::slice::from_raw_parts(input, input_len);

Why it matters

the C++ wrappers pass vector.data(), which may be null for empty data. Building a slice from a null pointer is undefined behaviour even when the length is 0.

Suggested fix, not tested

use the existing helper that maps (null, 0) to an empty slice.

73. Low Building a returned string panics when caller data contains a NUL byte
First rating: Medium · Reviewed rating: Low · Review: rated too high · also in the first audit (#41)
From the report
Evidence

Evidence: TWString(CString::new(s).expect("CString::new(String) should never fail"))

Why it matters

a function name containing \u0000 in ABI JSON supplied by a caller reaches this conversion. The panic aborts the app.

Suggested fix, not tested

make the conversion fallible and return null at the boundary.

74. Low StarkEx private key is not wiped from memory on drop
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: pub struct PrivateKey { secret: FieldElement, } (no zeroizing on drop)

Why it matters

every other key type wipes its secret, so this one leaves key material in freed memory.

Suggested fix, not tested

implement zeroize-on-drop.

75. Low Schnorr private key decoded from hex into an unwiped buffer
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: let bytes = hex::decode(s).map_err(|_| KeyPairError::InvalidPublicKey)?;

Why it matters

the secret bytes stay in freed memory, and the error variant names the wrong key type.

Suggested fix, not tested

wrap the decoded bytes in Zeroizing and return InvalidSecretKey.

78. Low AES-CBC encryption of empty input with zero padding underflows its loop bound
First rating: Medium · Reviewed rating: Low · Review: rated too high · also in the first audit (#42)
From the report
Evidence

Evidence: for (idx = 0; idx < resultSize - blockSize; idx += blockSize) {

Why it matters

with an empty input resultSize is 0, so the bound wraps around. The loop then reads and writes through empty buffers, which can crash or corrupt the heap.

Suggested fix, not tested

handle inputs shorter than one block before the loop.

79. Low HD key derivation ignores the result of each derivation step
First rating: Medium · Reviewed rating: Low · Review: rated too high · also in the first audit (#50)
From the report
Evidence

Evidence: hdnode_private_ckd(&node, index.derivationIndex());

Why it matters

a step that is not allowed on the curve (non-hardened ed25519) fails silently, and the parent key is returned as the child.

Suggested fix, not tested

check each result and throw on failure. The same applies to lines 256, 271 and 288 to 323.

81. Low Key file is rewritten in place, so a crash mid-write destroys it
First rating: Medium · Reviewed rating: Low · Review: rated too high · also in the first audit (#44)
From the report
Evidence

Evidence: auto stream = std::ofstream(path);

Why it matters

the public store function truncates the only copy of the encrypted seed before writing it again.

Suggested fix, not tested

always write a temporary file, then flush and rename. Remove or deprecate the in-place variant.

82. Low Private key bytes are copied into unwiped temporaries on every signature
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: ecdsa_sign_digest_checked(&secp256k1, key().data(), ...

Why it matters

each sign or derive call leaves a heap copy of the key in memory.

Suggested fix, not tested

point into the stored bytes, or use a wiping container.

Review: ` returns a copy)

83. Low HD wallet helpers leave derived key material in unwiped buffers
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: const auto node2 = getNode(*this, curve, stakingPath); auto pkData2 = Data(node2.private_key, ...

Why it matters

the second node, the copied key buffers and the raw entropy are never wiped.

Suggested fix, not tested

wipe every local that holds key material, or use wiping types.

84. Low Decrypted mnemonic and key copies are freed without wiping in the C API
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: const auto data = key->impl.payload.decrypt(passwordData); const auto string = std::string(data.begin(), data.end());

Why it matters

plaintext secrets stay in freed memory, including on early error paths.

Suggested fix, not tested

wipe the intermediates on every path, as the core already does.

85. Low Blake2b personalised hash returns zeros as a success when its parameters are invalid
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: tc_blake2b_Personal(dataBytes, ..., resultBytes.data(), outlen);

Why it matters

an invalid output length or personalisation is returned as a valid all-zero hash.

Suggested fix, not tested

check the return value and return null on failure.

86. Low Bech32 address check compares the prefix only, accepting other networks and types
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: std::get<0>(dec).compare(0, hrp.length(), hrp) != 0

Why it matters

an expected prefix of cosmos accepts cosmosvaloper1…, and bc accepts bcrt1…. Bech32m strings are also accepted where Bech32 is required.

Suggested fix, not tested

compare the prefix for equality and enforce the checksum variant.

87. Low Public keys are not checked to be on the curve, and conversion errors escape the C API
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: return new TWPublicKey{ pk->impl.extended() };

Why it matters

an off-curve compressed key passes validation. Its later conversion throws through an extern "C" function and aborts the host.

Suggested fix, not tested

decode the point during validation, and catch exceptions in the C API.

88. Low C API signing and key functions let C++ exceptions escape
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: auto result = pk->impl.sign(d, curve);

Why it matters

a curve mismatch throws, and the process terminates.

Suggested fix, not tested

wrap these functions in try/catch and return null.

89. Low CBOR container counts are truncated to 32 bits
First rating: Medium · Reviewed rating: Low · Review: rated too high · also in the first audit (#23)
From the report
Evidence

Evidence: uint32_t count = ... (uint32_t)(typeDesc.value * countMultiplier);

Why it matters

other code uses the full 64-bit count, so different parts of the parser can read the same hostile input differently.

Suggested fix, not tested

use 64-bit counts, reject overflow, and reject counts larger than the remaining bytes.

91. Low JNI random source does not check for failures and can return an all-zero buffer
First rating: Medium · Reviewed rating: Low · Review: rated too high · also in the first audit (#45)
From the report
Evidence

Evidence: env->CallVoidMethod(random, nextBytes, array); jbyte* bytes = env->GetByteArrayElements(array, nullptr); memcpy(buf, bytes, len);

Why it matters

a failed JNI call leaves zeros that are then used as entropy for keys, IVs or salts.

Suggested fix, not tested

check every JNI call and pending exception, and terminate on failure, as the /dev/urandom path does.

92. Low Key-file encryption and decryption use different derived-key lengths
First rating: Medium · Reviewed rating: Low · Review: rated too high · also in the first audit (#13)
From the report
Evidence

Evidence: auto derivedKey = Data(scryptParams.desiredKeyLength); (decryption uses the fixed default)

Why it matters

re-encrypting with an imported key length that is too short reads out of bounds, and a length that is too long makes the key unrecoverable.

Suggested fix, not tested

validate the key length and use the same value in both directions.

93. Low File keystore builds paths from unvalidated wallet ids
First rating: Medium · Reviewed rating: Low · Review: rated too high · also in the first audit (#46)
From the report
Evidence

Evidence: return this.directory + id + ".json";

Why it matters

an ID taken from an imported wallet object can write, read or delete .json files outside the keystore directory.

Suggested fix, not tested

accept only strict ID patterns, and check that the resolved path stays inside the directory.

94. Low File keystore rewrites wallet files in place
First rating: Medium · Reviewed rating: Low · Review: rated too high · also in the first audit (#44)
From the report
Evidence

Evidence: return fs.writeFile(this.getFilename(id), JSON.stringify(wallet));

Why it matters

a crash can truncate the only copy of the encrypted key, and the file is created with default permissions.

Suggested fix, not tested

write a temporary file with mode 0600, then flush and rename.

96. Low Swift signJSON leaks the native string on every call
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: let jsonString = TWStringCreateWithNSString(json) ... defer { TWDataDelete(keyData) }

Suggested fix, not tested

add TWStringDelete(jsonString) to the defer block.

98. Low Swift KeyStore calls fatalError for a wallet not in its list
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: guard let index = wallets.firstIndex(of: wallet) else { fatalError("Missing wallet") }

Why it matters

a stale wallet object kills the host app.

Suggested fix, not tested

throw an error instead. The same applies at lines 331 and 363.

99. Low Kotlin JS signJson is an unimplemented public function
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: actual fun signJson(...): String = TODO()

Suggested fix, not tested

implement it, or throw a documented unsupported-operation error.

100. Low Flutter binding loads the native library from the current working directory
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: path.join(Directory.current.path, 'lib', 'libTrustWalletCore.so',

Why it matters

whoever controls the working directory can plant a library.

Suggested fix, not tested

resolve the library from the package or executable location.

101. Low Solana durable-nonce instruction is not first when a fee-token transfer is added
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: let mut builder = self.builder_with_token_transfer_to_fee_payer_if_applicable()?; builder.maybe_advance_nonce(...)

Why it matters

the nonce-advance instruction must come first. Otherwise the transaction is not treated as a durable-nonce transaction and is rejected or expires.

Suggested fix, not tested

add the nonce instruction first, in every builder that uses the sponsored fee transfer.

103. Low EVM address parsing accepts mixed-case addresses with a wrong checksum
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: let addr_hash = H160::from_str(addr_hex)...

Why it matters

a mistyped recipient is accepted without detection.

Suggested fix, not tested

verify the EIP-55 checksum when the address mixes upper and lower case.

104. Low EIP-155 message signature truncates v to one byte
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: v: v.low_u8(),

Why it matters

chain IDs above about 110 produce signatures that verifiers cannot recover.

Suggested fix, not tested

return an error when v does not fit in one byte.

105. Low personal_sign treats any hex-looking text as raw bytes
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: match hex::decode(&self.user_message) { Ok(raw_msg) => do_extend(&raw_msg),

Why it matters

text such as deadbeef is signed as bytes, so the user signs something other than what is displayed.

Suggested fix, not tested

decode as bytes only with an explicit 0x prefix, or add an explicit flag.

107. Low BRC-20 inscription builder unwraps a fallible ticker
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: let ticker = Brc20Ticker::new(ticker).unwrap();

Suggested fix, not tested

propagate the error with ?.

108. Low PSBT input amounts come from an unverified witness UTXO
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: if let Some(ref witness_utxo) = self.utxo_psbt.witness_utxo { self.build_witness_utxo(witness_utxo)

Why it matters

a PSBT supplied by a third party can misstate input amounts and hide an inflated fee.

Suggested fix, not tested

prefer or cross-check the full previous transaction, and bound the fee before signing.

109. Low KMP sample depends on the wallet library with a dynamic version
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: implementation("com.trustwallet:wallet-core-kotlin:+")

Suggested fix, not tested

pin an exact version.

110. Low A corrupt watches file blocks access to every wallet
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: let data = try Data(contentsOf: watchesFile) watches = try JSONDecoder().decode([Watch].self, from: data)

Why it matters

the error is thrown before any wallet is loaded, so init fails as a whole.

Suggested fix, not tested

load watches with a fallback, and write the file atomically.

111. Low Unknown coin types are dispatched to Bitcoin
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: default: return defaultsForMissing; (blockchain Bitcoin)

Why it matters

accounts for a coin this build does not know can have their saved addresses overwritten with Bitcoin-derived ones. The Rust registry returns an error for the same case.

Suggested fix, not tested

return an explicit unsupported result, and refuse such coins in dispatch.

112. Low XRP issued-currency exponent is truncated to 32 bits
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: -(reversed_exponent as i32)

Why it matters

1e4294967296 truncates to exponent 0, passes validation, and is signed as an amount of 1.

Suggested fix, not tested

use i32::try_from and reject out-of-range values.

113. Low Pay-to-public-key matcher truncates uncompressed keys
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: std::copy(std::begin(bytes) + 1, std::begin(bytes) + 1 + PublicKey::secp256k1Size, (in the 65-byte branch)

Why it matters

uncompressed P2PK outputs cannot be signed, because the wrong key is looked up.

Suggested fix, not tested

copy 65 bytes in that branch.

116. Low Legacy NEAR addresses are accepted without verifying their checksum
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: return Data(decoded.begin(), decoded.end() - legacyChecksumSize);

Suggested fix, not tested

recompute the checksum and compare it.

117. Low NEAR address from a public key copies an unchecked length into a 32-byte array
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: auto data = publicKey.compressed().bytes; std::copy(std::begin(data), std::end(data), std::begin(bytes));

Why it matters

a 33-byte or larger key passed through the C API writes past the array.

Suggested fix, not tested

require an ed25519 key of 32 bytes, and validate the key type against the coin during dispatch.

118. Low IOST account reads a short key past its end
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: activeKey = Data(activeKeyBytesPtr, activeKeyBytesPtr + PrivateKey::_size);

Suggested fix, not tested

require exactly 32 bytes (the same applies to the owner key).

119. Low Filecoin actor-ID varint decode overflows a signed int
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: auto k = byte & SCHAR_MAX; actorID |= k << (remainingPos * 7);

Why it matters

large IDs decode to a different actor.

Suggested fix, not tested

use uint64_t and reject encodings that are too long.

120. Low Signing dispatcher ignores a failed protobuf parse
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: input.ParseFromArray(dataIn.data(), (int)dataIn.size());

Why it matters

partially parsed input is signed.

Suggested fix, not tested

return an input-parse error when parsing fails, as the compiler template already does.

121. Low JSON signing paths ignore the JSON parse status
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: google::protobuf::util::JsonStringToMessage(json, &input);

Why it matters

malformed JSON is signed as a partly empty input. The same pattern appears in seven coins.

Suggested fix, not tested

check the returned status.

122. Low C API JSON signing has no exception boundary
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: auto result = TW::anySignJSON(coin, jsonString, keyData);

Why it matters

an exception from a coin's JSON signer terminates the app.

Suggested fix, not tested

wrap the call in try/catch and return an empty string.

123. Low C API address encoder lets an exception escape for a wrong-length value
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: EthAbi::ValueEncoder::encodeAddress(*reinterpret_cast<const Data*>(value), data);

Suggested fix, not tested

validate the size first, or catch the exception.

124. Low Bitcoin script builders check input lengths only with assert
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: assert(hash.size() == 20);

Why it matters

release builds produce malformed or unspendable scripts without any error.

Suggested fix, not tested

return an empty script, or throw and catch at the C layer.

125. Low Zilliqa signs an empty preimage when the recipient address is invalid
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: const auto preImage = Signer::getPreImage(input, address); const auto signature = key.signZilliqa(preImage);

Suggested fix, not tested

return an invalid-address error when the preimage is empty.

126. Low Nano signer swallows every exception and reports success
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: try { ... output = signer.build(); } catch (...) {} return output;

Suggested fix, not tested

set an error code and message in the catch block.

127. Low Code generators that edit tracked files are not idempotent
First rating: Medium · Reviewed rating: Low · Review: rated too high · also in the first audit (#36)
From the report
Evidence

Evidence: enum_region.push_line_before(format!(" TWCoinType{coin_type} = {coin_id_number},"));

Why it matters

a second run duplicates enum values and dispatcher cases, and the build fails.

Suggested fix, not tested

check whether the line is already present before inserting it.

128. Low Compatibility-risk review gate fails open
First rating: Medium · Reviewed rating: Low · Review: rated too high · also in the first audit (#51)
From the report
Evidence

Evidence: if (!hasReminder) { core.info('No BC-risk reminder posted; nothing to verify.'); return;

Why it matters

the verify job does not wait for the job that posts the reminder. Fork PRs cannot post it at all, so the gate passes without engaging on the keystore, proto and registry paths it is meant to guard.

Suggested fix, not tested

add needs: on the posting job, or compute the guarded-file list inside the verify job.

129. Low Review sign-off is accepted from any commenter
First rating: Medium · Reviewed rating: Low · Review: rated too high · also in the first audit (#52)
From the report
Evidence

Evidence: const signoff = comments.find(c => { const tokenMatch = c.body.match(tokenRegex);

Why it matters

any GitHub account can post the sign-off token. The docs/bc-footguns.md file that contributors are told to read does not exist in this tree.

Suggested fix, not tested

require an owner, member or collaborator who is not the PR author.

130. Low Background iOS Rust build failure is hidden by a bare wait
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: cargo build ... --target aarch64-apple-ios ... --release --lib & wait

Why it matters

a bare wait returns 0, so lipo packages whatever stale library is left over.

Suggested fix, not tested

wait on the job's PID and check its status.

131. Low CI workaround step never runs because its grep pattern is a bracket expression
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: if ! grep -qE '^[ \t]*[profile.dev]' Cargo.toml; then

Why it matters

the pattern matches unrelated lines, so the intended profile change never happens.

Suggested fix, not tested

use grep -qF '[profile.dev]'.

132. Low Lint-all scripts never fail and lint the generated code they mean to skip
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: find src ... -not -path "./src/proto/*" ... -exec clang-tidy -quiet -p=build '{}' \;

Why it matters

the exclusion path never matches find's output form, and -exec … \; discards the tool's exit status. The same applies to tools/lint-cppcheck-all.

Suggested fix, not tested

write the path as src/proto/* and use -exec … +.

133. Low New-blockchain script calls a path that does not exist after pushd
First rating: Medium · Reviewed rating: Low · Review: rated too high · also in the first audit (#53)
From the report
Evidence

Evidence: pushd codegen codegen/bin/newcoin-mobile-tests $1

Suggested fix, not tested

run the command from the repository root, and add set -e.

134. Low Workflow artifact lookup reads one page and treats no result as success
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
From the report
Evidence

Evidence: ARTIFACT_ID=$(gh api "repos/$GITHUB_REPOSITORY/actions/artifacts" --jq ...

Why it matters

the size comparison silently reports "no change" when no baseline is found.

Suggested fix, not tested

paginate or filter by name, and fail or report explicitly when no baseline exists.

135. Low Docker build context includes the whole working tree
First rating: Medium · Reviewed rating: Low · Review: rated too high · new in this audit
Location: Dockerfile:68
From the report
Evidence

Evidence: COPY . /wallet-core (.dockerignore lists only .gitignore)

Why it matters

local build outputs and any local configuration are baked into the image, and stale inputs can skip the clean downloads.

Suggested fix, not tested

exclude .git, build/, rust/target/, wasm-build/ and local environment files.

Info after review (7)

5. Info Solana token transfer accounts are not cross-checked against owner, mint and token program
First rating: Low · Reviewed rating: Info · Review: rated too high · new in this audit
From the report
Evidence

Evidence: TokenInstructionBuilder::transfer_checked(sender_token_address, token_mint_address, recipient_token_address, ...)

Why it matters

the caller-supplied token accounts are not checked against the associated token account derived from owner, mint and program. A swap between the classic token program and Token-2022 is only caught on chain.

Suggested fix, not tested

derive the associated token account and compare it with the supplied one before signing.

42. Info Cosmos transaction builder mixes many chain-specific clusters in one large file
First rating: Low · Reviewed rating: Info · Review: rated too high · new in this audit
From the report
Evidence

Evidence: an 825-line builder covering send, IBC, staking, wasm, terra, thorchain, stride, auth and gov

Why it matters

unrelated chain logic in one file makes changes and reviews riskier.

Suggested fix, not tested

split the chain-specific builders into separate modules.

43. Info Bitcoin input selection has a count cap but no time budget
First rating: Info · Reviewed rating: Info · Review: confirmed · new in this audit
From the report
Evidence

Evidence: auto slices = slice(sorted, static_cast<size_t>(numInputs)); Note: keep the count cap at every entry point, or use the single-pass selector for large sets.

44. Info Cardano fee formula constants are compiled in
First rating: Info · Reviewed rating: Info · Review: confirmed · new in this audit
Location: src/Cardano/Signer.cpp:22 (line corrected on review; the report cites :25)
From the report
Evidence

Evidence: static const auto PlaceholderFee = 170000; static const auto ExtraInputAmount = 500000; Note: if fee parameters should follow protocol updates, accept them through the signing input.

52. Info Committed Package.swift references an asset name the release script no longer produces
First rating: Medium · Reviewed rating: Info · Review: rated too high · new in this audit
From the report
Evidence

Evidence: .../4.2.9/SwiftProtobuf.xcframework.zip, while the release script uploads WalletCoreSwiftProtobuf.xcframework.zip

Why it matters

the released Swift package composition is never built or resolved in CI, and the manifest has already drifted from the release script.

Suggested fix, not tested

generate Package.swift from the release script, and add a CI job that resolves it in a consumer project.

64. Info Generated C headers are written into the public header folder without a marker check
First rating: Low · Reviewed rating: Info · Review: rated too high · new in this audit
From the report
Evidence

Evidence: let mut file = std::fs::File::create(&file_path)?;

Suggested fix, not tested

refuse to overwrite files that lack a generated-file marker.

95. Info Keystore delete ignores the password it is given
First rating: Medium · Reviewed rating: Info · Review: rated too high · also in the first audit (#47)
From the report
Evidence

Evidence: delete(id: string, password: string): Promise<void> { return this.storage.delete(id, password);

Why it matters

neither storage backend checks the password, so wallets can be deleted without authentication.

Suggested fix, not tested

verify the password before deleting, or remove the parameter.

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.