Skip to content

Commit f1bd8d6

Browse files
authored
Switch ^ to ~ in nextjs version checking string (#445)
* Update adapter-nextjs version * switch to tilde
1 parent eb69b26 commit f1bd8d6

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@apphosting/adapter-nextjs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@apphosting/adapter-nextjs",
3-
"version": "14.0.18",
3+
"version": "14.0.19",
44
"main": "dist/index.js",
55
"description": "Experimental addon to the Firebase CLI to add web framework support",
66
"repository": {

packages/@apphosting/adapter-nextjs/src/utils.spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ describe("block vulnerable nextjs versions", () => {
2222
checkNextJSVersion("15.0.5");
2323
});
2424

25+
assert.throws(() => {
26+
checkNextJSVersion("15.4.7");
27+
});
28+
29+
assert.doesNotThrow(() => {
30+
checkNextJSVersion("15.4.8");
31+
});
32+
2533
assert.doesNotThrow(() => {
2634
checkNextJSVersion("14.0.12");
2735
});

packages/@apphosting/adapter-nextjs/src/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ export const { copy, exists, writeFile, readJson, readdir, readFileSync, existsS
2121
export const { satisfies } = semVer;
2222

2323
const SAFE_NEXTJS_VERSIONS =
24-
">=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";
24+
">=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";
2525

2626
export function checkNextJSVersion(version: string | undefined) {
2727
if (!version) {
2828
return;
2929
}
3030
if (!satisfies(version, SAFE_NEXTJS_VERSIONS)) {
3131
throw new Error(
32-
`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`,
32+
`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`,
3333
);
3434
}
3535
}

0 commit comments

Comments
 (0)