Skip to content

Validate binary plist structure and bound reads - #62

Merged
joeferner merged 3 commits into
joeferner:masterfrom
dnicolson:validate-binary-structure
Nov 25, 2026
Merged

joeferner merged 3 commits into
joeferner:masterfrom
dnicolson:validate-binary-structure

Conversation

@dnicolson

@dnicolson dnicolson commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Validates the binary plist trailer, offset table and object offsets against the buffer, and routes all object payload reads through a bounds-checked readObjectBytes so malformed input throws a clear Invalid binary plist error instead of silently returning garbage.

Behavior changes (worth a minor version bump):

  • Trailer values are read as 64-bit bigint and range-checked (offset/ref size 1–8, object count ≥ 1, top object and offset table within the file).
  • Non-integer extended length markers and date markers other than 0x33 now throw instead of logging via console.error (matches CoreFoundation).

Maintainer follow-up: merged master (#61) into the branch, routed parseUID through readObjectBytes, and dropped the duplicate test-local readBigUInt.

🤖 Generated with Claude Code

dnicolson and others added 3 commits November 21, 2026 23:30
Route parseUID through readObjectBytes so a truncated UID throws instead
of silently reading past the object data area, and replace the test-local
readBigUInt copy with Buffer#readBigUInt64BE.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@joeferner
joeferner merged commit fba081c into joeferner:master Nov 25, 2026
3 checks passed
@joeferner joeferner mentioned this pull request Nov 25, 2026
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.

2 participants