Skip to content

GH-1217: validate view data offsets in BaseVariableWidthViewVector#1218

Open
Arawoof06 wants to merge 1 commit into
apache:mainfrom
Arawoof06:view-vector-offset-bounds
Open

GH-1217: validate view data offsets in BaseVariableWidthViewVector#1218
Arawoof06 wants to merge 1 commit into
apache:mainfrom
Arawoof06:view-vector-offset-bounds

Conversation

@Arawoof06

Copy link
Copy Markdown
Contributor

What's Changed

Utf8View and BinaryView values longer than 12 bytes live in a separate data buffer, with the data-buffer index and offset stored inline in the view; when a vector is read from an IPC stream those fields come from untrusted input. BaseVariableWidthViewVector dereferenced them without checking that the index is present or that offset+length stays inside the data buffer, so a crafted view reads past the buffer (and returns arbitrary native heap when arrow.enable_unsafe_memory_access is set). Routed every out-of-line dereference (get, getDataPointer, hashCode, copyFrom, splitAndTransfer) through one getValidatedDataBuffer check so a bad view is rejected at the source rather than in each caller.

Closes #1217.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

Thank you for opening a pull request!

Please label the PR with one or more of:

  • bug-fix
  • chore
  • dependencies
  • documentation
  • enhancement

Also, add the 'breaking-change' label if appropriate.

See CONTRIBUTING.md for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant