Skip to content

Reject reserved Serde JSON keys in code mode - #52681

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/27ddce08e1ffe98ec9dffe02473a815ceae2cc89
Oct 9, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/27ddce08e1ffe98ec9dffe02473a815ceae2cc89

Conversation

@copyberry

@copyberry copyberry Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Reject reserved Serde JSON keys in code mode

Why

JavaScript objects containing Serde's reserved JSON keys can be reinterpreted during deserialization, allowing nested RawValue markers to bypass the parser's normal recursion limit.

What changed

Reject $serde_json::private::RawValue and $serde_json::private::Number object keys before passing V8's serialized JSON to serde_json. Report a reserved JSON object key serialization error while continuing to allow marker text in strings and longer keys.

Testing

Add runtime regression coverage for nested and escaped marker keys, recursion limits, normal JSON conversion, and session recovery without overwriting stored values. Extend the host-backed integration test to verify that stored values remain available across turns after rejection.

## Why

JavaScript objects containing Serde's reserved JSON keys can be reinterpreted during deserialization, allowing nested `RawValue` markers to bypass the parser's normal recursion limit.

## What changed

Reject `$serde_json::private::RawValue` and `$serde_json::private::Number` object keys before passing V8's serialized JSON to `serde_json`. Report a `reserved JSON object key` serialization error while continuing to allow marker text in strings and longer keys.

## Testing

Add runtime regression coverage for nested and escaped marker keys, recursion limits, normal JSON conversion, and session recovery without overwriting stored values. Extend the host-backed integration test to verify that stored values remain available across turns after rejection.

GitOrigin-RevId: 27ddce08e1ffe98ec9dffe02473a815ceae2cc89
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/27ddce08e1ffe98ec9dffe02473a815ceae2cc89 branch from a414ccf to 96be88c Compare October 9, 2026 19:46
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
πŸ“ Code Review πŸ”„ Running since 2026-10-09T19:46:47.869297Z a414ccf PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with πŸ‘€ while any review is running, comments if it has suggestions, and reacts with πŸ‘ once all reviews finish with no findings.

@copyberry
copyberry Bot merged commit 96be88c into main Oct 9, 2026
1 check passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/27ddce08e1ffe98ec9dffe02473a815ceae2cc89 branch October 9, 2026 19:46
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 9, 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.

1 participant