Skip to content

fix(security): harden Bedrock regions, query merges, and upload errors - #2410

Merged
HAYDEN-OAI merged 6 commits into
mainfrom
dev/hayden/openai-node-security-helper-boundaries
Aug 19, 2026
Merged

HAYDEN-OAI merged 6 commits into
mainfrom
dev/hayden/openai-node-security-helper-boundaries

Conversation

@HAYDEN-OAI

Copy link
Copy Markdown
Contributor
  • I understand that this repository is auto-generated and my pull request may not be merged

Security fixes

  • csf_c50c4741497e479d067dfb67 (high): Reject injected explicit or ambient AWS regions before the legacy Bedrock client constructs an endpoint, resolves credentials, or sends bearer tokens. Preserve valid AWS/GovCloud/China regions and explicitly configured trusted endpoints.
  • csf_556664b9c7b5e1d4fafc60d2 (low): Reject __proto__, constructor, and prototype in public query merge/assignment helpers, including scalar and nested inputs, while preserving inherited protocols, target identity, and safe allowPrototypes behavior.
  • csf_31e56c953373a982082d6d15 (medium): Stop vector-store upload failures from bypassing configured logging through console.error; preserve ordered causes in a non-enumerable rejections property that remains private in JSON and normal Node error inspection.

Only three handwritten implementation files and four handwritten regression files are changed. Generated SDK code, release policies, dependencies, and lockfiles are untouched. Multipart filename remediation is intentionally left to existing #2386; newly merged #2409 streaming behavior is preserved. Existing Error identity and ES2020/browser compatibility remain intact; invalid AWS regions and unsafe query keys now fail closed.

Verification

  • Regression-first: 8 Bedrock, 5 query-prototype, and 3 upload-privacy cases failed before their fixes.
  • Full handwritten suite: 3,555 tests passed across 115 files.
  • Full generated suite: 559 tests passed across 82 suites.
  • Combined security/streaming compatibility matrix: 143 tests passed on Node 22.23.2 and pinned Node 24.19.0.
  • pnpm install --frozen-lockfile --ignore-scripts: all 796 dependency-policy entries validated.
  • pnpm lint; pnpm exec tsc --pretty false; pnpm build.
  • Published declarations/source type-check with TypeScript 4.9 and 6.0.
  • Packed CommonJS/ESM artifacts pass 267 applicable source checks and 1,216 source-map checks on Node 22 and 24.
  • Node version policy check passes; publint passes with its existing unrelated vendored CommonJS warning.

@HAYDEN-OAI
HAYDEN-OAI requested a review from a team as a code owner August 18, 2026 23:38
@openai-sdks

openai-sdks Bot commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

OkTest Summary

✅ 237/237 SDK tests passed in 10.345s for Node SDK PR #2410.

