Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions public/cloudflare-one/static/authenticated-doh.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,7 @@
if client_id == "new":
service_token_name = input('Please input name for service token > ')
client_id, client_secret = request_create_service_token(service_token_name)
print(
f"Created service token with client_id {client_id} and client_secret {client_secret}. You may want to save these secrets.")
print(f"Created service token with client_id {client_id}. Please save the client_id and client_secret securely.")

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information

This expression logs [sensitive data (secret)](1) as clear text.

Copilot Autofix

AI 9 months ago

To fix the problem, we need to ensure that sensitive information such as client_id and client_secret is not logged in clear text. Instead, we can log a generic message indicating that a service token was created without including the sensitive details. This way, we maintain the functionality of informing the user about the creation of the service token without exposing sensitive information.

We will modify the code in public/cloudflare-one/static/authenticated-doh.py to remove the sensitive information from the log message on line 149.

Suggested changeset 1
public/cloudflare-one/static/authenticated-doh.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/public/cloudflare-one/static/authenticated-doh.py b/public/cloudflare-one/static/authenticated-doh.py
--- a/public/cloudflare-one/static/authenticated-doh.py
+++ b/public/cloudflare-one/static/authenticated-doh.py
@@ -148,3 +148,3 @@
     client_id, client_secret = request_create_service_token(service_token_name)
-    print(f"Created service token with client_id {client_id}. Please save the client_id and client_secret securely.")
+    print("Created service token. Please save the client_id and client_secret securely.")
 
EOF
@@ -148,3 +148,3 @@
client_id, client_secret = request_create_service_token(service_token_name)
print(f"Created service token with client_id {client_id}. Please save the client_id and client_secret securely.")
print("Created service token. Please save the client_id and client_secret securely.")

Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated


if len(client_secret) == 0:
Expand Down