Skip to content

fix(webhooks): bound signature verification work - #2475

Open
HAYDEN-OAI wants to merge 3 commits into
mainfrom
codex/webhook-signature-work-budget-20260825-2113-83d421a7
Open

fix(webhooks): bound signature verification work#2475
HAYDEN-OAI wants to merge 3 commits into
mainfrom
codex/webhook-signature-work-budget-20260825-2113-83d421a7

Conversation

@HAYDEN-OAI

Copy link
Copy Markdown
Contributor

Summary

  • Limit webhook signature candidates to 32 before importing a verification key or performing HMAC work.
  • Preserve existing typed failures, timestamp validation, rotated signatures, prefixed and bare formats, and both public webhook entrypoints.
  • Cover the exact acceptance boundary, malformed signatures, real HMACs, and existing short-signature mock compatibility.

Validation

  • Full handwritten suite: 149 files / 6,291 tests.
  • Full generated suite: 82 suites / 556 tests against an isolated local Steady server.
  • Focused public webhook tests: 46 passing.
  • Full lint, strict TypeScript, build, published TypeScript 4.9 and current compatibility, publint, packed CommonJS/ESM and 1,264 source maps.
  • Built CommonJS and ESM clients both reject over-budget signatures before verification and accept the final valid signature at the 32-candidate boundary.

@HAYDEN-OAI
HAYDEN-OAI requested a review from a team as a code owner August 25, 2026 21:14
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 25, 2026

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-25T22:00:22.970006Z 05ff3a5 New commits
🔒 Security Review Completed 2026-08-25T22:00:51.778023Z 05ff3a5 New commits
ℹ️ 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.

@openai-sdks

openai-sdks Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

OkTest Summary

237/237 SDK tests passed in 8.997s for Node SDK PR #2475.

Test results — 42 files
Test Result Time
tests/chat-completions-complex-body.test.ts ✅ Passed 148ms
tests/chat-completions-create.test.ts ✅ Passed 230ms
tests/chat-completions-stream.test.ts ✅ Passed 215ms
tests/files-content-binary.test.ts ✅ Passed 122ms
tests/files-create-multipart.test.ts ✅ Passed 121ms
tests/files-list-pagination.test.ts ✅ Passed 184ms
tests/initialize-config.test.ts ✅ Passed 97ms
tests/instance-isolation.test.ts ✅ Passed 101ms
tests/models-list.test.ts ✅ Passed 97ms
tests/responses-background-lifecycle.test.ts ✅ Passed 157ms
tests/responses-body-method-errors.test.ts ✅ Passed 296ms
tests/responses-cancel-timeout.test.ts ✅ Passed 202ms
tests/responses-cancel.test.ts ✅ Passed 193ms
tests/responses-compact-retries.test.ts ✅ Passed 260ms
tests/responses-compact.test.ts ✅ Passed 152ms
tests/responses-create-advanced-stream.test.ts ✅ Passed 94ms
tests/responses-create-advanced.test.ts ✅ Passed 129ms
tests/responses-create-disconnect.test.ts ✅ Passed 1.18s
tests/responses-create-errors.test.ts ✅ Passed 148ms
tests/responses-create-malformed-api-responses.test.ts ✅ Passed 110ms
tests/responses-create-retries.test.ts ✅ Passed 211ms
tests/responses-create-stream-failures.test.ts ✅ Passed 165ms
tests/responses-create-stream-timeout.test.ts ✅ Passed 2.14s
tests/responses-create-stream-wire.test.ts ✅ Passed 2.066s
tests/responses-create-stream.test.ts ✅ Passed 62ms
tests/responses-create-terminal-states.test.ts ✅ Passed 211ms
tests/responses-create-timeout.test.ts ✅ Passed 211ms
tests/responses-create.test.ts ✅ Passed 98ms
tests/responses-delete.test.ts ✅ Passed 115ms
tests/responses-input-items-errors.test.ts ✅ Passed 220ms
tests/responses-input-items-list.test.ts ✅ Passed 155ms
tests/responses-input-items-options.test.ts ✅ Passed 101ms
tests/responses-input-tokens-count-timeout.test.ts ✅ Passed 232ms
tests/responses-input-tokens-count.test.ts ✅ Passed 174ms
tests/responses-malformed-inputs.test.ts ✅ Passed 1.761s
tests/responses-not-found-errors.test.ts ✅ Passed 231ms
tests/responses-parse.test.ts ✅ Passed 158ms
tests/responses-retrieve-retries.test.ts ✅ Passed 193ms
tests/responses-retrieve.test.ts ✅ Passed 173ms
tests/responses-stored-method-errors.test.ts ✅ Passed 460ms
tests/retry-behavior.test.ts ✅ Passed 2.794s
tests/sdk-error-shape.test.ts ✅ Passed 197ms

