You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Three ways a user could run up paid Gemini calls beyond the 5/day cap, now fixed:
1. IP spoofing — getClientIp keyed off the client-controllable left-most
x-forwarded-for, so X-Forwarded-For:<random> minted a fresh 5/day each
request. Prefer platform-set x-real-ip; never trust the spoofable first hop.
2. No per-call input cap — one request could send a huge context map/question.
Reject >2000-char questions / >400 files / >120k signature chars with 413.
3. No global ceiling — per-IP limits can't stop a botnet cycling IPs. Add a hard
daily cap (GLOBAL_ASK_LIMIT=1000) across all users as a circuit breaker.
Adds vitest.config alias + 3 spoof-resistance tests (17 total).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments