deps: cherry-pick e807d4e379 from SQLite#63525
Conversation
|
Review requested:
|
louwers
left a comment
There was a problem hiding this comment.
We should just stick to the regular SQLite release cadence I think.
|
Thanks for reviewing, @louwers. I opened this PR because the disclosed HackerOne thread suggested that the If the project prefers to wait for the regular SQLite release cadence instead, |
There was a problem hiding this comment.
I'm agnostic towards merging, but we definitely shouldn't be regression testing on sqlite3's behalf, as it'll cause havoc with shared builds.
There was a problem hiding this comment.
Agreed, thanks. I pushed an update to skip this regression test when Node is
built with shared SQLite, so it only runs against the bundled SQLite copy that
this PR patches.
If you would prefer not to carry this SQLite regression test in Node at all,
I’m happy to remove it.
There was a problem hiding this comment.
It should be removed, yes. We're not aiming to test the behaviour of sqlite3, just our binding.
There was a problem hiding this comment.
If it wasn't for the fact that the fix that makes the process not crash hasn't been in a SQLite release yet, the added test would not raise any eyebrow, we can find similar tests in e.g.
node/test/parallel/test-sqlite-session.js
Lines 346 to 349 in 8257091
IMO it's not a blocking concern
Backport the SQLite session extension fix for corrupt changesets that omit old values for primary-key columns. This avoids passing NULL to sessionBindValue() while applying UPDATE changesets. Refs: https://sqlite.org/src/info/e807d4e3798efd53 Signed-off-by: junius-sec <sksch323@naver.com>
0844bba to
f0cdb8e
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #63525 +/- ##
==========================================
+ Coverage 90.05% 90.32% +0.27%
==========================================
Files 714 730 +16
Lines 225742 234205 +8463
Branches 42727 43919 +1192
==========================================
+ Hits 203285 211555 +8270
- Misses 14234 14373 +139
- Partials 8223 8277 +54 🚀 New features to boost your workflow:
|
|
@aduh95 @junius-sec Why are we manually patching instead of the regular automated updates? how would this affect future automated updates? |
|
Without this patch, the process crashes with an uncatchable error, which is IMO bad enough. It will not affect future automated updates, next update will as always overwrite the entire directory. Floating patches that have landed upstream is not out of the ordinary |
|
@atlowChemi Thanks for the question. The reason for the manual patch is that the current behavior can crash the process with attacker-controlled input, so I think it’s worth fixing now rather than waiting for the next automated update. I also agree with aduh95 that this shouldn’t affect future automated updates, since the next update will overwrite the whole directory anyway. |
|
Landed in d8ac301 |
Original commit message:
Fix a bug causing the session module to dereference a NULL pointer when applying a corrupt changeset.
FossilOrigin-Name: e807d4e3798efd532b3d78d1dfe513ed4fbd3cb793dd0ae5c30cae6031422b10
Refs: https://sqlite.org/src/info/e807d4e3798efd53
Signed-off-by: junius-sec <sksch323@naver.com>
PR-URL: #63525
Refs: https://hackerone.com/reports/3736889
Refs: sqlite/sqlite@b869ed6
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Backport the SQLite session extension fix for malformed changesets that omit
old values for primary-key columns. The upstream fix avoids passing NULL to
sessionBindValue() while applying UPDATE changesets.
This adds a regression test for
DatabaseSync#applyChangeset()to verify thatthe malformed changeset returns
SQLITE_CORRUPTinstead of crashing.Refs: https://sqlite.org/src/info/e807d4e3798efd53
Refs: https://hackerone.com/reports/3736889
Refs: sqlite/sqlite@b869ed6
Tested on Linux x64: