All audits

Trail of Bits Audit

Vault encryption (Argon2id) & recovery

November 2024 5d70be8 All issues fixed

A cryptographic review of the at-rest vault format, the Argon2id parameterisation and the recovery-phrase derivation, including offline brute-force resistance modelling.

Methodology

1 Formal review of the vault encryption specification
2 Cryptographic analysis of Argon2id parameterisation
3 Offline brute-force resistance modelling
4 Implementation review of recovery-phrase derivation
5 Static analysis of the cryptographic code paths

Findings & Fixes

High

Default Argon2id parameters below recommended threshold

The default Argon2id memory cost was set lower than the OWASP recommended minimum, reducing brute-force resistance on consumer hardware.

Fix applied

Raised default Argon2id parameters to m=64MB, t=3 iterations, p=4 parallelism, exceeding OWASP recommendations.

Medium

Recovery phrase entropy validation missing

The wallet did not validate that generated recovery phrases met the minimum entropy requirements before accepting them.

Fix applied

Added entropy validation step using a checksum-based verification before phrase acceptance.

Low

Vault header lacks version field

The encrypted vault format did not include a version field, complicating future format migrations.

Fix applied

Added a versioned header to the vault format with backward-compatible parsing for legacy vaults.

Low

Memory lock not enforced on all platforms

mlock/mlockall was not consistently applied across all supported platforms during key operations.

Fix applied

Implemented platform-specific memory locking with graceful fallback and clear user warning.

Info

No formal proof of key-derivation correctness

The BIP-39 derivation implementation lacked formal verification or property-based tests.

Fix applied

Added property-based tests (Hypothesis) covering all BIP-39 edge cases and test vectors.

Info

Backup file naming is predictable

Automatic backup files used predictable timestamps in filenames.

Fix applied

Added a random nonce to backup filenames while preserving sortability.

Info

Salt reuse across vault upgrades

The vault salt was preserved across passphrase changes instead of being regenerated.

Fix applied

Always generate a fresh salt when the passphrase or KDF parameters change.

Info

Missing documentation on threat model

The threat model was not clearly documented for users reviewing the security posture.

Fix applied

Published a formal threat model document covering all adversary types and mitigations.

Info

No anti-forensic wipe on vault deletion

Deleting the vault did not perform anti-forensic wiping of the underlying storage.

Fix applied

Added optional secure wipe with Gutmann method and clear user documentation on limitations.

Conclusion

One high finding on default KDF cost was resolved by raising Argon2id memory and iteration parameters.
Recovery derivation validated against the published specification.
Re-audit confirmed all remediations in the tagged release.