Skip to content

[Snyk] Security upgrade firebase-admin from 9.11.0 to 12.0.0#158

Open
aravindvnair99 wants to merge 1 commit intomainfrom
snyk-fix-afdc6541b54d3e8066e2c5c837ef1118
Open

[Snyk] Security upgrade firebase-admin from 9.11.0 to 12.0.0#158
aravindvnair99 wants to merge 1 commit intomainfrom
snyk-fix-afdc6541b54d3e8066e2c5c837ef1118

Conversation

@aravindvnair99
Copy link
Owner

snyk-top-banner

Snyk has created this PR to fix 3 vulnerabilities in the npm dependencies of this project.

Snyk changed the following file(s):

  • functions/package.json
  • functions/package-lock.json

Vulnerabilities that will be fixed with an upgrade:

Issue Score
critical severity Interpretation Conflict
SNYK-JS-NODEFORGE-14114940
  751  
high severity Uncontrolled Recursion
SNYK-JS-NODEFORGE-14125745
  721  
medium severity Integer Overflow or Wraparound
SNYK-JS-NODEFORGE-14125097
  601  

Important

  • Check the changes in this PR to ensure they won't cause issues with your project.
  • Max score is 1000. Note that the real score may have changed since the PR was raised.
  • This PR was automatically created by Snyk using the credentials of a real user.

Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open fix PRs.

For more information:
🧐 View latest project report
📜 Customise PR templates
🛠 Adjust project settings
📚 Read about Snyk's upgrade logic


Learn how to fix vulnerabilities with free interactive lessons:

🦉 Learn about vulnerability in an interactive lesson of Snyk Learn.

@amazon-q-developer
Copy link

Code review in progress. Analyzing for code quality issues and best practices. You can monitor the review status in the checks section at the bottom of this pull request. Detailed findings will be posted upon completion.

Using Amazon Q Developer for GitHub

Amazon Q Developer1 is an AI-powered assistant that integrates directly into your GitHub workflow, enhancing your development process with intelligent features for code development, review, and transformation.

Slash Commands

Command Description
/q <message> Chat with the agent to ask questions or request revisions
/q review Requests an Amazon Q powered code review
/q help Displays usage information

Features

Agentic Chat
Enables interactive conversation with Amazon Q to ask questions about the pull request or request specific revisions. Use /q <message> in comment threads or the review body to engage with the agent directly.

Code Review
Analyzes pull requests for code quality, potential issues, and security concerns. Provides feedback and suggested fixes. Automatically triggered on new or reopened PRs (can be disabled for AWS registered installations), or manually with /q review slash command in a comment.

Customization

You can create project-specific rules for Amazon Q Developer to follow:

  1. Create a .amazonq/rules folder in your project root.
  2. Add Markdown files in this folder to define rules (e.g., cdk-rules.md).
  3. Write detailed prompts in these files, such as coding standards or best practices.
  4. Amazon Q Developer will automatically use these rules when generating code or providing assistance.

Example rule:

All Amazon S3 buckets must have encryption enabled, enforce SSL, and block public access.
All Amazon DynamoDB Streams tables must have encryption enabled.
All Amazon SNS topics must have encryption enabled and enforce SSL.
All Amazon SNS queues must enforce SSL.

Feedback

To provide feedback on Amazon Q Developer, create an issue in the Amazon Q Developer public repository.

For more detailed information, visit the Amazon Q for GitHub documentation.

Footnotes

  1. Amazon Q Developer uses generative AI. You may need to verify generated code before using it in your environment. See the AWS Responsible AI Policy.

@gemini-code-assist
Copy link

Summary of Changes

Hello @aravindvnair99, 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 pull request significantly enhances the project's security by performing a major version upgrade of the firebase-admin library. The primary goal is to mitigate several identified vulnerabilities, including critical and high-severity issues, ensuring the application remains robust against known exploits. This automated update streamlines the process of maintaining secure dependencies.

Highlights

  • Dependency Upgrade: The firebase-admin dependency has been upgraded from version 9.11.0 to 12.0.0.
  • Vulnerability Fixes: This upgrade addresses three security vulnerabilities: a critical 'Interpretation Conflict' (SNYK-JS-NODEFORGE-14114940), a high severity 'Uncontrolled Recursion' (SNYK-JS-NODEFORGE-14125745), and a medium severity 'Integer Overflow or Wraparound' (SNYK-JS-NODEFORGE-14125097).
  • Automated PR: This pull request was automatically generated by Snyk to apply the necessary security fixes.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@guardrails
