Skip to content

Key-utils leak secret keys #1958

@Fi3

Description

@Fi3

Secp256k1SecretKey in
https://github.com/stratum-mining/stratum/blob/dd64bf1c36ffd219cbc3a54846cde4e97361db6c/roles/stratum-apps/src/key_utils/mod.rs

can leak the inner secrets (Display impl, and Serialize and Deserialize). Key-utils should either be used only as a cli tool to derive keys or modified so that is safer, at least:

  1. do not derive copy and clone
  2. expose unsafe_inner_bytes(&self) or better unsafe_inner_bytes(self) but then we need to modify also the noise lib to own the secretes and not get a ref.
  3. do not implement Display or do in a way that not leak the secret
  4. zeroies the memory when drop (could still appear in stack traces btw)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions