Title: sqlite: use-after-free when Session.close() is called reentrantly · Issue #65347 · nodejs/node · GitHub
Open Graph Title: sqlite: use-after-free when Session.close() is called reentrantly · Issue #65347 · nodejs/node
X Title: sqlite: use-after-free when Session.close() is called reentrantly · Issue #65347 · nodejs/node
Description: Version main Platform N/A Subsystem sqlite What steps will reproduce the bug? import { DatabaseSync, constants } from 'node:sqlite'; const db = new DatabaseSync(':memory:'); db.exec('CREATE TABLE t(id INTEGER PRIMARY KEY, value TEXT)'); ...
Open Graph Description: Version main Platform N/A Subsystem sqlite What steps will reproduce the bug? import { DatabaseSync, constants } from 'node:sqlite'; const db = new DatabaseSync(':memory:'); db.exec('CREATE TABLE t...
X Description: Version main Platform N/A Subsystem sqlite What steps will reproduce the bug? import { DatabaseSync, constants } from 'node:sqlite'; const db = new DatabaseSync(':memory:'); db.exec...
Opengraph URL: https://github.com/nodejs/node/issues/65347
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"sqlite: use-after-free when Session.close() is called reentrantly","articleBody":"### Version\n\nmain\n\n### Platform\n\n```text\nN/A\n```\n\n### Subsystem\n\nsqlite\n\n### What steps will reproduce the bug?\n\n```js\nimport { DatabaseSync, constants } from 'node:sqlite';\n\nconst db = new DatabaseSync(':memory:');\ndb.exec('CREATE TABLE t(id INTEGER PRIMARY KEY, value TEXT)');\nconst session = db.createSession({ table: 't' });\ndb.exec(\"INSERT INTO t VALUES (1, 'a'), (2, 'b'), (3, 'c')\");\n\ndb.setAuthorizer(() => {\n session.close();\n return constants.SQLITE_OK;\n});\n\ntry {\n console.log(session.changeset().length);\n} catch (err) {\n console.log(`${err.name}: ${err.message}`);\n}\n```\n\n### How often does it reproduce? Is there a required condition?\n\nAlways\n\n### What is the expected behavior? Why is that the expected behavior?\n\nIt should fail without freeing the active native session out from under the in-progress operation.\n\n### What do you see instead?\n\n```console\nError: session is not open\n```\n\nCalling `changeset()` enters SQLite session changeset generation, which runs SQL internally and invokes the authorizer. The authorizer closes the same `Session` reentrantly, so native changeset generation continues after the underlying session has been deleted.\n\n### Additional information\n\n_No response_","author":{"url":"https://github.com/trivikr","@type":"Person","name":"trivikr"},"datePublished":"2026-08-17T06:17:45Z","url":"https://github.com/nodejs/node/issues/65347"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:fe96b7fc-2e68-f21f-d9cd-a02c8a92717f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BEF2:34BF50:11E01EF:17F2C17:6AED5C7E |
| html-safe-nonce | 998a6a5ad79c9f923a813ffaee418a9fa78a8863c5586afa4ddb76f2a1a75d6b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRUYyOjM0QkY1MDoxMUUwMUVGOjE3RjJDMTc6NkFFRDVDN0UiLCJ2aXNpdG9yX2lkIjoiODk0MzI3NTk2OTc3ODM3NTgwNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | fbe5fa6c691251d0adf4e52ed47ec4741c627fd97c9fd204c75512d800cadfa4 |
| hovercard-subject-tag | issue:5168891531 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/65347/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3f51b1846a94ed7adfad0dd4917283772173a0b8e9e594ee4f02ee517d61a742/nodejs/node/issues/65347 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3f51b1846a94ed7adfad0dd4917283772173a0b8e9e594ee4f02ee517d61a742/nodejs/node/issues/65347 |
| og:image:alt | Version main Platform N/A Subsystem sqlite What steps will reproduce the bug? import { DatabaseSync, constants } from 'node:sqlite'; const db = new DatabaseSync(':memory:'); db.exec('CREATE TABLE t... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | trivikr |
| hostname | github.com |
| expected-hostname | github.com |
| None | 56fb42677ae87ed3e64410323d67980aa65d0485568a7858f874e7edfc6d1c11 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9c9a37e2423ed382cf39f70b5aa4b4858b40a3b0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width