Base · Medium

CWE-1087: Class with Virtual Method without a Virtual Destructor

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

CWE-1087 · Base Level

Description

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

Potential Impact

Other

Reduce Reliability

Detection Methods

  • Automated Static Analysis High — Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then sea

Taxonomy Mappings

  • OMG ASCRM: ASCRM-RLB-15 —

Frequently Asked Questions

What is CWE-1087?

CWE-1087 (Class with Virtual Method without a Virtual Destructor) is a software weakness identified by MITRE's Common Weakness Enumeration. It is classified as a Base-level weakness. A class contains a virtual method, but the method does not have an associated virtual destructor.

How can CWE-1087 be exploited?

Attackers can exploit CWE-1087 (Class with Virtual Method without a Virtual Destructor) to reduce reliability. This weakness is typically introduced during the Implementation phase of software development.

How do I prevent CWE-1087?

Follow secure coding practices, conduct code reviews, and use automated security testing tools (SAST/DAST) to detect this weakness early in the development lifecycle.

What is the severity of CWE-1087?

CWE-1087 is classified as a Base-level weakness (Medium abstraction). Its actual severity depends on the specific context and how the weakness manifests in your application.