AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Moderate 59 Bitcoin

Update dependencies to include `zeroize` crate and refactor RSA-related code for improved error handling and memory management. Add tests for RSA key generation and validation, ensuring proper seed length checks and memory clearing after use.

Public commit record

What the developer wrote

Authored by ww3512687

60/100 · Adequate
Update dependencies to include `zeroize` crate and refactor RSA-related code for improved error handling and memory management. Add tests for RSA key generation and validation, ensuring proper seed length checks and memory clearing after use.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Mentions testing or verification! No meaningful explanatory body
The short version

What changed, and why it matters

This commit hardens how a hardware wallet (Keystone 3) handles sensitive RSA prime numbers used for Arweave transactions. It adds explicit length checks on seeds and prime inputs, switches to a safer memory-clearing helper (`zeroize` in Rust, `memset_s`/`CLEAR_ARRAY` in C), and removes an unused RSA helper that could have accepted arbitrary-length secrets. The changes reduce the risk of crashes, memory leaks of secret material, and misuse of malformed keys, but the commit itself is a defensive refactor rather than a fix for a confirmed active exploit.

Recommended action

Treat as a security-hardening commit. Review that all new `ASSERT` sites cannot be triggered by attacker-controlled input (e.g., `GetRsaAddress` and `GuiGetArweaveSignQrCodeData` `ASSERT(false)` paths). Verify that `CLEAR_ARRAY`/`memset_s` are not optimized away by the compiler. Confirm the removed `HasGeneratedRsaPrimes` behavior is no longer needed elsewhere. Continue fuzzing the new length checks and ensure the flash write-verify path handles wear-leveling/page boundaries correctly.

Security signals we found

01

Input validation added for RSA seed lengths (16/32/64 bytes) and prime lengths (256 bytes)

02

Sensitive intermediate buffers now cleared with `zeroize` (Rust) and `memset_s`/`CLEAR_ARRAY` (C)

03

Removed unused `RSA::from_secret` that parsed fixed offsets from arbitrary-length `secret` slices

04

C RSA flash read/write functions restructured for consistent cleanup and reduced secret material lifetime

05

Added flash write verification (`memcmp` after read-back)

06

Replaced silent fallback in `GetRsaAddress` with `ASSERT(false)` on invalid account index

07

Added null/length checks and buffer clearing in Arweave signing UI path

08

Removed `HasGeneratedRsaPrimes` which erased flash before reading

Risk score

Why this scored 59/100

Our methodology →
Potential impact 18/30
Exploitability 12/25
Stealth signal 8/15
Affected reach 10/15
Confidence 7/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.