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

未關閉
#1,217 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

@lidavidm 已經在處理了。

開始於 2026年9月10日。

  • #1291 來自 @lidavidm —— 未關閉

評估

難度
4/5
預估耗時
3-5 天
新手友好度
25/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
停滯
技術堆疊
java
領域
security

研究方向

從 BaseVariableWidthViewVector 開始,檢查 getData、getDataPointer、hashCode、copyFromNotNull 和 splitAndTransferViewBufferAndDataBuffer 中對 out-of-line view 的處理。比較連結的 pull request,然後驗證損壞的 buffer 索引和 offset/length 範圍不再允許越界讀取,包括啟用 unsafe memory access 的情況。

由索引模型根據 Issue 內容生成。

描述

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

主要語言
Java
星號
95
分支
154
平均合併
2 天 10 小時
30 天內合併 PR
11

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

apache/arrow-java 的其他 Issue

查看 apache/arrow-java 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。