[Forgot Password]
Login  Register Subscribe

30481

 
 

423868

 
 

255861

 
 

909

 
 

199025

 
 

282

Paid content will be excluded from the download.


Download | Alert*
CWE
view XML

Improper Cleanup on Thrown Exception

ID: 460Date: (C)2012-05-14   (M)2022-10-10
Type: weaknessStatus: DRAFT
Abstraction Type: Variant





Description

The product does not clean up its state or incorrectly cleans up its state when an exception is thrown, leading to unexpected state or control flow.

Likelihood of Exploit: Medium

Applicable Platforms
Language: C
Language: C++
Language: Java
Language: .NET

Time Of Introduction

  • Implementation

Common Consequences

ScopeTechnical ImpactNotes
Other
 
Varies by context
 
The code could be left in a bad state.
 

Detection Methods
None

Potential Mitigations

PhaseStrategyDescriptionEffectivenessNotes
Implementation
 
 If one breaks from a loop or function by throwing an exception, make sure that cleanup happens or that you should exit the program. Use throwing exceptions sparsely.
 
  

Relationships

Related CWETypeViewChain
CWE-460 ChildOf CWE-889 Category CWE-888  

Demonstrative Examples
None

White Box Definitions
None

Black Box Definitions
None

Taxynomy Mappings

TaxynomyIdNameFit
CLASP  Improper cleanup on thrown exception
 
 
CERT Java Secure Coding ERR03-J
 
Restore prior object state on method failure
 
 
CERT Java Secure Coding ERR05-J
 
Do not let checked exceptions escape from a finally block
 
 
CERT C++ Secure Coding ERR39-CPP
 
Guarantee exception safety
 
 

References:
None

© SecPod Technologies