Skip to content

[Snyk] Security upgrade firebase-admin from 11.3.0 to 12.0.0 #673

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

Closed

Conversation

aravindvnair99
Copy link
Owner

snyk-top-banner

Snyk has created this PR to fix 1 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
low severity Regular Expression Denial of Service (ReDoS)
SNYK-JS-BRACEEXPANSION-9789073
  508  

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:

🦉 Regular Expression Denial of Service (ReDoS)

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.

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, automatically created by Snyk, updates the firebase-admin dependency to version 12.0.0. The primary goal is to remediate a known security vulnerability. As this is a major version bump, it's important to verify compatibility.

Highlights

  • Dependency Upgrade: I've upgraded the firebase-admin dependency from version 11.3.0 to 12.0.0 in the functions package.
  • Security Fix: This upgrade was automatically generated by Snyk to address a low-severity Regular Expression Denial of Service (ReDoS) vulnerability (SNYK-JS-BRACEEXPANSION-9789073) found in the current version.
  • Potential Breaking Change: Note that version 12.0.0 of firebase-admin is flagged as a breaking change by Snyk. Please review the release notes for potential impacts.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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 is currently in preview and 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 to provide feedback.

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 configureGemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

guardrails bot commented Jun 16, 2025

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

Insecure File Management (1)
Severity Details Docs
High Title: Path Traversal from user input
path.join(os.tmpdir(), path.basename(req.files.file[0].fieldname)),
📚

More info on how to fix Insecure File Management in JavaScript.


Insecure Use of Crypto (1)
Severity Details Docs
Medium Title: Insecure use of random generator
result += characters.charAt(Math.floor(Math.random() * charactersLength));
📚

More info on how to fix Insecure Use of Crypto in JavaScript.


Vulnerable Libraries (7)
Severity Details
N/A pkg:npm/[email protected] upgrade to: 3.1.10
Critical pkg:npm/@tensorflow/[email protected] upgrade to: > 3.14.0
Informational pkg:npm/[email protected] upgrade to: > 1.4.6
High pkg:npm/[email protected] upgrade to: > 4.2.1
High pkg:npm/[email protected] upgrade to: > 0.3.1
High pkg:npm/[email protected] upgrade to: > 8.54.0
N/A pkg:npm/[email protected] upgrade to: 1.8.2

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

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 ^11.3.0 to ^12.0.0. This is a major version upgrade intended to fix a security vulnerability (Regular Expression Denial of Service - ReDoS).

Important Consideration:
The upgrade to firebase-admin v12.0.0 introduces breaking changes. Most critically, firebase-admin v12.x requires Node.js 16 or later. Your project's package.json currently specifies Node.js 14 in the engines field. This incompatibility must be addressed by updating your Firebase Functions runtime environment to Node.js 16+ and modifying the engines field in package.json.

Before merging, please ensure you:

  1. Update your Node.js runtime environment for Firebase Functions.
  2. Carefully review the Firebase Admin SDK v12.0.0 release notes for all breaking changes.
  3. Update your codebase to be compatible with these changes.
  4. Thoroughly test all functionalities that depend on firebase-admin (e.g., Authentication, Firestore, Storage) to ensure a smooth transition.

@@ -32,7 +32,7 @@
"busboy": "^0.3.1",
"cookie-parser": "^1.4.6",
"ejs": "^3.1.7",
"firebase-admin": "^11.3.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 is a major version update which, according to Snyk's metadata, includes breaking changes.

A critical consideration for this upgrade is that firebase-admin v12.x requires Node.js 16 or higher. Your project's package.json currently specifies "engines": { "node": "14" }. This version incompatibility must be addressed to ensure your functions deploy and run correctly.

Recommended actions:

  1. Update Node.js Runtime: Change your Firebase Functions runtime to Node.js 16 or a newer supported version. You will also need to update the engines.node field in your package.json accordingly.
  2. Review Breaking Changes: Consult the Firebase Admin SDK v12.0.0 release notes for a comprehensive list of breaking changes and necessary code modifications. Pay close attention to how firebase-admin is used in functions/index.js for Firestore, Authentication, and Storage operations.
  3. Thorough Testing: After updating the Node.js runtime and addressing any breaking API changes, rigorously test all Firebase functionalities in your application.

Copy link

stale bot commented Jun 30, 2025

Automatically marked as stale due to lack of recent activity. Will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jun 30, 2025
Copy link

stale bot commented Jul 8, 2025

Automatically closed due to lack of recent activity. Tag @aravindvnair99 to reopen. Thank you for your contributions.

@stale stale bot closed this Jul 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants