Fix credential exposure in keygen() tracebacks#55
Open
bubblegum-h wants to merge 1 commit intokevinsteves:masterfrom
Open
Fix credential exposure in keygen() tracebacks#55bubblegum-h wants to merge 1 commit intokevinsteves:masterfrom
bubblegum-h wants to merge 1 commit intokevinsteves:masterfrom
Conversation
Author
|
@kevinsteves, I tried reach you via email. I haven't gotten back from you. Please have a look at this PR. Thanks |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Prevent API passwords from being exposed in exception tracebacks when
keygen()fails.Problem
The
keygenmethod builds aquerydict containing the password ({'type': 'keygen', 'user': '...', 'password': '...'}). OnPanXapiError, the traceback can include this local variable, exposing credentials in logs and error reports.Solution
Clear the password from the
querydict in atry/finallyblock so it is removed before any exception propagates. By the time the traceback is captured, the password is no longer in the query dict.Impact
queryis used only by__api_request; no other references are affected.