You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Heap buffer overflow in cuJSONLinesIterator::gotoArrayIndex #5
cuJSONLinesIterator::gotoArrayIndex mirrors the standard iterator traversal logic and can advance nextNode beyond the valid parsed structure when an operation sequence requests an invalid array element, producing a host-side heap-buffer-overflow.
Root cause
The JSON Lines iterator shares the standard iterator's traversal logic and likewise lacks bounds checks around nextNode, node, pair_pos, and structural-array accesses. An out-of-range array index drives the iterator past the parsed structure and reads past the heap buffer.
Malformed JSON Lines input plus iterator operations can crash the host process and risk adjacent heap access in services that expose iterator navigation.
==3418215==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7b9d4b70457f
SUMMARY: AddressSanitizer: heap-buffer-overflow in cuJSONLinesIterator::gotoArrayIndex(int)
Suggested fix
Add explicit bounds checks around nextNode, node, pair_pos, and structural-array accesses. Reject out-of-range array indices before traversal mutates iterator state.
Attachments
The following files from this finding are attached:
Fixed by #16, which lands the bounds checks from #10 with a corrected byte-length bound.
Verified on A100 (sm_80): with AddressSanitizer, master reports heap-buffer-overflow in cuJSONLinesIterator::getChar — the structural[0] = 0 sentinel makes pos = -1, so inputJSON[-1] is read on every getChar(0). After #16 the same adversarial navigation runs (index 1000000, 2147483000, and 40 chained gotoArrayIndex(0) calls) are completely clean, and getChar(0) correctly returns '['.
Query results are byte-identical to the previous master across the paper's TT1-TT4 patterns plus deep-record probes, and all four shipped entry points produce identical output at scale (842 MB / 873 MB datasets, 61M elements).
The fix was applied to all three copies of the iterator, including paper_reproduced/user_interface/src/query/ which the original PR did not cover.
Activity
ashkanvg commentedon Sep 10, 2026
Fixed by #16, which lands the bounds checks from #10 with a corrected byte-length bound.
Verified on A100 (sm_80): with AddressSanitizer, master reports
heap-buffer-overflowincuJSONLinesIterator::getChar— thestructural[0] = 0sentinel makespos = -1, soinputJSON[-1]is read on everygetChar(0). After #16 the same adversarial navigation runs (index 1000000, 2147483000, and 40 chainedgotoArrayIndex(0)calls) are completely clean, andgetChar(0)correctly returns'['.Query results are byte-identical to the previous master across the paper's TT1-TT4 patterns plus deep-record probes, and all four shipped entry points produce identical output at scale (842 MB / 873 MB datasets, 61M elements).
The fix was applied to all three copies of the iterator, including
paper_reproduced/user_interface/src/query/which the original PR did not cover.Bound getChar() by the JSON byte length, not the token count