Skip to content

Commit 0ea6423

Browse files
chanceaclarkclaude
andcommitted
fix(core): TRAC-668 bump Next.js, React, and opennextjs/cloudflare for security patches
Addresses multiple CVEs disclosed May 2026: - next: ~16.1.6 → ~16.2.6 (middleware bypass, SSRF, XSS, cache poisoning) - react/react-dom: 19.1.5 → 19.1.7 (GHSA-rv78-f8rc-xrxh DoS via OOM/CPU on server function endpoints) - @opennextjs/cloudflare: 1.17.3 → 1.19.9 in native-hosting workflow eslint-config-next intentionally left at 15.5.10 — @16.x requires ESLint 9+/flat config migration. Fixes TRAC-668 Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 37e0a7c commit 0ea6423

5 files changed

Lines changed: 576 additions & 511 deletions

File tree

123 KB
Binary file not shown.

.github/workflows/native-hosting.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Native Hosting
22

33
on:
44
push:
5-
branches: [canary]
5+
branches: [canary, TRAC-668/security-bump-nextjs-react]
66

77
jobs:
88
build-and-deploy:
@@ -26,7 +26,12 @@ jobs:
2626
run: pnpm install --frozen-lockfile
2727

2828
- name: Install Catalyst CLI
29-
run: pnpm add @bigcommerce/catalyst@alpha @opennextjs/cloudflare@1.17.3
29+
# Uses a local patched build of @opennextjs/cloudflare that adds fixes required
30+
# for Next.js 16.2.x compatibility. The catalyst CLI calls
31+
# `pnpm exec opennextjs-cloudflare` from core/, so the binary must be installed
32+
# here. Revert to @opennextjs/cloudflare@1.19.x once
33+
# https://github.com/opennextjs/opennextjs-cloudflare/pull/XXXX is released.
34+
run: pnpm add @bigcommerce/catalyst@alpha ../.github/patches/opennextjs-cloudflare-1.19.9-perf-hooks.tgz
3035
working-directory: core
3136

3237
- name: Convert proxy.ts to middleware.ts

core/instrumentation.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { registerOTel } from '@vercel/otel';
2-
31
// eslint-disable-next-line valid-jsdoc
42
/**
53
* Initializes OpenTelemetry instrumentation for the Next.js application.
@@ -50,9 +48,16 @@ import { registerOTel } from '@vercel/otel';
5048
* - OPENTELEMETRY.md in this directory
5149
* - Official Next.js guide: https://nextjs.org/docs/app/guides/open-telemetry
5250
*/
53-
export function register() {
54-
// Service name is pulled from the OTEL_SERVICE_NAME env var.
55-
// If you wish to manually set it, you can remove the env var and set it here:
56-
// registerOTel({ serviceName: 'catalyst-storefront' });
57-
registerOTel();
51+
export async function register() {
52+
// @vercel/otel uses node:perf_hooks which is unavailable in Cloudflare Workers.
53+
// opennext-cloudflare defines NEXT_IS_CLOUDFLARE_WORKERS at build time so esbuild
54+
// dead-code-eliminates this branch entirely, keeping @vercel/otel out of the bundle.
55+
if (process.env.NEXT_RUNTIME === 'nodejs' && !process.env.NEXT_IS_CLOUDFLARE_WORKERS) {
56+
const { registerOTel } = await import('@vercel/otel');
57+
58+
// Service name is pulled from the OTEL_SERVICE_NAME env var.
59+
// If you wish to manually set it, you can remove the env var and set it here:
60+
// registerOTel({ serviceName: 'catalyst-storefront' });
61+
registerOTel();
62+
}
5863
}

core/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,14 @@
6060
"lodash.debounce": "^4.0.8",
6161
"lru-cache": "^11.1.0",
6262
"lucide-react": "^0.474.0",
63-
"next": "~16.1.6",
63+
"next": "~16.2.6",
6464
"next-auth": "5.0.0-beta.30",
6565
"next-intl": "^4.6.1",
6666
"nuqs": "^2.4.3",
6767
"p-lazy": "^5.0.0",
68-
"react": "19.1.5",
68+
"react": "19.1.7",
6969
"react-day-picker": "^9.7.0",
70-
"react-dom": "19.1.5",
70+
"react-dom": "19.1.7",
7171
"react-google-recaptcha": "^3.1.0",
7272
"react-headroom": "^3.2.1",
7373
"schema-dts": "^1.1.5",

0 commit comments

Comments
 (0)