Conversation
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a check to block vulnerable versions of Next.js during the build process. The changes include updating the semver dependency, adding a checkNextJSVersion utility function with corresponding tests, and updating the starter project to a safe Next.js version.
My review focuses on improving the robustness of the new version check and fixing an issue in the tests. I've suggested using a more robust condition to handle unspecified versions and extracting the version range string into a constant for better maintainability. I also found a bug in the new tests where assertions for non-throwing cases were not correctly implemented.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a mechanism to block deployments using vulnerable versions of Next.js. It adds a version check at build time and updates dependencies in starter templates to safe versions. My review focuses on improving the clarity and maintainability of the implementation. I've suggested refactoring the list of safe versions for better readability and correcting a potentially misleading error message that contains placeholder CVE information.
| 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`, | ||
| ); |
There was a problem hiding this comment.
The CVE identifiers and URL in the error message appear to be placeholders and are likely incorrect. CVE-2025-55182 and CVE-2025-66478 reference a future year, and the CVEs are different in the message body and the URL. This could cause confusion for users who encounter this error.
To avoid providing misleading information, consider using a more generic error message until the correct CVE details and a valid advisory link are available.
throw new Error(
`Vulnerable Next.js version ${version} detected. Deployment blocked. Please update your app's dependencies to a patched Next.js version and redeploy. For more details, see the relevant security advisory.`,
);|
@annajowang I think this change broke my builds, I am seeing the following error in App Hosting Cloud Build logs: |
* Block vulnerable nextjs versions. * test * some cleanup * lint * more tests
No description provided.