thumbs: the image fetch has no private-host, scheme, body-size or converter-time limits, and no workflow has a job timeout
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 55/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- github-actions, javascript, node.js
Direzione di ricerca
Start with site/lib/thumbs.mjs, site/checks.mjs, and the thumbs.yml and links.yml workflows. Trace image URL validation, redirects, body reading, and the ffmpeg call, then check how workflow jobs are declared. Done means the private-host, size-cap, converter-timeout, and workflow-timeout cases in the issue are handled; the issue does not name tests, so identify or add focused fixtures for those cases.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Why it matters
site/thumbs.mjs runs monthly on an Actions runner with contents: write and follows whatever a third-party page's og:image says. A broken or hostile publisher page can make it request internal addresses, buffer an unbounded body in memory, or leave ffmpeg running until the job's 6-hour default timeout. None of this reaches the deployed site (a bad image is still just a resized image), so this is hardening rather than a vulnerability, and each item is a small fix.
Evidence (at 69387df)
site/lib/thumbs.mjs:93-95accepts anyhttp:/https:host; anog:imagepointing at a loopback address is returned as a valid URL.validateguards entry URLs withisPrivateHost(site/checks.mjs:651, 671) butthumbs.mjsandcheckPreviewField(checks.mjs:787-792) do not reuse it.- Plain-http images are fetched and stored:
adventure-kid-irs,eric-skiff-resistor-anthems,synfiginsite/thumbs.json. site/thumbs.mjs:99-107reads the whole body (await res.arrayBuffer()) before comparing toMAX_IMAGE_BYTES;content-lengthis optional and unverified.site/thumbs.mjs:87-97callsexecFileSync("ffmpeg", ...)with notimeoutand nomaxBuffer.- No
timeout-minuteson any job in.github/workflows/*.yml.
Suggested approach
Move isPrivateHost into site/lib/ and apply it to the og:image URL, to preview: in checkPreviewField, and to the final res.url after redirects. Reject http: images or upgrade to https: and fall back only when the upgrade fails. Stream the body with a byte cap, aborting past MAX_IMAGE_BYTES. Pass { timeout: 30_000, killSignal: "SIGKILL" } to execFileSync, and sniff the first bytes for PNG/JPEG/GIF/WebP magic before invoking the converter. Add timeout-minutes: 30 to thumbs.yml and links.yml, and a smaller value to the others.
Done when
A fixture with a private og:image is reported as "skipped: private host"; a fetch that exceeds the cap aborts without buffering; a converter hang ends with "convert failed: timed out"; every workflow job has a timeout.
- Lingua principale
- JavaScript
- Stelle
- 58
- Fork
- 15
- Merge medio
- 16h 53m
- PR unite (30g)
- 14
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di TMHSDigital/Free-Game-Dev-Assets
-
community marketing priority: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
TMHSDigital/Free-Game-Dev-Assets#151 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation priority: medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
TMHSDigital/Free-Game-Dev-Assets#72 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 1/5 1-3 ore Idoneità per principianti 68/100
TMHSDigital/Free-Game-Dev-Assets#3 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
marketing priority: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 55/100
TMHSDigital/Free-Game-Dev-Assets#152 ·
I maintainer di solito rispondono entro 1 giorno
-
feature priority: medium
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
TMHSDigital/Free-Game-Dev-Assets#144 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di TMHSDigital/Free-Game-Dev-Assets
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Yomguithereal/mnemonist#247 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
up-for-grabs/up-for-grabs.net#6330 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 72/100
TheOdinProject/curriculum#31490 ·
I maintainer di solito rispondono entro 1 giorno
-
bug require-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
expressjs/expressjs.com#2549 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Docs: no path for someone who just wants to try IndiekitForse già presa @rmdes l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
getindiekit/indiekit#1028 ·
I maintainer di solito rispondono entro 1 giorno