Some patterns are missing, for example:
api_key = "sk-1234567890" # Missed: API key
db_url = "postgres://user:pass@host/db" # Missed: URL credentials
Second, I am not sure if the username is seen as a credential in a usual project, but this rule will flag the username.
This is beyond the definition in CWE-798 (
The product contains hard-coded credentials, such as a password or cryptographic key.)
USERNAME = "admin" # Flagged
I also found that the rule will lose the taint in the following case:
USERNAME = "road_runner"
PASSWORD = "insecure_pwd"
options = {"password": PASSWORD}
conn = client.connect(username=USERNAME, password=PASSWORD) # Flagged
log.debug("Options: %s", options) # Missing
conn = client.connect(options=options) # Still Missing