bandit
bandit copied to clipboard
Report mutable class attributes as warning
Mutable class attributes may lead to information leaking from one instance to another.
class MyClass(object):
errors = []
def do_something(self):
try:
...
except SomeException as e:
self.errors.append(e)
Mutable class attributes should be reported as potential security risks. The logic same should apply for mutable default values of call parameters for functions
Not sure if this should go in here or if https://github.com/PyCQA/flake8-bugbear/issues/57 is the more appropriate place to implement this
Could you please describe the security issue related to this more. Thanks!