[BUG] Weekly AI summary quota race and unbounded request body

オープン
#4,053 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@IshantXM がすでに取り組んでいます。

2026年12月3日 から。

  • #4055 @IshantXM による — オープン

評価

難易度
4/5
見積もり時間
1〜2日
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
next.js, supabase, typescript
領域
api, backend, security

調査の方向性

Start at the /api/ai/weekly-summary route and trace how it checks the 24-hour limit, parses JSON, generates the summary, and persists the timestamp. The report identifies a race and missing body-size limit; a linked open pull request (#4055) is already addressing the issue.

索引モデルが issue の本文から書いたものです。

説明

What happened?

Code review found two defects in the weekly AI summary API. First, its 24-hour limit was checked separately from model generation and persistence, allowing simultaneous requests for one user to trigger duplicate paid provider calls. Second, the route parsed request JSON without a body-size limit, so oversized inputs could consume excessive memory before validation.

Expected behavior is to atomically claim a user's generation window and bound request parsing before quota or provider work. These defects were identified in source review; they were not reproduced against the live deployment.

Steps to reproduce
  1. On a revision before the fix, send concurrent authenticated POST requests to /api/ai/weekly-summary for the same user; each can pass the timestamp read before any request writes it.
  2. Send a valid JSON request body larger than 8 KiB; the route parses it without an input cap.
  3. Observe concurrent model calls or unbounded body parsing.
Where is it?

API

Where did you see it?

Local development (code review; not reproduced against the live deployment)

Want to fix it?
  • I'd like to work on this. A maintainer will assign you; please don't start before that.
主要言語
TypeScript
スター
246
フォーク
436
平均マージ
9時間 33分
マージ済み PR(30日)
213

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Priyanshu-byte-coder/devtrack のほかの issue

Priyanshu-byte-coder/devtrack の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。