Summary
KYC signed URLs fall back to a public constant if all preferred secrets are absent. Any attacker who knows the source can forge document tokens in a misconfigured deployment.
Repository evidence
lib/security/kyc-signed-urls.ts resolves JWT_SECRET, then AUTH_SESSION_SECRET, then KYC_DOCUMENT_ENCRYPTION_KEY, then the literal fallback-signing-key.
- The resulting HMAC authorizes
/api/kyc-documents/:id access.
Scope
- Require a dedicated document-token signing key with minimum entropy in production.
- Separate signing-key rotation from encryption keys and retain explicit verification key IDs.
- Fail startup/preflight instead of issuing tokens under a fallback.
Acceptance criteria
Tests
Non-goals
- Changing document encryption format.
Summary
KYC signed URLs fall back to a public constant if all preferred secrets are absent. Any attacker who knows the source can forge document tokens in a misconfigured deployment.
Repository evidence
lib/security/kyc-signed-urls.tsresolvesJWT_SECRET, thenAUTH_SESSION_SECRET, thenKYC_DOCUMENT_ENCRYPTION_KEY, then the literalfallback-signing-key./api/kyc-documents/:idaccess.Scope
Acceptance criteria
Tests
Non-goals