Harden client-warm cache writes against forged card and poster images
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- nextjs, typescript
調査の方向性
Start at app/api/cache-image/route.ts, then read components/WarmOnView.tsx to see how warm writes are triggered and lib/og/pngCache.ts for the cache key and expected card/poster dimensions. Check scripts/warm.mjs because it currently treats locally warmed handles as final, which affects how poisoned entries survive. Done means the route rejects unsigned/expired writes, invalid PNG bytes and wrong dimensions, enforces a documented write limit, and has tests covering unsigned, signed, bad bytes, wrong dimensions and the limit.
索引モデルが issue の本文から書いたものです。
説明
Summary
POST /api/cache-image stores client-supplied bytes in R2 under a cache key built from the query string. It does not authenticate the caller, verify that the bytes are a PNG, or rate-limit writes. A third party can seed a valid-looking handle or pair with arbitrary image bytes; the card and poster routes will serve those bytes until the entry is replaced or expires.
This is a cache-poisoning and storage-abuse path, not a cosmetic issue.
Evidence
app/api/cache-image/route.ts:10-37acceptskind,login,aandb; it checks only the login shape and a 200 KB to 4 MB size before writing toGITONE_PNGS.components/WarmOnView.tsx:51-55makes the same route reachable from any public profile page.lib/og/pngCache.ts:80-86serves the stored object directly asimage/png.scripts/warm.mjs:139-142treats a handle as warmed once it is in local state, so a poisoned object can survive later warmer runs.
Expected behavior
- A warm write must prove it came from the app. Use a short-lived HMAC over
kind, the exact key, and an expiry, generated by the page or server and checked by the route. - Reject bytes that are not a valid PNG. Reject dimensions that do not match the card or poster contract.
- Add a per-IP or global write budget and a structured log line for rejected writes.
- Keep reads public; only writes need the token.
Scope
app/api/cache-image/route.tscomponents/WarmOnView.tsxlib/og/pngCache.tsfor the expected dimensions / key helpers- tests for the route
Acceptance
- Unsigned or expired warm requests return 401/403.
- A correctly signed request still stores and serves the image.
- A file with a bad PNG header or wrong dimensions returns 400 and writes nothing.
- Repeated writes are bounded by a documented limit.
- Tests cover unsigned, signed, bad bytes, wrong dimensions and the limit.
- 主要言語
- TypeScript
- スター
- 7
- フォーク
- 0
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
LangerSword/gitone のほかの issue
-
bug help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
LangerSword/gitone#7 ·
-
accessibility bug help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
LangerSword/gitone#6 ·
-
bug help wanted
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
LangerSword/gitone#5 ·
-
bug help wanted
難易度 3/5 半日 初心者へのやさしさ 72/100
LangerSword/gitone#4 ·
-
Add a /health endpoint対応中かも @LangerSword が今日担当しました。 オープンgood first issue
難易度 1/5 1〜3時間 初心者へのやさしさ 45/100
LangerSword/gitone#2 · コメント 1 件 ·
LangerSword/gitone の issue をすべて見る
似ている issue
-
MCP tool results drop structuredContent when text is only a summary対応中かも @Pankaj-bit361 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
inblockio/siwx-oidc-matrix-server#101 ·
メンテナーはふだん 1 日以内に返信
-
status:needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
pingdotgg/t3code#42253 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信