Skip to content

fix(claude): bound session registry reads and skip abnormal metadata #267

Closed

Description

@abruption

What happened

Priority: P2 reliability correction; candidate for v1.0.4.

Source review of published Python v1.0.3 found that Claude discovery and doctor read numeric JSON registry entries with unbounded Path.read_text() and then assume a JSON object. An abnormal local metadata entry can interrupt otherwise healthy discovery or make a filesystem read unbounded. Sender/reply discovery also calls the same discovery path.

This is a local metadata robustness finding, not a demonstrated remote vulnerability. This issue contains no live-agent reproduction or claim of a filesystem-wide timeout guarantee.

What you expected

Abnormal records should be skipped safely, healthy sessions should remain discoverable, and doctor should preserve useful permission diagnostics. Reads must have a defined byte budget and reject nonregular entries and non-object JSON before using record fields.

Fixed source evidence

The Python paths are unchanged on main 817d92a. TS is a reference for stronger local read boundaries, not a requirement to copy its implementation or JSON shape.

Acceptance criteria

  • Share a bounded reader between discovery and doctor. Define a byte limit (TS uses 1 MiB) with compatibility rationale.
  • Reject symlinks and nonregular entries; on POSIX, avoid blocking opens if an entry is replaced by a FIFO. Check opened descriptor kind/identity and bound reads even when files grow. Close descriptors on all paths; document platform limitations.
  • Reject malformed UTF-8/JSON and top-level null/arrays/scalars without traceback; retain healthy records and existing PID/start-time checks.
  • Add isolated list, doctor, dry-run and sender-discovery fixtures for abnormal records, oversized/growing files, replacement, descriptor cleanup, and mixed healthy/bad entries. Do not send messages or weaken permissions.
  • Preserve Python 3.9+ and Windows behavior; regenerate and verify standalone through the existing generator.

Scope and checked

Activity

  1. added this to the v1.0.4 milestone on Oct 7, 2026
  2. added
    bug
    on Oct 7, 2026
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions