Severity: HIGH
Description
checkBalance() in api-guard.ts:245-269 returns true (allow) when the database query fails, meaning all billable requests go through for free if the DB is unavailable.
Location
src/lib/api-guard.ts:245-269
Remediation
In production, fail-closed: return false or respond with 503 when balance cannot be checked.
Severity: HIGH
Description
checkBalance()inapi-guard.ts:245-269returnstrue(allow) when the database query fails, meaning all billable requests go through for free if the DB is unavailable.Location
src/lib/api-guard.ts:245-269Remediation
In production, fail-closed: return
falseor respond with 503 when balance cannot be checked.