Test results — 42 files
Test Result Time
tests/chat-completions-complex-body.test.ts ✅ Passed 168ms
tests/chat-completions-create.test.ts ✅ Passed 245ms
tests/chat-completions-stream.test.ts ✅ Passed 212ms
tests/files-content-binary.test.ts ✅ Passed 170ms
tests/files-create-multipart.test.ts ✅ Passed 123ms
tests/files-list-pagination.test.ts ✅ Passed 146ms
tests/initialize-config.test.ts ✅ Passed 164ms
tests/instance-isolation.test.ts ✅ Passed 106ms
tests/models-list.test.ts ✅ Passed 143ms
tests/responses-background-lifecycle.test.ts ✅ Passed 220ms
tests/responses-body-method-errors.test.ts ✅ Passed 325ms
tests/responses-cancel-timeout.test.ts ✅ Passed 228ms
tests/responses-cancel.test.ts ✅ Passed 169ms
tests/responses-compact-retries.test.ts ✅ Passed 220ms
tests/responses-compact.test.ts ✅ Passed 248ms
tests/responses-create-advanced-stream.test.ts ✅ Passed 143ms
tests/responses-create-advanced.test.ts ✅ Passed 167ms
tests/responses-create-disconnect.test.ts ✅ Passed 1.142s
tests/responses-create-errors.test.ts ✅ Passed 281ms
tests/responses-create-malformed-api-responses.test.ts ✅ Passed 134ms
tests/responses-create-retries.test.ts ✅ Passed 277ms
tests/responses-create-stream-failures.test.ts ✅ Passed 192ms
tests/responses-create-stream-timeout.test.ts ✅ Passed 2.176s
tests/responses-create-stream-wire.test.ts ✅ Passed 2.449s
tests/responses-create-stream.test.ts ✅ Passed 93ms
tests/responses-create-terminal-states.test.ts ✅ Passed 264ms
tests/responses-create-timeout.test.ts ✅ Passed 218ms
tests/responses-create.test.ts ✅ Passed 209ms
tests/responses-delete.test.ts ✅ Passed 199ms
tests/responses-input-items-errors.test.ts ✅ Passed 233ms
tests/responses-input-items-list.test.ts ✅ Passed 172ms
tests/responses-input-items-options.test.ts ✅ Passed 99ms
tests/responses-input-tokens-count-timeout.test.ts ✅ Passed 221ms
tests/responses-input-tokens-count.test.ts ✅ Passed 225ms
tests/responses-malformed-inputs.test.ts ✅ Passed 2.172s
tests/responses-not-found-errors.test.ts ✅ Passed 257ms
tests/responses-parse.test.ts ✅ Passed 168ms
tests/responses-retrieve-retries.test.ts ✅ Passed 292ms
tests/responses-retrieve.test.ts ✅ Passed 218ms
tests/responses-stored-method-errors.test.ts ✅ Passed 598ms
tests/retry-behavior.test.ts ✅ Passed 2.836s
tests/sdk-error-shape.test.ts ✅ Passed 320ms

View OkTest run #32202949232

SDK merge (d5b8ad1b7efe) · head (91913b2107ea) · base (b7a0bd6144ed) · OkTest (7e7850017529)

@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: 6b3d8245c7

ℹ️ 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/internal/qs/utils.ts Resolved

@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: 2e1493b33c

ℹ️ 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/internal/qs/utils.ts Resolved
Comment thread src/internal/qs/utils.ts Resolved
Comment thread src/internal/qs/utils.ts Resolved
Comment thread src/internal/qs/utils.ts Resolved

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

Independent two-pass review confirms the four existing unresolved P2 threads on the new recursive sanitizer. Please resolve those existing threads without duplicating their reports.

One additional lower-severity completeness issue: assign_single_source at src/internal/qs/utils.ts:230 still adopts nested objects without applying the same unsafe-key policy. This helper has no current production callers, so please either scope the documented hardening claim to actual supported callers or handle its values safely without expanding the graph-copying machinery.

Prefer the smallest bounded fix at the real input/ownership boundary over additional recursive graph-copying special cases.

@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: 648923b26d

ℹ️ 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/internal/qs/utils.ts Resolved
Comment thread src/internal/qs/utils.ts Resolved
Comment thread src/internal/qs/utils.ts Resolved

@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: ee47782a10

ℹ️ 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/internal/qs/utils.ts Resolved
Comment thread src/internal/qs/utils.ts Resolved
Comment thread src/internal/qs/utils.ts Resolved
Comment thread src/internal/qs/utils.ts Resolved
Comment thread src/internal/qs/utils.ts Resolved

@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: 66892a9ee5

ℹ️ 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/internal/qs/utils.ts Resolved
Comment thread src/internal/qs/utils.ts Resolved
Comment thread src/internal/qs/utils.ts Resolved

@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: 91913b2107

ℹ️ 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/internal/qs/utils.ts Resolved

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

All prior query-sanitization findings are resolved: bounded graph traversal preserves aliases, cycles, supported exotic values, atomicity, and safe-key filtering across both helpers. Bedrock region validation and upload-error redaction are also covered. The documented custom-prototype Proxy limitation is an explicitly accepted compatibility tradeoff. All existing threads are resolved and checks pass.

@HAYDEN-OAI
HAYDEN-OAI added this pull request to the merge queue Aug 19, 2026
Merged via the queue into main with commit ce45d0d Aug 19, 2026
29 checks passed
@HAYDEN-OAI
HAYDEN-OAI deleted the dev/hayden/openai-node-security-helper-boundaries branch August 19, 2026 16:28
@openai-sdks openai-sdks Bot mentioned this pull request Aug 19, 2026
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.

2 participants