CVE-2026-58041

nodejs: Node.js node:sqlite: Unintended data modification due to stale statement iterator

Published Aug 4, 2026 CVSS 3.1 · 5.3 Medium EPSS < 1% KEV · Not listed
Description
A flaw in Node.js node:sqlite allows a stale StatementSyncIterator created through DatabaseSync#createTagStore() to continue executing a cached prepared statement after it has been reset and rebound with new parameters. SQLTagStore resets cached statements using sqlite3_reset() directly, bypassing the iterator invalidation mechanism introduced for StatementSync in recent releases

This vulnerability affects Node.js **22.x**, **24.x**, and **26.x**.

Analysis

AI-generated

Technical impact

The flaw allows a stale StatementSyncIterator to continue executing a cached prepared SQL statement even after the statement has been reset and rebound with different parameters. This bypasses the iterator invalidation mechanism introduced for StatementSync. As a result, a query can run with unintended parameters, potentially exposing sensitive data or modifying data in ways not intended by the application. The weakness is a form of iterator misuse (CWE‑367) that can undermine database integrity and confidentiality.

Affected Systems

Node.js running versions 22.x, 24.x, and 26.x are affected. The vulnerability is present in the node:sqlite component of the Node.js runtime.

Risk and Exploitability

The assigned CVSS score of 5.3 indicates a medium impact. No EPSS score is available, and the issue is not listed in the CISA KEV catalog, suggesting that known exploitation is not documented. The likely attack vector is local or within an application that runs with sufficient privileges to execute code that resets sqlite statements, such as a web application server. An attacker with code execution authority could trigger the stale iterator to run queries with injected parameters, leading to unauthorized data access or modification.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Update Node.js to the latest release that includes the fix for the stale StatementSyncIterator issue.
  • Refactor code that uses DatabaseSync#createTagStore() to ensure cached statements are not reset while iterators are still active; consider performing a manual iterator invalidation or avoiding use of stale iterators.
  • Audit sqlite interactions for patterns that may trigger reset during iterator usage and add defensive checks or wrap accesses in transactions that enforce iterator state consistency.

Generated by OpenCVE AI on August 4, 2026 at 09:26 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Title Stale Prepared Statement Execution After Reset in Node.js SQLite nodejs: Node.js node:sqlite: Unintended data modification due to stale statement iterator
References
Metrics threat_severity

None

cvssV3_1

{'score': 5.3, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N'}

threat_severity

Moderate

Type Values Removed Values Added
First Time appeared Nodejs
Nodejs nodejs
Vendors & Products Nodejs
Nodejs nodejs
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Title Stale Prepared Statement Execution After Reset in Node.js SQLite
Type Values Removed Values Added
Description A flaw in Node.js node:sqlite allows a stale StatementSyncIterator created through DatabaseSync#createTagStore() to continue executing a cached prepared statement after it has been reset and rebound with new parameters. SQLTagStore resets cached statements using sqlite3_reset() directly, bypassing the iterator invalidation mechanism introduced for StatementSync in recent releases This vulnerability affects Node.js **22.x**, **24.x**, and **26.x**.
Weaknesses CWE-367
References
Metrics cvssV3_0

{'score': 5.3, 'vector': 'CVSS:3.0/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N'}

Weaknesses
  • CWE-367

    Time-of-check Time-of-use (TOCTOU) Race Condition

Sources

Status
PUBLISHED
Assigner
hackerone
Published
Updated
Aug 4, 2026, 3:04 PM
Reserved
Jun 27, 2026, 3:00 PM
Status
Awaiting Analysis
Published
Aug 4, 2026, 1:16 AM
Modified
Oct 23, 2026, 11:10 PM
Severity
Moderate
Public date
Aug 4, 2026, 12:49 AM