Skip to content

False negative when setting password within a dict (B105) #1267

Open
@prathamlahoti123

Description

@prathamlahoti123

Describe the bug

B105 isn't triggered if there's a password key within a dictionary.

Reproduction steps

1. echo 'info = {"password": "12345"}' > test.py
2. bandit -r test.py

Expected behavior

B105 must be triggered as described in the docs.

Bandit version

1.8.3 (Default)

Python version

3.12

Additional context

B105 isn't triggered even if the rule is explicitly added to a configuration file such as bandit.yaml and bandit is run with the corresponding -c flag.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions