CWEweakness

CWE-460 Improper Cleanup on Thrown Exception

Medium Official page ↗
Abstraction
Base
Structure
Simple
Status
Draft
Likelihood of exploit
Medium
Languages
C, C#, C++, Java, Python
CWE version
5.0

Description

The product does not clean up its state or incorrectly cleans up its state when an exception is thrown.

Common consequences

• Other: Unexpected State, Varies by Context — Exceptions can disturb the flow of the code and prevent the necessary cleanup from happening. This could lead to unexpected state or control flow.

Potential mitigations

• [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.

Detection methods

• Automated Static Analysis: 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 searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

Related

Child of · CWE (2)

  • CWE-459 Incomplete Cleanup weakness
  • CWE-755 Improper Handling of Exceptional Conditions weakness

Referenced by CVE · weakness (28)

  • CVE-2026-111103 Improper Cleanup on Thrown Exception vulnerability in the HTTP/2 handler of mtrudel bandit allows an unauthenticated remote attacker to… vulnerability
  • CVE-2026-112326 GitLab has remediated an issue in GitLab EE affecting all versions from 17.8 before 19.3.6, 19.4 before 19.4.3, and 19.5 before 19.5.1… vulnerability
  • CVE-2026-96273 Ghidra before 12.1.4 fails to validate the TYPE_COL byte in OptionsDB.createUnregisteredOption(), causing an ArrayIndexOutOfBoundsException… vulnerability
  • CVE-2026-93710 Dancer2 versions from 2.0.0 before 2.2.0 for Perl dispatch a route that a dying hook refused when the exception handler halts the response… vulnerability
  • CVE-2026-86748 Snipe-IT versions before 8.7.0 wipe the database before validating the uploaded backup archive in the restore endpoint. vulnerability
  • CVE-2026-61387 In Eclipse Milo versions 1.0.0 through 1.1.4, monitored-item quota accounting is not exception-safe: if item creation fails with an… vulnerability
  • CVE-2026-48524 PyJWT is a JSON Web Token implementation in Python. vulnerability
  • CVE-2026-40583 UltraDAG is a minimal DAG-BFT blockchain in Rust. vulnerability
  • CVE-2026-33481 Syft is a a CLI tool and Go library for generating a Software Bill of Materials (SBOM) from container images and filesystems. vulnerability
  • CVE-2026-20118 A vulnerability in the handling of an Egress Packet Network Interface (EPNI) Aligner interrupt in Cisco IOS XR Software for Cisco Network… vulnerability
  • CVE-2025-69652 GNU Binutils thru 2.46 readelf contains a vulnerability that leads to an abort (SIGABRT) when processing a crafted ELF binary with… vulnerability
  • CVE-2025-59399 libocpp before 0.28.0 allows a denial of service (EVerest crash) because a secondary exception is thrown during error message generation. vulnerability
  • CVE-2025-32439 pleezer is a headless Deezer Connect player. vulnerability
  • CVE-2025-30157 Envoy is a cloud-native high-performance edge/middle/service proxy. vulnerability
  • CVE-2024-12289 Boundary Community Edition and Boundary Enterprise (“Boundary”) incorrectly handle HTTP requests during the initialization of the Boundary… vulnerability
  • CVE-2024-20354 A vulnerability in the handling of encrypted wireless frames of Cisco Aironet Access Point (AP) Software could allow an unauthenticated,… vulnerability
  • CVE-2024-0316 Improper cleanup vulnerability in exceptions thrown in FireEye Endpoint Security, affecting version 5.2.0.958244. vulnerability
  • CVE-2023-46393 gougucms v4.08.18 was discovered to contain a password reset poisoning vulnerability which allows attackers to arbitrarily reset users'… vulnerability
  • CVE-2022-4744 A double-free flaw was found in the Linux kernel’s TUN/TAP device driver functionality in how a user registers the device when the… vulnerability
  • CVE-2022-3707 A double-free memory flaw was found in the Linux kernel. vulnerability
  • CVE-2022-3301 Improper Cleanup on Thrown Exception in GitHub repository ikus060/rdiffweb prior to 2.4.8. vulnerability
  • CVE-2022-22150 A memory corruption vulnerability exists in the JavaScript engine of Foxit Software’s PDF Reader, version 11.1.0.52543. vulnerability
  • CVE-2021-34716 A vulnerability in the web-based management interface of Cisco Expressway Series and Cisco TelePresence Video Communication Server (VCS)… vulnerability
  • CVE-2020-14304 A memory disclosure flaw was found in the Linux kernel's ethernet drivers, in the way it read data from the EEPROM of the device. vulnerability
  • CVE-2019-14891 A flaw was found in cri-o, as a result of all pod-related processes being placed in the same memory cgroup. vulnerability
  • CVE-2017-9657 Under specific 802.11 network conditions, a partial re-association of the Philips IntelliVue MX40 Version B.06.18 WLAN monitor to the… vulnerability
  • CVE-2016-9592 openshift before versions 3.3.1.11, 3.2.1.23, 3.4 is vulnerable to a flaw when a volume fails to detach, which causes the delete operation… vulnerability
  • CVE-2017-15127 A flaw was found in the hugetlb_mcopy_atomic_pte function in mm/hugetlb.c in the Linux kernel before 4.13. vulnerability

Referenced by OWASP · mapped cwe (1)

  • A10:2025 Mishandling of Exceptional Conditions Top 10 2025