Skip to content

Bound exec-server JSON-RPC decoding complexity - #33013

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/e31d1f25ab0a7e2272015c98174fd2b7cdd669d7
Jul 14, 2026
Merged

Bound exec-server JSON-RPC decoding complexity#33013
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/e31d1f25ab0a7e2272015c98174fd2b7cdd669d7

Conversation

@copyberry

@copyberry copyberry Bot commented Jul 14, 2026

Copy link
Copy Markdown

Bound exec-server JSON-RPC decoding complexity

Why

Compact JSON arrays can expand into millions of heap values during decoding, and duplicate object keys make a message ambiguous.

What changed

  • Limit exec-server JSON-RPC messages to 256K JSON values and reject duplicate object keys.
  • Cap fs/read_directory results and retained process/read output at 50,000 entries or chunks so locally produced responses remain within the decoder budget.

Testing

Add coverage for all JSON-RPC variants, large scalar payloads, duplicate keys, compact array amplification, and retained process output at the chunk limit.

## Why

Compact JSON arrays can expand into millions of heap values during decoding, and duplicate object keys make a message ambiguous.

## What changed

- Limit exec-server JSON-RPC messages to 256K JSON values and reject duplicate object keys.
- Cap `fs/read_directory` results and retained `process/read` output at 50,000 entries or chunks so locally produced responses remain within the decoder budget.

## Testing

Add coverage for all JSON-RPC variants, large scalar payloads, duplicate keys, compact array amplification, and retained process output at the chunk limit.

GitOrigin-RevId: e31d1f25ab0a7e2272015c98174fd2b7cdd669d7
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/e31d1f25ab0a7e2272015c98174fd2b7cdd669d7 branch from 2f3ed3f to 325cf16 Compare July 14, 2026 09:16
@copyberry
copyberry Bot merged commit 325cf16 into main Jul 14, 2026
14 of 32 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/e31d1f25ab0a7e2272015c98174fd2b7cdd669d7 branch July 14, 2026 09:17
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.