thumbs: the image fetch has no private-host, scheme, body-size or converter-time limits, and no workflow has a job timeout
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 55/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- github-actions, javascript, node.js
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- JavaScript
- Étoiles
- 58
- Forks
- 15
- Merge moyen
- 16 h 53 min
- PR mergées (30 j)
- 14
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de TMHSDigital/Free-Game-Dev-Assets
-
community marketing priority: low
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
TMHSDigital/Free-Game-Dev-Assets#151 ·
Les mainteneurs répondent en général sous 1 jour
-
community marketing priority: medium
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
TMHSDigital/Free-Game-Dev-Assets#150 ·
Les mainteneurs répondent en général sous 1 jour
-
community enhancement priority: medium
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
TMHSDigital/Free-Game-Dev-Assets#149 ·
Les mainteneurs répondent en général sous 1 jour
-
community documentation priority: medium
Difficulté 1/5 1-3 heures Accessibilité débutants 88/100
TMHSDigital/Free-Game-Dev-Assets#148 ·
Les mainteneurs répondent en général sous 1 jour
-
site: the Unreal guide is missing from the homepage Guides list, and the hero calls tools "assets"Ouvertebug marketing priority: medium
Difficulté 1/5 1-3 heures Accessibilité débutants 85/100
TMHSDigital/Free-Game-Dev-Assets#147 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de TMHSDigital/Free-Game-Dev-Assets
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
awesome-dsh-plugin/awesome-dsh-plugin#9184 ·
Les mainteneurs répondent en général sous 1 jour
-
CloudredirectOuverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 70/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
NanmiCoder/dsh-agent-teams#277 ·
Les mainteneurs répondent en général sous 1 jour
-
[ordering-review] workshop order graph: 1 confirmed ordering problem, 3 cycles are false positivesOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
githubnext/gh-aw-workshop#4943 ·
Les mainteneurs répondent en général sous 1 jour