View OkTest run #32903888960

SDK merge (5c53080d3199) · head (05ff3a5300b3) · base (9dd86484d9d5) · OkTest (2b1bdfd25e98)

@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Castiron custom code

✅ No new custom-code files detected.

32 mixed files remain; 1 existing customization changed.

Compared 9dd86484d9d505ff3a5300b3. Generated baselines verified.

File Result Current custom patch
src/resources/webhooks/webhooks.ts Existing customization changed +74 / −2
31 existing customizations unchanged
  • api.md
  • scripts/castiron/README.md
  • scripts/castiron/custom_code_report.py
  • scripts/castiron/test_custom_code_report.py
  • src/client.ts
  • src/resources/audio/transcriptions.ts
  • src/resources/audio/translations.ts
  • src/resources/beta/assistants.ts
  • src/resources/beta/beta.ts
  • src/resources/beta/index.ts
  • src/resources/beta/responses/internal-base.ts
  • src/resources/beta/responses/responses.ts
  • src/resources/beta/threads/index.ts
  • src/resources/beta/threads/runs/index.ts
  • src/resources/beta/threads/runs/runs.ts
  • src/resources/beta/threads/threads.ts
  • src/resources/chat/completions/completions.ts
  • src/resources/chat/completions/index.ts
  • src/resources/conversations/index.ts
  • src/resources/embeddings.ts
  • src/resources/files.ts
  • src/resources/fine-tuning/checkpoints/permissions.ts
  • src/resources/images.ts
  • src/resources/responses/internal-base.ts
  • src/resources/responses/responses.ts
  • src/resources/skills/skills.ts
  • src/resources/skills/versions/versions.ts
  • src/resources/vector-stores/file-batches.ts
  • src/resources/vector-stores/files.ts
  • src/resources/webhooks/index.ts
  • tests/lib/data-residency.test.ts

A changed generated baseline means this report cannot reliably identify which handwritten lines changed.

Inspect the custom-code diff

Download the exact patch produced by this run (requires repository access):

gh run download 32903923844 --repo openai/openai-node \
  --name castiron-custom-code-32903923844-1 --dir /tmp/castiron-custom-code-32903923844-1
git apply --stat /tmp/castiron-custom-code-32903923844-1/custom-code.patch
cat /tmp/castiron-custom-code-32903923844-1/custom-code.patch

Or reproduce it from an SDK checkout containing the vendored reporter:

git fetch --no-tags origin 9dd86484d9d5a2212ea8ec472fad6f76c747ba14 05ff3a5300b372032de7d97645b4accac10b6a1b
python3 scripts/castiron/custom_code_report.py report \
  --base 9dd86484d9d5a2212ea8ec472fad6f76c747ba14 \
  --head 05ff3a5300b372032de7d97645b4accac10b6a1b --fetch --require-head-hash --public \
  --out /tmp/castiron-custom-code-05ff3a5300b3
cat /tmp/castiron-custom-code-05ff3a5300b3/custom-code.patch

This is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR.

Full report and patch

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 83d421a70f

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/lib/webhook-signature.ts Outdated

@jbeckwith-oai jbeckwith-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.

Requesting changes for the existing P2 discussion at src/lib/webhook-signature.ts:40. The new undocumented 32-candidate limit rejects an entire otherwise valid webhook header before checking any signature, including a valid rotated signature in slot 33 or even slot 1 when additional candidates are present. The prior public verifier accepted a valid signature at any position, and no owner-approved protocol maximum is documented. Bound expensive HMAC work without rejecting previously valid rotation headers—for example, derive the expected HMAC once and safely compare candidates—or establish an explicit approved/documented compatibility limit and migration. Add a valid >32-candidate regression. Existing inline discussion already captures the issue.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 429c28088d

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/lib/webhook-signature.ts
Comment thread src/lib/webhook-signature.ts Outdated
Comment thread src/lib/webhook-signature.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants