Skip to content

Potential fix for code scanning alert no. 5: Clear-text logging of sensitive information#12

Merged
johnteee merged 1 commit into
mainfrom
alert-autofix-5
May 15, 2026
Merged

Potential fix for code scanning alert no. 5: Clear-text logging of sensitive information#12
johnteee merged 1 commit into
mainfrom
alert-autofix-5

Conversation

@johnteee
Copy link
Copy Markdown
Member

Potential fix for https://github.com/TeaEntityLab/teaAgent/security/code-scanning/5

General fix: avoid logging raw error strings that may contain sensitive or user-controlled values. Return or print sanitized, constant messages for user-visible output, while keeping detailed diagnostics out of logs/stderr unless redacted.

Best fix here (without changing core behavior): in mcp_serve_command, replace print(error, file=sys.stderr) with a constant message that does not include tainted data. Keep return code behavior unchanged. No new imports or helper methods are required.

File/region to change:

  • teaagent/cli/_handlers/_mcp.py: line around the if error: block after _load_key_ring(...).

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…nsitive information

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@johnteee johnteee marked this pull request as ready for review May 15, 2026 05:42
@johnteee johnteee merged commit fa1d438 into main May 15, 2026
12 of 16 checks passed
@johnteee johnteee deleted the alert-autofix-5 branch May 15, 2026 05:43
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