node:sqlite SQLTagStore Iterator Replay Lets Attacker Re-Execute Victim-Bound Writes Indefinitely
A stale iterator from node:sqlite's tag store can keep running a cached prepared statement after it has been reset and rebound with new parameters.
Originally disclosed on HackerOne
- Triaged in 5 days
- Fixed in 48 days
- Disclosed after 3 months
Summary by the program
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.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the tag store resets cached statements with sqlite3_reset() directly, skipping the iterator invalidation that StatementSync performs.
What the attacker needed
Use of node:sqlite tag store; a stale iterator is retained
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Node.js has a built-in database feature called node:sqlite. It keeps prepared statements (pre-written database commands) in a cache and reuses them. The bug is that an old handle to one of those cached commands is not invalidated when the command is reset and given new values, so the old handle can still run it with whatever values are currently bound.
What is Race condition?
Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.