From 512db61be062bac5599a5628c159d88e07ad9864 Mon Sep 17 00:00:00 2001 From: SUPRAVO BISWAS <147735025+SupravoCoder@users.noreply.github.com> Date: Sat, 12 Jul 2025 19:21:46 +0530 Subject: [PATCH 1/4] Potential fix for code scanning alert no. 3: Clear-text logging of sensitive information Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- myproject/earthquake_notifications.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/myproject/earthquake_notifications.py b/myproject/earthquake_notifications.py index c71d25e..6952ece 100644 --- a/myproject/earthquake_notifications.py +++ b/myproject/earthquake_notifications.py @@ -142,7 +142,8 @@ def add_subscriber(self, name: str, phone_number: str, whatsapp_number: str = No return subscriber_id except sqlite3.IntegrityError: - logger.error(f"Subscriber with phone number {phone_number} already exists") + masked_phone_number = f"{phone_number[:2]}{'*' * (len(phone_number) - 6)}{phone_number[-4:]}" + logger.error(f"Subscriber with phone number {masked_phone_number} already exists") return None finally: conn.close() From 96df96e86f46c9ae460ab3f5ccf8a62d954de641 Mon Sep 17 00:00:00 2001 From: SUPRAVO BISWAS <147735025+SupravoCoder@users.noreply.github.com> Date: Sat, 12 Jul 2025 19:23:38 +0530 Subject: [PATCH 2/4] Potential fix for code scanning alert no. 1: Clear-text logging of sensitive information Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- myproject/demo_notifications.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/myproject/demo_notifications.py b/myproject/demo_notifications.py index d1d9ce3..4a30b1f 100644 --- a/myproject/demo_notifications.py +++ b/myproject/demo_notifications.py @@ -44,7 +44,7 @@ def demo_notification_system(): print("\nšŸ‘„ Current subscribers:") subscribers = notification_system.get_subscribers() for _, sub in subscribers.iterrows(): - print(f"- ID {sub['id']}: {sub['name']} ({sub['phone_number']}) - {sub['preferred_method']}") + print(f"- ID {sub['id']}: {sub['name']} - {sub['preferred_method']}") # Create sample earthquake prediction print("\nšŸ”® Creating sample earthquake prediction...") From 95b76d9135a3655347bf0839f30b0eaee284676e Mon Sep 17 00:00:00 2001 From: SUPRAVO BISWAS <147735025+SupravoCoder@users.noreply.github.com> Date: Sun, 13 Jul 2025 00:15:54 +0530 Subject: [PATCH 3/4] Potential fix for code scanning alert no. 7: Clear-text logging of sensitive information Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- myproject/earthquake_notifications.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/myproject/earthquake_notifications.py b/myproject/earthquake_notifications.py index 6952ece..ec5fa75 100644 --- a/myproject/earthquake_notifications.py +++ b/myproject/earthquake_notifications.py @@ -142,8 +142,7 @@ def add_subscriber(self, name: str, phone_number: str, whatsapp_number: str = No return subscriber_id except sqlite3.IntegrityError: - masked_phone_number = f"{phone_number[:2]}{'*' * (len(phone_number) - 6)}{phone_number[-4:]}" - logger.error(f"Subscriber with phone number {masked_phone_number} already exists") + logger.error("A subscriber with the provided phone number already exists.") return None finally: conn.close() From 997792980493b53c90d0d2a479eee2d05e176e4f Mon Sep 17 00:00:00 2001 From: SUPRAVO BISWAS <147735025+SupravoCoder@users.noreply.github.com> Date: Wed, 6 Aug 2025 12:25:56 +0530 Subject: [PATCH 4/4] Potential fix for code scanning alert no. 6: Clear-text logging of sensitive information Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- myproject/integration_demo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/myproject/integration_demo.py b/myproject/integration_demo.py index 5679576..8a4c8a9 100644 --- a/myproject/integration_demo.py +++ b/myproject/integration_demo.py @@ -589,7 +589,7 @@ def demo_company_deployment(): for sub in company_subscribers: subscriber_id = notification_system.add_subscriber(**sub) if subscriber_id: - print(f"āœ… Added: {sub['name']} - Company Stakeholder ({sub.get('employee_id', 'N/A')})") + print(f"āœ… Added: {sub['name']} - Company Stakeholder") else: print(f"āš ļø {sub['name']} already exists or failed to add")