---
title: "CWE-619: Dangling Database Cursor"
url: https://radicalnotion.ai/cwe/cwe-619
type: cwe
description: "The product does not close a database cursor properly, leaving the cursor \"dangling.\""
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-619: Dangling Database Cursor

- **Abstraction:** Base
- **Structure:** Simple
- **Status:** Incomplete
- **CVEs with this as primary weakness:** 0
- **Of those, in CISA KEV:** 0
- **New in 2026:** 0
- **CWE catalog version:** 4.21

## Description

The product does not close a database cursor properly, leaving the cursor "dangling."

## Background

A cursor is a feature in Oracle PL/SQL and other languages that provides a handle for executing and accessing the results of SQL queries.

## Alternate terms

- Cursor Injection

## Modes of introduction

| Phase | Note |
| --- | --- |
| Implementation | This issue is currently reported for unhandled exceptions, but it is theoretically possible any time the programmer does not close the cursor at the proper time. |

## Applicable platforms

**Languages:** SQL (Undetermined)

**Technologies:** Database Server (Undetermined)

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Confidentiality, Integrity | Read Application Data, Modify Application Data | The cursor could become accessible to other users while retaining the same privileges that were originally assigned. The impact of the issue depends on the cursor's role, but SQL injection attacks are commonly possible. |

## Potential mitigations

### Implementation

Close cursors immediately after access to them is complete. Ensure that you close cursors if exceptions occur.

## 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 weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-402](https://radicalnotion.ai/cwe/cwe-402) | Transmission of Private Resources into a New Sphere |
| Related | [CWE-404](https://radicalnotion.ai/cwe/cwe-404) | Improper Resource Shutdown or Release |

## Taxonomy mappings

| Taxonomy | Entry | Id | Fit |
| --- | --- | --- | --- |
| Software Fault Patterns | Tainted input to command | SFP24 | - |

## Frequently asked questions

### What is CWE-619?

The product does not close a database cursor properly, leaving the cursor "dangling."

### How do you prevent CWE-619?

Close cursors immediately after access to them is complete. Ensure that you close cursors if exceptions occur.

### How is CWE-619 detected?

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.)

### What are the consequences of CWE-619?

Exploiting CWE-619 can lead to: Read Application Data, Modify Application Data.

Primary source: [MITRE CWE](https://cwe.mitre.org/data/definitions/619.html)

---

Source: [RadicalNotion.AI](https://radicalnotion.ai/cwe/cwe-619). Licensed CC BY-NC 4.0; attribute RadicalNotion.AI and link the source page when you reuse this data.
