Description
A parent class has a virtual destructor method, but the parent has a child class that does not have a virtual destructor.
Potential Impact
Other
Reduce Reliability
Related Weaknesses
Taxonomy Mappings
- OMG ASCRM: ASCRM-RLB-17 —
Frequently Asked Questions
What is CWE-1045?
CWE-1045 (Parent Class with a Virtual Destructor and a Child Class without a Virtual Destructor) is a software weakness identified by MITRE's Common Weakness Enumeration. It is classified as a Base-level weakness. A parent class has a virtual destructor method, but the parent has a child class that does not have a virtual destructor.
How can CWE-1045 be exploited?
Attackers can exploit CWE-1045 (Parent Class with a Virtual Destructor and a Child Class without a Virtual Destructor) to reduce reliability. This weakness is typically introduced during the Implementation phase of software development.
How do I prevent CWE-1045?
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-1045?
CWE-1045 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.