CWE-1087

Class with Virtual Method without a Virtual Destructor. [Bad-Coding-Practices, Improper-Adherence-To-Coding-Standards]

Required inputs: IR

A class contains a virtual method, but the method does not have an associated virtual destructor.

This issue can prevent the product from running reliably, e.g. due to undefined behavior. If the relevant code is reachable by an attacker, then this reliability problem might introduce a vulnerability.

Excerpts from CWE [https://cwe.mitre.org], Copyright (C) 2006-2026, the MITRE Corporation. See section 9.4. "3rd-Party Licenses" in the documentation for full details.

Possible Messages

Key

Text

Severity

Disabled

missing_virtual_destructor

Class needs a virtual destructor.

None

False

Options

accept_none_destructor

accept_none_destructor : bool = True

If set true, classes without any destructor are tolerated.