Skip to content

viewer: phase list, load events, element tree and the parameter cache grow with the file uncapped #1887

Closed

Description

@DrunkOnJava

Batch 5's audit of the viewer (main at e57db42): four workers read all of viewer/src/main.ts, the workers and index.html for DOM injection and for anything that could send file data off the machine. No injection and no network path for file data was found. Every file-chosen string is written with textContent or a text-only attribute; the only innerHTML writes assign an empty string; the two fetch calls run on build-time assets before a file is opened. Each finding below was confirmed by a second reader; all are memory or DOM growth a large or crafted file controls.

  1. One <option> per phase id, with no cap (main.ts:1160-1170, from rvt-wasm/src/lib.rs:306 and native_phases.rs:444-456).
  2. loadEvents grows by one object per decoder progress report, with no cap or throttle, and is serialised into a DOM attribute on every push (main.ts:690, :708, :1363).
  3. The element tree builds every row and child subtree up front, with no cap (main.ts:1938-1947, :2290-2298).
  4. The saved-parameter cache is capped at 64 entries but not in bytes (main.ts:2781-2788), and the cap itself comes from the page's query string with no upper bound (main.ts:2711-2714, wholeBytesParam at :1097-1102).

Fix direction: a byte budget for the cache, a cap or virtualisation for the tree and the phase list, and a ring buffer for loadEvents. No export moves.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:viewerpriority:P3type:bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions