Skip to content

[Feature][Both]: Bound loopback CDP JSON responses before parsing #280

Description

@rwang23

Target platform / 目标平台

Both / 双平台

Summary / 一句话概括

Bound loopback CDP JSON responses before parsing / 在解析前限制回环 CDP JSON 响应。

Problem / use case / 要解决的问题或场景

Both injectors fetch /json/list and /json/version with response.json().
Loopback avoids LAN exposure, but an unexpected local process can still return
a very large JSON response before the current identity checks run. This is a
local availability defense and does not claim to solve CDP authentication.

Proposed solution / 期望方案

Stream response bytes with a bounded maximum, reject redirects, cap target-array
length and string lengths, require strict JSON root shapes, and require the
controlled /json/version fields before accepting data. Share the parser and
fixtures across both platforms. Test declared and streamed over-limit responses
before JSON parsing.

Alternatives considered / 考虑过的替代方案

Relying on the existing fetch timeout limits time but not memory consumption.
Keeping two independent parser implementations would repeat the same boundary.

Priority / 对你有多重要

Would use often / 会经常用

Scope check / 范围确认

  • This is about Dream Skin loopback-CDP hardening, not API keys or model relays.
  • This does not ask to modify official Codex binaries or app.asar.

Extra context / 补充

Related closed issue #18 documents the unauthenticated-loopback risk. This is
a narrow parsing-boundary follow-up, not a replacement for that discussion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requeststatus: consideringMaintainer likes the idea, evaluating for a future merge

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions