Skip to content

Fix credential exposure in keygen() tracebacks#55

Open
bubblegum-h wants to merge 1 commit intokevinsteves:masterfrom
bubblegum-h:password-leak-fix
Open

Fix credential exposure in keygen() tracebacks#55
bubblegum-h wants to merge 1 commit intokevinsteves:masterfrom
bubblegum-h:password-leak-fix

Conversation

@bubblegum-h
Copy link

Summary

Prevent API passwords from being exposed in exception tracebacks when keygen() fails.

Problem

The keygen method builds a query dict containing the password ({'type': 'keygen', 'user': '...', 'password': '...'}). On PanXapiError, the traceback can include this local variable, exposing credentials in logs and error reports.

Solution

Clear the password from the query dict in a try/finally block 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

  • No change to API behavior; the password is only removed after the request is sent.
  • query is used only by __api_request; no other references are affected.

@bubblegum-h
Copy link
Author

@kevinsteves, I tried reach you via email. I haven't gotten back from you. Please have a look at this PR. Thanks

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments