The Export Private Key dialog held the exported spending key in a plain std::string cleared only with .clear() — never sodium_memzero'd — and on outside-click/Esc the overlay's early return skipped even that, so the secret lingered in freed heap. Hold it in a fixed char[256] and sodium_memzero on every close path (Close button, outside-click/Esc early return, address change). Guard the async export callback so it can't populate the buffer after the dialog closed. Standalone security fix ahead of the settings-modal redesign (Phase 0a); the dialog's full restyle is Phase 2. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
63 KiB
63 KiB