Copy link

guardrails bot commented Nov 27, 2025

⚠️ We detected 4 security issues in this pull request:

Vulnerable Libraries (4)
Severity Details
High pkg:npm/eslint@7.26.0 upgrade to: > 7.26.0
N/A pkg:npm/ejs@3.1.6 upgrade to: 3.1.10
High pkg:npm/morgan@1.10.0 upgrade to: > 1.10.0
High pkg:npm/firebase-functions@3.15.1 upgrade to: > 3.15.1

More info on how to fix Vulnerable Libraries in JavaScript.


👉 Go to the dashboard for detailed results.

📥 Happy? Share your feedback with us.

Copy link

@amazon-q-developer amazon-q-developer bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Security Upgrade Review Summary

This PR upgrades firebase-admin from 9.11.0 to 12.0.0 to address critical security vulnerabilities, which is excellent for security posture. However, there are critical compatibility issues that must be addressed before merging:

🚨 Critical Issues:

  1. Node.js Version Incompatibility: Firebase Admin SDK v12 requires Node.js 18+, but the project is configured for Node.js 14
  2. Major Version Breaking Changes: This 3-major-version jump (9→12) likely introduces breaking API changes that could cause runtime failures

🔧 Required Actions:

  1. Update Node.js version to 18 in package.json engines
  2. Consider upgrading firebase-functions to a more recent version for better compatibility
  3. Test thoroughly in a staging environment before deploying
  4. Review the Firebase Admin SDK migration guide for breaking changes

✅ Security Benefits:

  • Fixes 3 vulnerabilities: 1 critical (score 751), 1 high (score 721), 1 medium (score 601)
  • Addresses node-forge vulnerabilities including interpretation conflicts and uncontrolled recursion

Recommendation: Address the Node.js compatibility issue first, then test thoroughly before merging.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

"dependencies": {
"ejs": "^3.1.6",
"firebase-admin": "^9.11.0",
"firebase-admin": "^12.0.0",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛑 Compatibility Issue: This major version upgrade from firebase-admin 9.11.0 to 12.0.0 may introduce breaking changes that could cause runtime failures. Firebase Admin SDK v12 requires Node.js 18+ but your project is configured for Node.js 14. Additionally, this version may have API changes that could break existing code.

Suggested change
"firebase-admin": "^12.0.0",
"firebase-admin": "^11.11.1",

"ejs": "^3.1.6",
"firebase-admin": "^9.11.0",
"firebase-admin": "^12.0.0",
"firebase-functions": "^3.15.1",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider updating firebase-functions to a compatible version. Firebase Admin SDK v12 may require a newer version of firebase-functions for optimal compatibility. The current version (3.15.1) is quite old and may not work well with the upgraded admin SDK.

Copy link

@gemini-code-assist gemini-code-assist bot left a 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, automatically generated by Snyk, upgrades firebase-admin from version 9.11.0 to 12.0.0 to fix several security vulnerabilities. While addressing security is important, this major version upgrade introduces a critical peer dependency conflict with firebase-functions, which is likely to break your application. I have left a comment detailing the issue and suggesting a safer alternative using npm overrides to patch the vulnerability without introducing breaking changes.

"dependencies": {
"ejs": "^3.1.6",
"firebase-admin": "^9.11.0",
"firebase-admin": "^12.0.0",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

Upgrading firebase-admin to 12.0.0 introduces a breaking change. Your firebase-functions package (version 3.15.1) has a peer dependency on firebase-admin with a version range of ^8.0.0 || ^9.0.0. Version 12.0.0 is outside this range, which will likely cause dependency conflicts or runtime errors.

This major version jump was likely proposed by Snyk to resolve vulnerabilities in the transitive dependency node-forge. Instead of this breaking upgrade, you can resolve the security issue by forcing a secure version of node-forge directly.

I recommend one of two approaches:

  1. (Preferred) Revert this change to firebase-admin and use npm overrides to specify a secure version of node-forge. Since your project uses npm@^7.13.0, you can add the following to your package.json:

    "overrides": {
      "node-forge": "^1.3.1"
    }

    This will fix the vulnerability without upgrading firebase-admin to a breaking version.

  2. Upgrade firebase-functions to a version that is compatible with firebase-admin@12.0.0. This will likely require significant code changes in your cloud functions as it involves moving to a new major version of the firebase-functions SDK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants