Skip to content

Bound JSON control-frame sizes across daemon and app #140

Description

@richardcase

Problem

The daemon uses unbounded JSON-lines input and the Swift LineBuffer retains an unlimited partial line.

Evidence: https://github.com/richardcase/clowder/blob/b5492d5/crates/clowder-daemon/src/control_json.rs#L40-L56
Swift buffer: https://github.com/richardcase/clowder/blob/b5492d5/macos/Sources/ClowderCore/LineBuffer.swift#L7-L20

Impact

A peer that never sends a newline can grow process memory indefinitely.

Acceptance criteria

  • Define one protocol maximum for control lines.
  • Enforce it in both implementations and close/report oversized frames.
  • Add chunked over-limit tests.

Activity

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

    bugSomething isn't workingpriority: mediumImportant hardening or maintainability work

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions