Bug Description
The /api/ai/roast API route currently does not require an authenticated session or enforce any rate limiting. As a result, anyone can repeatedly send POST requests to this endpoint, causing unlimited invocations of the Gemini API and potentially consuming a large number of paid AI tokens.
The expected behavior is that only authenticated users should be able to access this endpoint, with appropriate per-user rate limits to prevent abuse.
Steps to Reproduce
- Start the application or use a deployed instance.
- Without logging in, send repeated POST requests to /api/ai/roast.
Example:
for i in {1..100000}; do
curl -X POST https:///api/ai/roast
-H "Content-Type: application/json"
-d '{"mode":"roast","stats":{"commits":1,"languages":["ts"]}}'
done
3. Observe that every request succeeds and triggers a new Gemini API call without requiring authentication or applying any rate limit.
Affected Area
Authentication / Sign-in
Screenshots
No response
Browser & OS
No response
Environment
Local Development
Additional Context
No response
Bug Description
The /api/ai/roast API route currently does not require an authenticated session or enforce any rate limiting. As a result, anyone can repeatedly send POST requests to this endpoint, causing unlimited invocations of the Gemini API and potentially consuming a large number of paid AI tokens.
The expected behavior is that only authenticated users should be able to access this endpoint, with appropriate per-user rate limits to prevent abuse.
Steps to Reproduce
Example:
for i in {1..100000}; do
curl -X POST https:///api/ai/roast
-H "Content-Type: application/json"
-d '{"mode":"roast","stats":{"commits":1,"languages":["ts"]}}'
done
3. Observe that every request succeeds and triggers a new Gemini API call without requiring authentication or applying any rate limit.
Affected Area
Authentication / Sign-in
Screenshots
No response
Browser & OS
No response
Environment
Local Development
Additional Context
No response