security: CWE-532: Redact sensitive data from debug logs — VC-53770#192
Open
torresashjiancyber wants to merge 1 commit into
Open
security: CWE-532: Redact sensitive data from debug logs — VC-53770#192torresashjiancyber wants to merge 1 commit into
torresashjiancyber wants to merge 1 commit into
Conversation
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
Fixed CWE-532 (Insertion of Sensitive Information into Log File) by redacting passwords, tokens, API keys, and private key material from debug log output.
Finding
CWE-532: Secrets in debug log (CVSS: 5.6)
When debug logging is enabled, the SDK was logging plaintext credentials and sensitive data:
These secrets were logged at multiple points:
TPPTokenConnection._post()/_put()logged full request headers (containingAuthorization: Bearer <token>) and bodies (containing passwords/passphrases)TPPTokenConnection._check_token()logged raw access tokensTPPConnection._get()/_post()/_put()logged raw API keysCommonConnection.process_server_response()logged raw octet-stream responses containing private keysAnyone with read access to application logs could recover working Venafi credentials.
Remediation
Applied minimal focused changes to redact sensitive data from log output:
vcert/connection_tpp_token.py (lines 129, 149): Create redacted copies of headers and data dictionaries before logging
Authorizationheader valuepassword,Password,refresh_token,client_secret,PrivateKeyPassphrasevcert/connection_tpp_token.py (lines 160, 166): Replace raw token values with
[REDACTED]placeholdervcert/connection_tpp.py (lines 93, 106, 123): Replace raw API key values with
[REDACTED]placeholdervcert/common.py (line 758): Log byte count instead of raw octet-stream content
All changes preserve the original unredacted values in the actual network requests - only the log output is modified.
Verification
Files changed: 3 files, 12 insertions(+), 8 deletions(-)
vcert/common.pyvcert/connection_tpp.pyvcert/connection_tpp_token.pyImpact: No functional changes to SDK behavior. Network requests remain identical. Only debug log output is modified to protect sensitive data.
Testing note: Test suite has pre-existing dependency issues unrelated to these changes (missing
sixmodule). The remediation only modifies logging statements and does not affect imports, logic, or network behavior.🤖 Generated with Project Logos Pattern-C security fixer