Skip to content
OpenAdvisories

Weakness (CWE)

CWE-666: Operation on Resource in Wrong Phase of Lifetime

Class Draft Mapping discouraged

The product performs an operation on a resource at the wrong phase of the resource's lifecycle, which can lead to unexpected behaviors.

How to prevent it (2 mitigations)
  1. Architecture and Design

    Follow the resource's lifecycle from creation to release.

  2. Implementation

    For each phase, it is important to follow the specifications outlined for how to operate on the resource and to ensure that the resource is in the expected phase. Otherwise, if a resource is in one phase but the operation is not valid for that phase (i.e., an incorrect phase of the resource's lifetime), then this can produce resultant weaknesses.

Source: MITRE CWE-666

6 results · Feed

  • Medium 5.7

    Bluetooth Classic AVDTP session reuse re-initializes a queued work item, corrupting the system work queue

    The Bluetooth Classic AVDTP layer defers releasing a session's stream endpoints: bt_avdtp_l2cap_disconnected() in subsys/bluetooth/host/classic/avdtp.c ends with k_work_submit(&session->_release_work), placing the embedded struct k_work on the system work que…

  • Medium 4.6

    Kernel panic in the it82xx2 USB device controller driver via re-initialization of a busy delayable work item

    The ITE it82xx2 USB device-controller driver initialized its bus-suspend detection work with k_work_init_delayable(&priv->suspended_work, suspended_handler) inside it82xx2_enable() (the driver's .enable op) in drivers/usb/udc/udc_it82xx2.c. This work item is …

  • Medium 5.4

    Missing channel-state validation in Zephyr Bluetooth Classic L2CAP receive path

    The Bluetooth Classic (BR/EDR) L2CAP receive handler bt_l2cap_br_recv() in subsys/bluetooth/host/classic/l2cap_br.c dispatched inbound data PDUs based only on the destination channel ID, without checking that the target channel had reached the BT_L2CAP_CONNEC…

  • Medium 6.5

    Russh: Channel-scoped server callbacks can be reached without an open channel

    Russh is a Rust SSH client & server library. Prior to 0.62.5, russh dispatches channel-scoped Handler callbacks for recipient channel IDs that were never opened or confirmed in russh/src/server/encrypted.rs, server_read_authenticated, and the exec_request cal…

  • Critical 9.8

    idpf: fix read_dev_clk_lock spinlock init in idpf_ptp_init()

    In the Linux kernel, the following vulnerability has been resolved: idpf: fix read_dev_clk_lock spinlock init in idpf_ptp_init() In idpf_ptp_init(), read_dev_clk_lock is initialized after ptp_schedule_worker() had already been called (and after idpf_ptp_setti…

  • Low —

    Rust XCB `xcb::Connection::connect_to_fd*` functions violate I/O safety

    The API of `xcb::Connection` has constructors which allow an arbitrary `RawFd` to be used as a socket connection. On either failure of these constructors or on the drop of `Connection`, it closes the associated file descriptor. Thus, a program which uses an `…