Skip to content

Report mutable class attributes as warning #445

@cleder

Description

@cleder

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions