Skip to content

perf: verify webhook signatures in chunks - #4324

Open
marcuswood-oai wants to merge 1 commit into
mainfrom
codex/incremental-webhook-verification
Open

marcuswood-oai wants to merge 1 commit into
mainfrom
codex/incremental-webhook-verification

Conversation

@marcuswood-oai

Copy link
Copy Markdown
Contributor

Changes being requested

Feed the webhook header prefix and body chunks into the same HMAC. Validate byte payloads with an incremental UTF-8 decoder. The signature format is unchanged and there is no new payload size limit. For malformed input, Unicode error offsets can be relative to the chunk.

Additional context & links

All 238 webhook tests passed, including sync and async cases with split UTF-8 characters, truncated input, and large text and byte payloads. Ruff and ty passed for the changed files. With a synthetic 4 MB ASCII byte payload, peak extra traced memory during verification dropped from 12 MB to 132 KB.

@marcuswood-oai
marcuswood-oai requested a review from a team as a code owner November 24, 2026 00:29
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T00:30:27.379660Z e68431a PR opened
🔒 Security Review ✅ Completed 2026-11-24T00:30:57.335754Z e68431a 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.

@markstuart-oai markstuart-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The chunked HMAC signs the same bytes and keeps strict UTF-8 validation. The new tests cover split characters and truncated input.

The memory test could run in a fresh process so an existing tracemalloc session cannot skew its result.

Static review only. Hosted checks were still running.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants