Skip to content

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

Merged
atyronesmith merged 3 commits into
mainfrom
alert-autofix-14
Aug 21, 2026
Merged

Potential fix for code scanning alert no. 14: Clear-text logging of sensitive information#3
atyronesmith merged 3 commits into
mainfrom
alert-autofix-14

Conversation

@atyronesmith

Copy link
Copy Markdown
Owner

Potential fix for https://github.com/atyronesmith/quickpat/security/code-scanning/14

General fix: avoid printing raw warning strings that may carry sensitive content. Instead, sanitize or redact warning messages at the display boundary so behavior is preserved (warnings still shown) while sensitive content is not exposed.

Best minimal fix here: in quickpat/cli.py, add a small helper that masks secret-bearing warning text, then use it in _print_transform_result for both warning-printing loops (success and failure branches). This preserves control flow and user feedback while preventing clear-text leakage.
Changes needed:

  • File: quickpat/cli.py
  • Region: around _print_transform_result and nearby helper definitions.
  • Add a helper function (e.g., _sanitize_warning_for_display) that redacts content for secret-related warnings.
  • Replace print(f" {w}") with print(f" {_sanitize_warning_for_display(w)}") in both warning loops.

No functional pipeline changes are required; this is a safe output-layer mitigation.

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

…ensitive information

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

Pattern Validation Summary

6 / 6 patterns valid

Quickstart Status Errors Warnings Helm Lint Kubeconform
RAG VALID 0 0 PASS PASS
maas-code-assistant VALID 0 0 PASS PASS
product-recommender VALID 0 0 PASS PASS
lemonade-stand VALID 0 0 PASS PASS
llm-cpu-serving VALID 0 0 PASS PASS
data-governance VALID 0 0 PASS PASS

@atyronesmith
atyronesmith marked this pull request as ready for review August 21, 2026 18:56
@atyronesmith
atyronesmith merged commit 05e296d into main Aug 21, 2026
12 checks passed
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