Out-of-bounds read for corrupt view offsets in BaseVariableWidthViewVector

Đang mở
#1,217 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

@lidavidm đang làm issue này rồi.

Từ ngày 10/9/2026.

  • #1291 của @lidavidm — đang mở

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
java
Lĩnh vực
security

Hướng nghiên cứu

Bắt đầu trong BaseVariableWidthViewVector và kiểm tra cách xử lý view out-of-line trong getData, getDataPointer, hashCode, copyFromNotNull và splitAndTransferViewBufferAndDataBuffer. So sánh pull request được liên kết, sau đó xác minh rằng các chỉ mục buffer bị hỏng và các phạm vi offset/length không còn cho phép đọc vượt quá giới hạn, kể cả khi unsafe memory access được bật.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Describe the bug

ViewVarCharVector/ViewVarBinaryVector store values longer than INLINE_SIZE (12 bytes) out of line, encoding a data-buffer index and an offset inline in the view buffer. When a vector is loaded from an IPC stream these fields come straight from the input.

BaseVariableWidthViewVector dereferences them verbatim in getData, getDataPointer, hashCode, copyFromNotNull and splitAndTransferViewBufferAndDataBuffer, e.g.

dataBuffers.get(bufferIndex).getBytes(dataOffset, result, 0, dataLength);

Nothing checks that bufferIndex is in range or that dataOffset + dataLength fits inside the referenced data buffer. A crafted view whose offset/length points past the data buffer produces an out-of-bounds read: with the default bounds checking it throws IndexOutOfBoundsException, but with arrow.enable_unsafe_memory_access=true (commonly set in production) it reads arbitrary native heap into the returned value.

Component(s)

Java

Ngôn ngữ chính
Java
Star
95
Fork
154
Merge trung bình
2 ngày 16 giờ
Pull request đã merge (30 ngày)
9

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của apache/arrow-java

Tất cả issue của apache/arrow-java

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.