Skip to content

Bound EPUB metadata before parsing - #10

Merged
dlpwaters merged 1 commit into
mainfrom
fix/bounded-epub-metadata
Aug 23, 2026
Merged

dlpwaters merged 1 commit into
mainfrom
fix/bounded-epub-metadata

Conversation

@dlpwaters

Copy link
Copy Markdown
Owner

Summary

  • cap META-INF/container.xml at 64 KiB and package OPF XML at 2 MiB from ZIP descriptors before decompression
  • independently cap actual member reads at limit + 1, reject descriptor/actual-size mismatches, encrypted members, and unsafe member paths
  • use the same bounded reader in both normal EPUB metadata scanning and cover discovery
  • cap sidecar metadata.opf files at the same 2 MiB limit
  • bump Leaf Reader to 1.1.4 and document the metadata limits

Verification

  • all 21 Python tests pass, including malicious oversized container/OPF members and a descriptor/actual-byte mismatch
  • omarchy plugin validate .
  • qmllint -I /usr/share/omarchy/shell BarWidget.qml Panel.qml ReaderApp.qml
  • Python, JavaScript, JSON, starter-book checksum, and EPUB archive checks
  • git diff --check

Marketplace submission: omacom/omarchy-plugin-marketplace#1393

@dlpwaters
dlpwaters merged commit 1139f66 into main Aug 23, 2026
2 checks passed
@dlpwaters
dlpwaters deleted the fix/bounded-epub-metadata branch August 23, 2026 17:39
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.

1 participant