diff --git a/package-lock.json b/package-lock.json index 12f10b56..2a56db26 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25617,7 +25617,7 @@ } }, "packages/@apphosting/adapter-nextjs": { - "version": "14.0.18", + "version": "14.0.19", "license": "Apache-2.0", "dependencies": { "@apphosting/common": "*", diff --git a/packages/@apphosting/adapter-nextjs/package.json b/packages/@apphosting/adapter-nextjs/package.json index e7e995bd..33e97322 100644 --- a/packages/@apphosting/adapter-nextjs/package.json +++ b/packages/@apphosting/adapter-nextjs/package.json @@ -1,6 +1,6 @@ { "name": "@apphosting/adapter-nextjs", - "version": "14.0.18", + "version": "14.0.19", "main": "dist/index.js", "description": "Experimental addon to the Firebase CLI to add web framework support", "repository": { diff --git a/packages/@apphosting/adapter-nextjs/src/utils.spec.ts b/packages/@apphosting/adapter-nextjs/src/utils.spec.ts index 233e6aab..bea48526 100644 --- a/packages/@apphosting/adapter-nextjs/src/utils.spec.ts +++ b/packages/@apphosting/adapter-nextjs/src/utils.spec.ts @@ -22,6 +22,14 @@ describe("block vulnerable nextjs versions", () => { checkNextJSVersion("15.0.5"); }); + assert.throws(() => { + checkNextJSVersion("15.4.7"); + }); + + assert.doesNotThrow(() => { + checkNextJSVersion("15.4.8"); + }); + assert.doesNotThrow(() => { checkNextJSVersion("14.0.12"); }); diff --git a/packages/@apphosting/adapter-nextjs/src/utils.ts b/packages/@apphosting/adapter-nextjs/src/utils.ts index 607ea581..5ea568d7 100644 --- a/packages/@apphosting/adapter-nextjs/src/utils.ts +++ b/packages/@apphosting/adapter-nextjs/src/utils.ts @@ -21,7 +21,7 @@ export const { copy, exists, writeFile, readJson, readdir, readFileSync, existsS export const { satisfies } = semVer; const SAFE_NEXTJS_VERSIONS = - ">=16.1.0 || ^16.0.7 || ^v15.5.7 || ^v15.4.8 || ^v15.3.6 || ^v15.2.6 || ^v15.1.9 || ^v15.0.5 || <14.3.0-canary.77"; + ">=16.1.0 || ~16.0.7 || ~v15.5.7 || ~v15.4.8 || ~v15.3.6 || ~v15.2.6 || ~v15.1.9 || ~v15.0.5 || <14.3.0-canary.77"; export function checkNextJSVersion(version: string | undefined) { if (!version) { @@ -29,7 +29,7 @@ export function checkNextJSVersion(version: string | undefined) { } if (!satisfies(version, SAFE_NEXTJS_VERSIONS)) { throw new Error( - `CVE-2025-55182: Vulnerable Next version ${version} detected. Deployment blocked. Update your app's dependencies to a patched Next.js version and redeploy:https://nextjs.org/blog/CVE-2025-66478#fixed-versions`, + `CVE-2025-55182: Vulnerable Next version ${version} detected. Deployment blocked. Update your app's dependencies to a patched Next.js version and redeploy: https://nextjs.org/blog/CVE-2025-66478#fixed-versions`, ); } }