Skip to content

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

Merged
vannu07 merged 3 commits into
mainfrom
alert-autofix-10
Jan 14, 2026
Merged

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

Conversation

@vannu07

@vannu07 vannu07 commented Jan 14, 2026

Copy link
Copy Markdown
Owner

Potential fix for https://github.com/vannu07/jarvis/security/code-scanning/10

General approach: avoid logging sensitive user data (phone numbers, contact names, free-form messages) and, where logging is desirable for UX, restrict it to non-identifying or sanitized summaries. Since StatusIndicator is used widely, the least invasive change is to adjust the specific messages that include contact-identifying information (jarvis_message and similar) so that they no longer contain names or other PII, while preserving user-facing voice feedback via speak as needed.

Best concrete fix without changing overall functionality:

  • In backend/feature.py:
    • In findContact, keep using the contact’s phone number and name internally, but change the success feedback to something generic that doesn’t include the normalized query (which may be the person’s name). For example, replace StatusIndicator.success(f"Contact found: {query}") with StatusIndicator.success("Contact found"). This still informs the user that a contact was found without logging PII.
    • In whatsApp, stop including name in the status message passed to StatusIndicator.success. Instead of:
      • "Message sent successfully to " + name
      • "Calling " + name
      • "Starting video call with " + name
        use generic variants like:
      • "Message sent successfully."
      • "Calling contact..."
      • "Starting video call...".
    • Optionally, you can still use the more detailed jarvis_message (with the name) for speak if you consider spoken output not to be “logging”. However, since speak also pushes text to eel.DisplayMessage/eel.receiverText, it’s safer to align that as well with the generic message. I will keep speak(jarvis_message) as-is only in structure—jarvis_message itself will become generic and no longer contain the name.

These changes only touch the content of strings passed to StatusIndicator and speak; they do not affect external behavior other than making visible messages more privacy-preserving. No new functions or imports are required.

Specific locations:

  • backend/feature.py:
    • Around line 315: update StatusIndicator.success(f"Contact found: {query}").
    • Around lines 324–335: update the three jarvis_message assignments to remove inclusion of name.

No changes are needed in backend/feedback.py itself, since its sanitizer and printing mechanism are already generic; the problem is the content being sent into it.


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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses a security vulnerability (code scanning alert #10) by removing personally identifiable information (PII) from log messages. The changes prevent contact names and normalized queries from being logged in clear text while maintaining the same functionality.

Changes:

  • Removed contact name from success messages in WhatsApp operations (calling, messaging, video calling)
  • Removed normalized query (contact name) from contact search success message

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread backend/feature.py
Comment thread backend/feature.py
Comment thread backend/feature.py
Comment thread backend/feature.py
Comment thread backend/feature.py
@vannu07

vannu07 commented Jan 14, 2026

Copy link
Copy Markdown
Owner Author

@copilot open a new pull request to apply changes based on the comments in this thread

Copilot AI commented Jan 14, 2026

Copy link
Copy Markdown
Contributor

@vannu07 I've opened a new pull request, #39, to work on those changes. Once the pull request is ready, I'll request review from you.

[WIP] Fix clear-text logging of sensitive information

@vannu07 vannu07 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ready to merge

@vannu07
vannu07 marked this pull request as ready for review January 14, 2026 15:38
@vannu07
vannu07 merged commit 21b9d63 into main Jan 14, 2026
7 of 11 checks passed
@vannu07
vannu07 deleted the alert-autofix-10 branch January 14, 2026 15:39
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.

3 participants