#0805
JWT HMAC signatures are only as strong as the secret used to sign them. Short or common secrets can be brute-forced offline in seconds.
Your secret validation function accepts any string — including empty strings and well-known weak values.
An attacker who captures a token can crack the secret and forge new tokens.
JWT secrets shorter than 256 bits (32 bytes) can be brute-forced with tools like hashcat in minutes. Known common secrets are tried first by every JWT cracking tool.
validateSecret('secret')// Returns {valid:true, length:6} — should throw!
validateSecret('a8f3k2m9p1q7r5s6t4u0v8w2x9y3z1b4')// Returns {valid:true, length:32}