This repository was archived by the owner on Nov 20, 2025. It is now read-only.
chore: deprecate unsafe loads & client options, add warnings to risky methods#2134
Merged
GautamSharda merged 8 commits intomainfrom Sep 25, 2025
Merged
chore: deprecate unsafe loads & client options, add warnings to risky methods#2134GautamSharda merged 8 commits intomainfrom
GautamSharda merged 8 commits intomainfrom
Conversation
|
Warning: This pull request is touching the following templated files:
|
Updates .readme-partials.yaml with the secure JWT constructor example for loading credentials from environment variables. This resolves a Windy Eagle vulnerability mitigation concern and adheres to the synthtool workflow for documentation.
…ry-nodejs into windy-eagle
…ry-nodejs into windy-eagle
miguelvelezsa
approved these changes
Sep 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This change applies a vulnerability mitigation (b/437993913).
The core issue is that generic credential loading methods like fromJSON() and fromStream() can be exploited. If an application accepts a credential configuration from an untrusted source, an attacker can craft a malicious JSON payload (e.g., with type: 'external_account'). This could cause the library to load a credential type that can exfiltrate data or tokens by interacting with attacker-controlled URLs.
To mitigate this, this PR:
fromJSON()andfromStream()inGoogleAuth: These methods are now marked as deprecated, with detailed JSDoc comments explaining the security risk.Impact
This is a non-breaking security enhancement. Existing code will continue to function, but users of the deprecated methods will see warnings encouraging them to adopt safer credential loading practices. This change hardens the library against potential credential mis-configuration attacks.
Testing
The changes primarily involve adding deprecation tags, JSDoc comments, and updating documentation. No core logic was altered. The existing test suite was run to ensure that all functionality remains intact and no regressions were introduced. All tests continue to pass.
Checklist
places that require background
Fixes b/437993913