TwitterApiIO webhooks accept requests when no signing secret is set.
keyBuilder does return res ?? '', and the verifier treats an empty secret plus a missing signature as valid:
if (!signature) {
if (!secret) return { valid: true };
}
Handlers still persist tweets after that. Same class of bug as GitLab's empty-secret fail-open.
Fix
- empty/missing secret should return
{ valid: false, error: '...' }
keyBuilder should throw (or otherwise fail) when webhook signature is missing, not return ''
Check
pnpm --filter @corsair-dev/twitterapiio test
TwitterApiIO webhooks accept requests when no signing secret is set.
keyBuilderdoesreturn res ?? '', and the verifier treats an empty secret plus a missing signature as valid:Handlers still persist tweets after that. Same class of bug as GitLab's empty-secret fail-open.
Fix
{ valid: false, error: '...' }keyBuildershould throw (or otherwise fail) when webhook signature is missing, not return''Check
pnpm --filter @corsair-dev/twitterapiio test