Skip to content

Review finding: v1.0.0 signer leaves SLH-DSA secret material on the released stack #260

Closed

Description

@djh58

Summary

The v1.0.0 vendored libbitcoinpqc leaves SK_SEED and WOTS/FORS secret state on the released stack after signing. The 1.x.x line has the stack scrub; v1.0.0/main does not.

Impact

A local process, core dump, swap image, or ptrace//proc/<pid>/mem read can recover the 64-byte SLH-DSA secret key.

Suggested fix

Bump the vendored library to the 1.x.x scrub release (or backport secure_zero_local and a volatile burn at the return of slh_dsa_sign/keygen/secret_key_validate) and add a secret-residue test.

Evidence

src/libbitcoinpqc/sphincsplus/ref/sign.c:146-255; hash_sha2.c:42-55; wotsx1.c:33-76. Stack probe hits SK_SEED at probe+65248; the newer vendor reports 0 hits.

Activity

  1. added a commit that references this issue on Oct 30, 2026
  2. kiwidream commented on Nov 4, 2026

    @kiwidream
    Member

    Fixed on 1.x.x by #268 (libbitcoinpqc v0.3.2 with the signer stack scrub, merged as e374ba2) and #270 (qbit-side stack clear after PQC secret-key operations, including DerivePQCKey, merged as 330b370). main and 1.1.0 still vendor v0.3.0. Moving those lines to the scrubbed release is tracked in #276.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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