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 / 范围确认
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.
Target platform / 目标平台
Both / 双平台
Summary / 一句话概括
Bound loopback CDP JSON responses before parsing / 在解析前限制回环 CDP JSON 响应。
Problem / use case / 要解决的问题或场景
Both injectors fetch
/json/listand/json/versionwithresponse.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/versionfields before accepting data. Share the parser andfixtures 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 / 范围确认
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.