F-2026-0007·weak-cryptography

Static Salt for API Key Hashing

Fixedpentestbackendapigithub.com/bloom-art/api
TL;DR

Every partner API key was hashed with a hardcoded checked-in salt, so a database dump alone was sufficient to mount a parallel brute-force against every API key hash. Fixed by adding a server-side pepper from GCP Secret Manager.

Severity
LOW
Impact
MEDIUM
Likelihood
LOW
Method
MManual review
CAT.
Complexity
LOW
Exploitability
LOW
02Section · Description

Description

typescript
// api-key.service.ts L12
const apiKeyHashingSalt = "ipump"; // hardcoded, same for ALL keys
// api-key.service.ts L36-L38
public async getByKey(key: string): Promise<ApiKey> {
const hashedKey = this.hashingService.hash(key, apiKeyHashingSalt); // static salt used
return this.apiKeyRepository.findByHash(hashedKey.hash);
}
typescript
// hashing.service.ts L10-L18
public hash(input: string, salt: string | undefined): HashResult {
const iterations = 100000;
const keyLength = 64;
const digest = "sha512";
const saltLength = 32;
const saltOrRandomSalt = salt ?? randomBytes(saltLength).toString("hex");
// When salt is provided (always "ipump"), no random salt is generated
const hash = pbkdf2Sync(input, saltOrRandomSalt, iterations, keyLength, digest).toString("hex");
return { hash, salt: saltOrRandomSalt };
}

Frontend / on-chain mitigation analysis: Not applicable, purely backend cryptographic concern.

03Section · Impact

Impact

If the database is compromised, the attacker knows the salt for every API key hash, enabling parallel brute-force against all hashes simultaneously. High key entropy (64 hex chars) provides significant resistance, but the static salt weakens defense-in-depth.

04Section · Recommendation

Recommendation

Use the per-key salt already stored in the database.

05Section · Resolution

Resolution

Fixed in PR #3687, added a server-side pepper from GCP Secret Manager (HMAC-SHA256(PBKDF2(plainKey, salt), pepper)); a database dump alone no longer compromises the hashes.

Status
Fixed
F-2026-0007

oog
zealynx

Smart Contract Security Digest

Monthly exploit breakdowns, audit checklists, and DeFi security research — straight to your inbox

© 2026 Zealynx