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

Harden API key storage

Public commit record

What the developer wrote

Authored by Nicolas Dorier

28/100 · Opaque
Harden API key storage
✓ Subject identifies a change! No meaningful explanatory body! Opaque security-relevant change
The short version

What changed, and why it matters

This commit changes how BTCPay Server stores and handles API keys. Previously, the secret API key itself was used as the database primary key and was stored in plaintext. After this change, the database stores a one-way hash of the secret, a short prefix for display, and a separate non-secret ID for management. The actual secret is only kept briefly in memory after creation and is then erased. The commit also removes an old BitPay-compatible 'legacy API key' feature that used Basic authentication with a plaintext key. These are defensive security improvements that reduce the damage if the database is stolen, but they do not by themselves fix an active vulnerability in running code.

Recommended action

Treat this as a positive hardening patch. Review the migration in production-like environments to ensure existing API keys are correctly migrated and that integrations using the old BitPay Basic-auth legacy API keys are replaced with SIN/token or Greenfield API key authentication before upgrading. Verify the scheduled cleanup job is running so plaintext secrets are not retained indefinitely.

Security signals we found

01

Database now stores SHA-256 hash of API key secret instead of the secret itself

02

API key secret is cleared from database after creation via scheduled cleanup job

03

Public management ID (akid_*) is separated from the secret

04

Legacy BitPay Basic-auth API key support removed

05

Migration deletes legacy Type=0 API keys and rewrites remaining keys with hashes/IDs

06

Revocation endpoint parameter renamed from apikey to apiKeyId

Risk score

Why this scored 60/100

Our methodology →
Potential impact 18/30
Exploitability 8/25
Stealth signal 10/15
Affected reach 12/15
Confidence 8/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.