-
Notifications
You must be signed in to change notification settings - Fork 1.1k
prevent deployments of Next.js apps vulnerable to CVE-2025-66478 #9572
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Summary of ChangesHello @leoortizz, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This change enhances the security posture of Next.js application deployments by integrating a proactive check against a known vulnerability (CVE-2025-66478). It ensures that applications using the App Directory and requiring backend services are not deployed if they are running an unpatched Next.js version, thereby protecting users from potential security risks. The implementation provides clear feedback and actionable steps for developers to resolve the issue. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a critical security check for Next.js applications, preventing deployments of versions vulnerable to CVE-2025-66478. The changes include adding utility functions to detect vulnerable Next.js versions and integrating this check into the build process. Tests for the new utility functions have also been added, ensuring the logic for version detection is robust. The overall approach is sound and addresses a significant security concern.
Updated the error handling to provide a more detailed and version-specific message when a vulnerable Next.js version is detected. The message now specifies the required patched versions based on the major version of Next.js, enhancing clarity for users on how to resolve the issue.
Added references to CVE-2025-66478 and CVE-2025-55182 in the documentation for the Next.js version vulnerability check function. This provides users with direct links to relevant security advisories, improving awareness and guidance on addressing potential vulnerabilities.
Description
This PR blocks the deployment of Next.js applications that are vulnerable to CVE-2025-66478 (Remote Code Execution in React Server Components).
Affected deployments are those using:
/appdirectory)15.x: < 15.0.5, < 15.1.9, < 15.2.6, < 15.3.6, < 15.4.8, < 15.5.716.x: < 16.0.714.x: Canary releases >=14.3.0-canary.77Changes:
isNextJsVersionVulnerableutility insrc/frameworks/next/utils.tsto check against the specific vulnerable semver ranges.src/frameworks/next/index.tsto throw aFirebaseErrorduring the build step if a vulnerable version is detected whenwantsBackendis true.src/frameworks/next/utils.spec.ts.Scenarios Tested
isNextJsVersionVulnerableagainst a matrix of versions:15.0.0,15.1.0,15.4.7,16.0.6,14.3.0-canary.77.15.0.5,15.1.9,16.0.7.15.6.0) are treated as safe/patched.14.xand older versions (13.x) are not blocked.Sample Commands
This change affects
firebase deploybehavior for Next.js projects.