richardcase / richardcase/clowder

Bound JSON control-frame sizes across daemon and app

Open
#140 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug priority: medium
Dominant language
Rust
Stars
0
Forks
0
Avg merge
1h 14m
Merged PRs (30d)
16

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with crates/clowder-daemon/src/control_json.rs and macos/Sources/ClowderCore/LineBuffer.swift, following the linked sections that parse and retain control lines. Trace how oversized frames are currently handled in each implementation, then add chunked over-limit tests for both sides. Done means one shared protocol maximum is enforced, with oversized frames reported or closed without unbounded buffering.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, swift
Domain
cli, desktop, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.