19 vulnerabilities classified as CWE-460 (抛出异常的清理不恰当). AI Chinese analysis included.
CWE-460 represents a resource management weakness where software fails to properly release resources or reset internal state when an exception interrupts normal execution flow. This vulnerability typically arises in complex functions or loops where cleanup logic is not robustly integrated with error handling mechanisms. Attackers exploit this by triggering specific exceptions to prevent essential cleanup tasks, such as closing file handles, releasing memory, or terminating database connections. Consequently, the application may retain sensitive data in memory, exhaust system resources, or leave the system in an inconsistent state, potentially leading to denial of service or information leakage. Developers mitigate this risk by implementing structured exception handling blocks, such as try-catch-finally constructs, ensuring that cleanup code executes regardless of whether an exception occurs. Additionally, using language-specific resource management patterns like RAII in C++ or context managers in Python guarantees deterministic resource release, thereby preventing state corruption and resource leaks during abnormal program termination.
public class foo { public static final void main( String args[] ) { boolean returnValue; returnValue=doStuff(); } public static final boolean doStuff( ) { boolean threadLock; boolean truthvalue=true; try { while( //check some condition ) { threadLock=true; //do some stuff to truthvalue threadLock=false; } } catch (Exception e){ System.err.println("You did something bad"); if (something) return truthvalue; } return truthvalue; } }Vulnerabilities classified as CWE-460 (抛出异常的清理不恰当) represent 19 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.