thumbs: the image fetch has no private-host, scheme, body-size or converter-time limits, and no workflow has a job timeout
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 55/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- github-actions, javascript, node.js
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 58
- Forks
- 15
- Ø Merge
- 16 Std. 53 Min.
- Gemergte PRs (30 T.)
- 14
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus TMHSDigital/Free-Game-Dev-Assets
-
community marketing priority: low
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
TMHSDigital/Free-Game-Dev-Assets#151 ·
Maintainer antworten meist innerhalb von 1 Tag
-
documentation priority: medium
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
TMHSDigital/Free-Game-Dev-Assets#72 ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 68/100
TMHSDigital/Free-Game-Dev-Assets#3 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
marketing priority: low
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 55/100
TMHSDigital/Free-Game-Dev-Assets#152 ·
Maintainer antworten meist innerhalb von 1 Tag
-
feature priority: medium
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
TMHSDigital/Free-Game-Dev-Assets#144 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in TMHSDigital/Free-Game-Dev-Assets
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
awesome-dsh-plugin/awesome-dsh-plugin#9184 ·
Maintainer antworten meist innerhalb von 1 Tag
-
CloudredirectOffen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 70/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
Maintainer antworten meist innerhalb von 1 Tag
-
0.2.1-rc.3 compatibility: 21 peer ranges enumerate exact versions, so rc.3 is rejectedEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
NanmiCoder/dsh-agent-teams#277 ·
Maintainer antworten meist innerhalb von 1 Tag
-
[ordering-review] workshop order graph: 1 confirmed ordering problem, 3 cycles are false positivesOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
githubnext/gh-aw-workshop#4943 ·
Maintainer antworten meist innerhalb von 1 Tag