fix(nextjs): update Next.js versions to patch vulnerability (#30574)

There is a critical vulnerability with Next.js. This PR updates both the
v14 and v15 versions to ensure users are on the latest patched versions.

For new projects, it should already be using the latest patch within the
minor version, since we default to `~` range. This will ensure that
existing projects that did not update yet is updated to the secure
versions.

See: https://github.com/advisories/GHSA-f82v-jwr5-mffw

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
Next.js versions for existing projects may be using vulnerable versions.

## Expected Behavior
Migrate existing Next.js projects to patched and secure versions.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
This commit is contained in:
Jack Hsu 2025-04-01 18:28:00 -04:00 committed by GitHub
parent f5d3ba5dcd
commit 41cc04d070
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 477 additions and 373 deletions

View File

@ -3104,6 +3104,26 @@
"path": "/nx-api/next/migrations/20.7.1-beta.0-package-updates", "path": "/nx-api/next/migrations/20.7.1-beta.0-package-updates",
"type": "migration" "type": "migration"
}, },
"/nx-api/next/migrations/20.7.1-beta.0-next14-package-updates": {
"description": "",
"file": "generated/packages/next/migrations/20.7.1-beta.0-next14-package-updates.json",
"hidden": false,
"name": "20.7.1-beta.0-next14-package-updates",
"version": "20.7.1-beta.0",
"originalFilePath": "/packages/next",
"path": "/nx-api/next/migrations/20.7.1-beta.0-next14-package-updates",
"type": "migration"
},
"/nx-api/next/migrations/20.7.1-beta.0-next15-package-updates": {
"description": "",
"file": "generated/packages/next/migrations/20.7.1-beta.0-next15-package-updates.json",
"hidden": false,
"name": "20.7.1-beta.0-next15-package-updates",
"version": "20.7.1-beta.0",
"originalFilePath": "/packages/next",
"path": "/nx-api/next/migrations/20.7.1-beta.0-next15-package-updates",
"type": "migration"
},
"/nx-api/next/migrations/19.0.3-package-updates": { "/nx-api/next/migrations/19.0.3-package-updates": {
"description": "", "description": "",
"file": "generated/packages/next/migrations/19.0.3-package-updates.json", "file": "generated/packages/next/migrations/19.0.3-package-updates.json",

View File

@ -3083,6 +3083,26 @@
"path": "next/migrations/20.7.1-beta.0-package-updates", "path": "next/migrations/20.7.1-beta.0-package-updates",
"type": "migration" "type": "migration"
}, },
{
"description": "",
"file": "generated/packages/next/migrations/20.7.1-beta.0-next14-package-updates.json",
"hidden": false,
"name": "20.7.1-beta.0-next14-package-updates",
"version": "20.7.1-beta.0",
"originalFilePath": "/packages/next",
"path": "next/migrations/20.7.1-beta.0-next14-package-updates",
"type": "migration"
},
{
"description": "",
"file": "generated/packages/next/migrations/20.7.1-beta.0-next15-package-updates.json",
"hidden": false,
"name": "20.7.1-beta.0-next15-package-updates",
"version": "20.7.1-beta.0",
"originalFilePath": "/packages/next",
"path": "next/migrations/20.7.1-beta.0-next15-package-updates",
"type": "migration"
},
{ {
"description": "", "description": "",
"file": "generated/packages/next/migrations/19.0.3-package-updates.json", "file": "generated/packages/next/migrations/19.0.3-package-updates.json",

View File

@ -0,0 +1,15 @@
{
"name": "20.7.1-beta.0-next14-package-updates",
"version": "20.7.1-beta.0",
"requires": { "next": "^14.0.0" },
"packages": {
"next": { "version": "~14.2.26", "alwaysAddToPackageJson": false }
},
"aliases": [],
"description": "",
"hidden": false,
"implementation": "",
"path": "/packages/next",
"schema": null,
"type": "migration"
}

View File

@ -0,0 +1,15 @@
{
"name": "20.7.1-beta.0-next15-package-updates",
"version": "20.7.1-beta.0",
"requires": { "next": "^15.0.0" },
"packages": {
"next": { "version": "~15.2.4", "alwaysAddToPackageJson": false }
},
"aliases": [],
"description": "",
"hidden": false,
"implementation": "",
"path": "/packages/next",
"schema": null,
"type": "migration"
}

View File

@ -362,7 +362,7 @@
"json-schema-to-typescript": "^10.1.5", "json-schema-to-typescript": "^10.1.5",
"jsonpointer": "^5.0.0", "jsonpointer": "^5.0.0",
"license-checker": "^25.0.1", "license-checker": "^25.0.1",
"next": "14.2.16", "next": "14.2.26",
"next-seo": "^5.13.0", "next-seo": "^5.13.0",
"node-machine-id": "1.1.12", "node-machine-id": "1.1.12",
"npm-run-path": "^4.0.1", "npm-run-path": "^4.0.1",

View File

@ -47,6 +47,30 @@
"alwaysAddToPackageJson": false "alwaysAddToPackageJson": false
} }
} }
},
"20.7.1-beta.0-next14": {
"version": "20.7.1-beta.0",
"requires": {
"next": "^14.0.0"
},
"packages": {
"next": {
"version": "~14.2.26",
"alwaysAddToPackageJson": false
}
}
},
"20.7.1-beta.0-next15": {
"version": "20.7.1-beta.0",
"requires": {
"next": "^15.0.0"
},
"packages": {
"next": {
"version": "~15.2.4",
"alwaysAddToPackageJson": false
}
}
} }
} }
} }

View File

@ -1,7 +1,7 @@
export const nxVersion = require('../../package.json').version; export const nxVersion = require('../../package.json').version;
export const nextVersion = '~15.1.4'; export const nextVersion = '~15.2.4';
export const next14Version = '~14.2.16'; export const next14Version = '~14.2.26';
export const eslintConfigNextVersion = '^15.2.4'; export const eslintConfigNextVersion = '^15.2.4';
export const sassVersion = '1.62.1'; export const sassVersion = '1.62.1';
export const lessLoader = '11.1.0'; export const lessLoader = '11.1.0';

750
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff