Harden client-warm cache writes against forged card and poster images
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- nextjs, typescript
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 7
- Forks
- 0
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de LangerSword/gitone
-
bug help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
LangerSword/gitone#7 ·
-
accessibility bug help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
LangerSword/gitone#6 ·
-
bug help wanted
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
LangerSword/gitone#5 ·
-
bug help wanted
Dificultad 3/5 Medio día Aptitud para principiantes 72/100
LangerSword/gitone#4 ·
-
Add a /health endpointPosiblemente ocupada @LangerSword la tomó hoy. Abiertogood first issue
Dificultad 1/5 1-3 horas Aptitud para principiantes 45/100
LangerSword/gitone#2 · 1 comentario ·
Todos los issues de LangerSword/gitone
Issues similares
-
MCP tool results drop structuredContent when text is only a summaryPosiblemente ocupada @Pankaj-bit361 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
n8n-io/nod#1474 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Clean-up indicator: two polish points from the dev look (kit clock spacing, row description)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
inblockio/siwx-oidc-matrix-server#101 ·
Los mantenedores suelen responder en 1 día
-
status:needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
Los mantenedores suelen responder en 3 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
pingdotgg/t3code#42253 · 1 comentario ·
Los mantenedores suelen responder en 1 día