Skip to content

Teach recorder: follow-ups from the whole-branch review #363

Open

Description

@cycle-five-duet

Follow-ups from the whole-branch review of the teach recorder (#361). None of these breaks a REQ-TCH row. They are listed so they are not lost.

Robustness against a busy or hostile page

  • The CDP event channel is unbounded. A page that produces events faster than the recorder reads them grows memory. Make it bounded, or rate-limit listener reports.
  • The listener reports script-dispatched events as if a person made them. Record isTrusted on each report and do not count untrusted events as the person's steps.
  • strip::touched is quadratic in the URL length when a one-character value was typed.
  • A request body over 64 MiB is over the CDP frame limit. The session then ends and the file says the window was closed. Record transport loss as its own ending, or cap post data with Network.enable's maxPostDataSize.
  • A popup or frame whose setup fails is silently not watched. That should become a note or a flag in the recording.
  • Browser::close waits for the child with no timeout, and the launch-failure path does not wait for the process group before it removes the profile.
  • search_pair and the pair's whole-word check rebuild the base64 of user:password on every call. The single-marker needles are built once; these are not. Small cost, since no digests are involved.
  • The snap check reads the first 4 KiB of a #! wrapper and skips it when the text mentions /snap/. A non-snap wrapper with that text in a comment is skipped too. The next candidate is tried, or the error says to pass --browser.

Classification

  • A mistyped password followed by a correct retry on a reloaded page reads as two different passwords, so the recording is unrecognized. Compare only the values in the last document that sent a password.
  • A typed value with outer whitespace that the site trims is not matched in kept text.
  • The listener's is_top and navigation's "first tab's main frame" disagree for a popup's top document.
  • Starting the recording only on the first tab means a link opened in a new tab never starts it. Start on the first page that leaves the notice.

Hardening

  • kharon-teach show on a file that does not parse prints serde's error line, which can carry bytes from the file, including terminal escape sequences. Print a fixed message. The summary itself already replaces control characters.
  • The DevTools port on 127.0.0.1 is reachable by any local process while a recording runs. --remote-debugging-pipe would remove the port.
  • URL and attribute strings held during capture are plain String, not zeroized.

Tests

  • Classifier: a Document request that is not a main-frame navigation; a submitting click keeps milliseconds; a child-frame navigation is not two-step; the earliest of two plain-hit requests picks the leg; needs_person wins over an earlier agent_continues.
  • A hello with the wrong nonce is ignored (no test today).
  • Cleanup tests should assert that no browser process is left, everywhere they assert the profile is gone.
  • The real-binary tests can leak a headless browser when an assertion fails midway (Live::drop kills only the recorder).

To check on real systems

  • Ubuntu's default Chromium is a snap. The recorder now skips it, on the reasoning that a snap cannot see a profile in /tmp. That reasoning has not been checked on an Ubuntu machine.

Filed by Duet (kharon session). Refs #361.

Activity

  1. added
    follow-upValid but deferred until after successful live test + v0.1.0
    parkedParked per the Lothrop Muses protocol: filed, not started without Lothrop's go
    on Nov 18, 2026
  2. cycle-five-duet commented on Nov 19, 2026

    @cycle-five-duet
    ContributorAuthor

    Muse's seven Important items from her review of #364 (#364 (review)), filed here as she allowed. Line numbers are at ab5a1d4.

    1. Earliest-leg rule (kharon-recording/src/classify.rs:172-186): an earliest plain-password carrier that is a non-main-frame Document (a same-origin iframe form post, target=<iframe>) or an Other request makes the whole login unrecognized, even when a later clean leg exists. The design defines unrecognized as "none of the above".
    2. body_unavailable is checked before the digest search (classify.rs:188-197 vs :199-204): a confident digest hit plus any unrelated unavailable body classifies unrecognized, against the "password found nowhere and body_unavailable" definition.
    3. The transformed digest is unscoped (classify.rs:199-204): a digest hit anywhere (a breach-check call, say) names the transform while the real login goes encrypted. This is the one classification that errs in the unsafe direction.
    4. username_only_request has no lower time bound (classify.rs:163-167): it never consults username_t, so the first navigation to a prefill link (/login?email=…, t=0) makes every such login two_step.
    5. Markers come only from each element's final value (capture/mod.rs:321, capture/resolve.rs:173): keystroke prefixes and in-page corrections never become markers, so a route that mirrors them (/u/<typo>, /search/<prefix>) keeps them. Mistypes separated by a reload are covered. If the in-page case is an accepted limit, REQ-TCH-002's "every value typed in the window" should say so.
    6. CDP remote error text reaches stderr (cdp.rs:38, :354), against the module's own "errors are built from fixed words and numbers only" (cdp.rs:5-6). No path builds one from a typed value today, since the getRequestPostData error is swallowed, but the documented invariant does not hold.
    7. The sweep's proof is a bare pid (browser.rs:233-270): the owner file can be forged (name shape plus a dead pid), so "it never removes a directory it did not make" claims more than the code delivers. The risk is low. A random token in the owner file, or softer wording, closes it.

    Items 2 to 4 of her Required list are fixed on #364 at 1cb3f7b (host labels, CSS unescape, cross_site wording); the REQ-TCH-003 row change is still to land.

    Duet (kharon session)


    Generated by Claude Code

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

    follow-upValid but deferred until after successful live test + v0.1.0parkedParked per the Lothrop Muses protocol: filed, not started without Lothrop's go

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions