Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Accuracy improvements for py/clear-text-logging-sensitive-data

Open
#21,595 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
52/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
python
Domain
security

Research direction

Start with the py/clear-text-logging-sensitive-data query and its taint-tracking configuration, then trace how sanitizers and propagators are defined. Confirm that logging SecretStr is not flagged and that logging an exception containing a secret is flagged, using the issue's examples as regression cases.

Written by the indexing model from the issue text.

Description

question

Description of the issue
Hey, I found two common cases where the rule doesn't match in my codebase. One creates noise, the other misses a real leak.

First, SecretStr masks text automatically (e.g., prints '**********'). Logging these objects is safe, but the rule flags them.

from pydantic import SecretStr

password = SecretStr("super_secret")
logging.info("Login: %s", password) # Flagged, but actually safe
  1. Logging an exception object leaks its message (via str), but the rule misses this if the secret is inside the exception.
secret_token = "secret_123"
# logging.error("Auth failed: %s", secret_token)  # Detected ✅
try:
    raise ValueError("Auth failed: {}".format(secret_token))
except ValueError as e:
    # Currently NOT flagged, but leaks 'secret_123' via __str__ ❌
    logging.error("Auth failed: %s", e)  

Maybe we should add the first pattern to the sanitizers and add the second one as a propagator in the taint tracking config.

Dominant language
CodeQL
Stars
10.1k
Forks
2.1k
Avg merge
2d 16h
Merged PRs (30d)
143

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from github/codeql

All issues in github/codeql

Similar issues

More Security issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.