Files
olivv-cs-ComfyUI-FunPack/app
digital-garbageandClaude Sonnet 5 691f17168b fix: settings card export -- bound render cost, stop a blob-URL leak
Round 1 of extensive_testing on 6d49625 found two real defects:

- Unbounded server-side render cost/memory from a client-supplied
  pipeline. render_png's image height grows with wrapped-line count,
  so one crafted long input value amplified a small request into a
  77,400px-tall, ~250MB render taking several seconds of single-
  threaded PIL draw calls -- reproduced directly. This route is
  unauthenticated, same as every sibling pipeline route, and reachable
  over a rental's plain-http IP -- a real DoS surface on the box
  actually doing GPU sampling. Fixed with two bounds: _short() now
  truncates any one value past 400 chars (a card is a compact summary,
  nobody reads a 200k-char row on it), and collect() caps the whole
  card at 2000 rows, both declared on the card itself via a "…N more
  omitted" note rather than silently dropped. Verified: the 200k-char
  reproduction case drops from 3.2s/250MB to 0.09s/22KB; a 200,000-slot
  pipeline renders bounded at ~1.7s/5MB with the truncation stated.

- Reopening "Export settings…" via the toolbar button (not the modal's
  own ✕/Close) leaked the previous render's blob URL -- close()'s
  revoke only runs on ITS OWN overlay, and the top-of-function DOM
  cleanup only removed old .sc-overlay nodes, never revoked their
  blobs. Carried over unfixed from v4's identical pattern. Fixed by
  stashing the blob URL on its own overlay element so the cleanup line
  can find and revoke it. Verified live: two clicks without ever
  hitting Close produces two distinct blob URLs and exactly one
  revokeObjectURL call, one overlay left in the DOM.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-15 21:41:39 +03:00
..