Buffer overflow in Database.run()
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 38/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript, sqlite, wasm
- Domain
- databases
Research direction
Start from the documented Database.run() function and reproduce the failure with a large input containing about 5,000 INSERT statements. Trace how the input is handled until the memory access error occurs; done means the input no longer causes memory corruption, or any remaining limit is safely handled and documented.
Written by the indexing model from the issue text.
Description
If a large enough string (in my case, 5k INSERT statements) is passed to the Database run() function, this leads to a buffer overflow and some kind of memory corruption. Afterwards, all sql.js functions fail with a memory access out of bounds error.
Either the input length should be unlimited, or the limit should be well documented and better handled to avoid memory corruption.
My workaround is to split into individual statements and run one at a time, which runs a bit slower due to the added overhead.
- Dominant language
- JavaScript
- Stars
- 13.7k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from sql-js/sql.js
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Similar issues
-
curation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
amponce/archive-movie-browser#186 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
clerk/javascript#9852 ·
-
bug p1 tools
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
factory-active factory-automatic task-bug-reproduction-cannot-reproduce task-identify-harness-labels-done task-identify-issue-type-done
Difficulty 2/5 1-3 hours Newbie friendliness 84/100