Skip to content

fix(security): authenticate Vercel ecosystem APIs and clean up uploaded files - #2412

Merged
HAYDEN-OAI merged 2 commits into
mainfrom
codex/vercel-edge-security-devbox1-20260818
Aug 19, 2026
Merged

HAYDEN-OAI merged 2 commits into
mainfrom
codex/vercel-edge-security-devbox1-20260818

Conversation

@HAYDEN-OAI

Copy link
Copy Markdown
Contributor

Security findings

  • HIGH csf_60ad55d472f1de23a525c274: unauthenticated assistant listing exposes account data.
  • MEDIUM csf_97c0b7e3dc03a6c21566a620: anonymous completion and streaming routes proxy paid model requests.
  • MEDIUM csf_c2b9fc853edab3a40da1eb0f: anonymous transcription requests consume paid capacity.
  • MEDIUM csf_3d634c846334bb5128ffb403 and csf_e2bb95e5859e20ee92db380c: public Edge/Node test routes incur charges and leave uploaded files behind.

Changes

  • Require a separate, fail-closed bearer token for every /api/* route before OpenAI client initialization; reject oversized requests and bound chat inputs/model output.
  • Generate cryptographically random credentials for existing CI smoke runs and allow browser users to enter the token without exposing it in public build configuration.
  • Delete every uploaded ecosystem-test file in finally, including assertion-failure paths, across both Edge and Node runtimes.
  • Add focused authentication, request-boundary, and file-cleanup regressions; restrict every change to ecosystem-tests/vercel-edge/**.

Verification

  • Five focused Jest suites: 55 passing tests; 20 cleanup regressions failed before the fix.
  • Ecosystem TypeScript check: node_modules/.bin/tsc --noEmit --incremental false.
  • Production application build: npm run build.
  • Full repository lint with pinned Oxfmt 0.62.0: ./scripts/lint.
  • Real development/production HTTP checks: seven anonymous routes and spoofed middleware headers return 401; oversized authorized input returns 413; authorized requests reach the existing handler; the public homepage remains 200. No paid upstream requests were made.

Rollout

Deployments must configure a private VERCEL_EDGE_TEST_TOKEN containing at least 32 characters; without it, API routes remain safely disabled. Existing ecosystem CI generates a fresh token automatically. Public SDK APIs and generated/upstream-owned files are unchanged.

@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.291s for Node SDK PR #2412.

Test results — 42 files
Test Result Time
tests/chat-completions-complex-body.test.ts ✅ Passed 145ms
tests/chat-completions-create.test.ts ✅ Passed 212ms
tests/chat-completions-stream.test.ts ✅ Passed 208ms
tests/files-content-binary.test.ts ✅ Passed 155ms
tests/files-create-multipart.test.ts ✅ Passed 142ms
tests/files-list-pagination.test.ts ✅ Passed 146ms
tests/initialize-config.test.ts ✅ Passed 158ms
tests/instance-isolation.test.ts ✅ Passed 109ms
tests/models-list.test.ts ✅ Passed 144ms
tests/responses-background-lifecycle.test.ts ✅ Passed 263ms
tests/responses-body-method-errors.test.ts ✅ Passed 258ms
tests/responses-cancel-timeout.test.ts ✅ Passed 221ms
tests/responses-cancel.test.ts ✅ Passed 218ms
tests/responses-compact-retries.test.ts ✅ Passed 265ms
tests/responses-compact.test.ts ✅ Passed 188ms
tests/responses-create-advanced-stream.test.ts ✅ Passed 188ms
tests/responses-create-advanced.test.ts ✅ Passed 159ms
tests/responses-create-disconnect.test.ts ✅ Passed 1.177s
tests/responses-create-errors.test.ts ✅ Passed 260ms
tests/responses-create-malformed-api-responses.test.ts ✅ Passed 120ms
tests/responses-create-retries.test.ts ✅ Passed 266ms
tests/responses-create-stream-failures.test.ts ✅ Passed 231ms
tests/responses-create-stream-timeout.test.ts ✅ Passed 2.168s
tests/responses-create-stream-wire.test.ts ✅ Passed 2.477s
tests/responses-create-stream.test.ts ✅ Passed 121ms
tests/responses-create-terminal-states.test.ts ✅ Passed 289ms
tests/responses-create-timeout.test.ts ✅ Passed 224ms
tests/responses-create.test.ts ✅ Passed 174ms
tests/responses-delete.test.ts ✅ Passed 254ms
tests/responses-input-items-errors.test.ts ✅ Passed 249ms
tests/responses-input-items-list.test.ts ✅ Passed 173ms
tests/responses-input-items-options.test.ts ✅ Passed 121ms
tests/responses-input-tokens-count-timeout.test.ts ✅ Passed 227ms
tests/responses-input-tokens-count.test.ts ✅ Passed 209ms
tests/responses-malformed-inputs.test.ts ✅ Passed 2.143s
tests/responses-not-found-errors.test.ts ✅ Passed 262ms
tests/responses-parse.test.ts ✅ Passed 199ms
tests/responses-retrieve-retries.test.ts ✅ Passed 225ms
tests/responses-retrieve.test.ts ✅ Passed 209ms
tests/responses-stored-method-errors.test.ts ✅ Passed 501ms
tests/retry-behavior.test.ts ✅ Passed 2.812s
tests/sdk-error-shape.test.ts ✅ Passed 305ms

View OkTest run #32199256039

SDK merge (756dbc848ba1) · head (bf3aa24e0365) · 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: 0964d4332c

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

@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: Vercel ecosystem routes enforce fail-closed bearer authentication, streamed request bodies honor the byte limit regardless of Content-Length, and uploaded files are cleaned up across success/error paths. The earlier request-size review finding is fixed. No actionable findings.

@HAYDEN-OAI
HAYDEN-OAI added this pull request to the merge queue Aug 19, 2026
Merged via the queue into main with commit d58608a Aug 19, 2026
29 checks passed
@HAYDEN-OAI
HAYDEN-OAI deleted the codex/vercel-edge-security-devbox1-20260818 branch August 19, 2026 00:13
@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