[PR #6699] fix(app-bundle): apply the Info.plist decode budget to XML plists #7391

Open
opened 2026-11-01 21:47:31 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/6699
Author: @Dextheking1
Created: 10/23/2026
Status: 🔄 Open

Base: main ← Head: fix/xml-plist-decode-budget


📝 Commits (4)

  • c34afa1 fix(app-bundle): apply the plist decode budget to the XML branch
  • 58ec312 test(app-bundle): cover the XML plist decode budget
  • db03ff0 decode xml plist once, pass the text to the decode preflight
  • 9754828 Merge main into fix/xml-plist-decode-budget and port the XML decode budget onto it

📊 Changes

2 files changed (+29 additions, -7 deletions)

View changed files

📝 src/application/AppBundleExecutable.test.ts (+18 -0)
📝 src/application/AppBundleExecutable.ts (+11 -7)

📄 Description

Summary

Fix: the XML branch of app bundle Info.plist resolution now runs the same decode budget preflight as the binary branch in the same function.

Problem and expected behavior

In resolveLayoutExecutable (src/application/AppBundleExecutable.ts), the binary Info.plist branch enforces a 16 MiB decoded budget through preflightPropertyListDecode, but the XML branch parsed whatever readFile returned with no input cap and no preflight. A crafted app bundle with a very large XML Info.plist (verified at 80 MiB) was accepted and resolved, while sibling plist paths cap input at 64 MiB. Expected: the decode budget for one Info.plist does not depend on its encoding.

Change and scope

The XML branch now goes through a small helper that calls preflightPropertyListDecode(plist, BINARY_PLIST_DECODE_BYTES) before decoding, mirroring the binary branch. Nothing else changes. Scope is one function plus one regression test; if a larger XML budget is preferred, the constant is the single place to tune.

Two bounds stay distinct. This preflight bounds the projected decode size. It does not bound the initial read: the resolver still reads the whole file into memory before the preflight runs, so an oversized file is allocated once before it can be refused. Bounding that first read is a separate change and is not claimed here.

Evidence and regression coverage

  • Tests added or updated: new case in src/application/AppBundleExecutable.test.ts (app bundle Info.plist decode budget) writes a bundle whose XML Info.plist carries a 5,000,000 character padding string, projecting past the 16 MiB budget, and expects resolution to refuse.
  • Base reproduction or other evidence: executed. The real resolveAppBundleExecutable from the base revision accepted an 80 MiB XML Info.plist and resolved the executable. With this change, the over-budget XML plist is refused.
  • User-visible CLI/MCP output (if applicable): an over-budget XML Info.plist now fails bundle resolution with the existing decode error path, the same shape as an over-budget binary plist.
  • Remaining proof gaps: none for the decode path. The unbounded initial read described above stays as the known remaining limit.

Validation performed

  • npx vitest run src/application/AppBundleExecutable.test.ts src/application/HopperDownload.test.ts src/application/LinuxHopper.test.ts - 60 passed (run includes the sibling fix's suite; this PR's own file passed in full)
  • npx vitest run tests/boundary/filesystem/binaryTarget.test.ts src/application/AppBundleExecutable.openStep.test.ts src/application/AppBundleOpenStepDepth.test.ts src/application/AppBundleResourceRoot.test.ts - passed
  • node scripts/run-typescript.mjs --noEmit - clean
  • npx oxfmt --check and npx oxlint on the changed files - clean

Compatibility, safety, and release

  • Breaking changes or migration steps: a bundle whose XML Info.plist projects past the 16 MiB decode budget is now refused instead of resolved. That matches the binary branch; legitimate Info.plist files are far below the budget.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable; verified through the resolver's own unit and boundary suites.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: closes a local memory-budget gap on untrusted bundle input. No new authority, no network, no process changes.

Contract and boundary impact

  • Semantic owner and earliest changed stage: see above.
  • Contribution scope fit and linked maintainer decision: ordinary fix within an existing boundary; not applicable.
  • CLI and MCP/tool-catalog contract: unchanged.
  • Provider, bridge, target-format, or platform compatibility: unchanged.
  • Evidence, artifact, provenance, or reconstruction contract: unchanged.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs and skills/; edit authored instructions in .agents/skills/reverse-engineer-anything/ and never commit build outputs): none.

Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Author readiness

Human owner: @Dextheking1

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/6699 **Author:** [@Dextheking1](https://github.com/Dextheking1) **Created:** 10/23/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/xml-plist-decode-budget` --- ### 📝 Commits (4) - [`c34afa1`](https://github.com/morluto/rea/commit/c34afa13c9fd4eb64182f2a4306ca5ed205315a8) fix(app-bundle): apply the plist decode budget to the XML branch - [`58ec312`](https://github.com/morluto/rea/commit/58ec31273af164378de62113add11ff7de441847) test(app-bundle): cover the XML plist decode budget - [`db03ff0`](https://github.com/morluto/rea/commit/db03ff06535b5096fbe2dd7c1cfe50a2f0d7bdbd) decode xml plist once, pass the text to the decode preflight - [`9754828`](https://github.com/morluto/rea/commit/975482884f8353785f265f817b1df88542d11feb) Merge main into fix/xml-plist-decode-budget and port the XML decode budget onto it ### 📊 Changes **2 files changed** (+29 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `src/application/AppBundleExecutable.test.ts` (+18 -0) 📝 `src/application/AppBundleExecutable.ts` (+11 -7) </details> ### 📄 Description ## Summary Fix: the XML branch of app bundle Info.plist resolution now runs the same decode budget preflight as the binary branch in the same function. ## Problem and expected behavior In `resolveLayoutExecutable` (`src/application/AppBundleExecutable.ts`), the binary Info.plist branch enforces a 16 MiB decoded budget through `preflightPropertyListDecode`, but the XML branch parsed whatever `readFile` returned with no input cap and no preflight. A crafted app bundle with a very large XML Info.plist (verified at 80 MiB) was accepted and resolved, while sibling plist paths cap input at 64 MiB. Expected: the decode budget for one Info.plist does not depend on its encoding. ## Change and scope The XML branch now goes through a small helper that calls `preflightPropertyListDecode(plist, BINARY_PLIST_DECODE_BYTES)` before decoding, mirroring the binary branch. Nothing else changes. Scope is one function plus one regression test; if a larger XML budget is preferred, the constant is the single place to tune. Two bounds stay distinct. This preflight bounds the projected decode size. It does not bound the initial read: the resolver still reads the whole file into memory before the preflight runs, so an oversized file is allocated once before it can be refused. Bounding that first read is a separate change and is not claimed here. ## Evidence and regression coverage - Tests added or updated: new case in `src/application/AppBundleExecutable.test.ts` (app bundle Info.plist decode budget) writes a bundle whose XML Info.plist carries a 5,000,000 character padding string, projecting past the 16 MiB budget, and expects resolution to refuse. - Base reproduction or other evidence: executed. The real `resolveAppBundleExecutable` from the base revision accepted an 80 MiB XML Info.plist and resolved the executable. With this change, the over-budget XML plist is refused. - User-visible CLI/MCP output (if applicable): an over-budget XML Info.plist now fails bundle resolution with the existing decode error path, the same shape as an over-budget binary plist. - Remaining proof gaps: none for the decode path. The unbounded initial read described above stays as the known remaining limit. ## Validation performed - `npx vitest run src/application/AppBundleExecutable.test.ts src/application/HopperDownload.test.ts src/application/LinuxHopper.test.ts` - 60 passed (run includes the sibling fix's suite; this PR's own file passed in full) - `npx vitest run tests/boundary/filesystem/binaryTarget.test.ts src/application/AppBundleExecutable.openStep.test.ts src/application/AppBundleOpenStepDepth.test.ts src/application/AppBundleResourceRoot.test.ts` - passed - `node scripts/run-typescript.mjs --noEmit` - clean - `npx oxfmt --check` and `npx oxlint` on the changed files - clean ## Compatibility, safety, and release - Breaking changes or migration steps: a bundle whose XML Info.plist projects past the 16 MiB decode budget is now refused instead of resolved. That matches the binary branch; legitimate Info.plist files are far below the budget. - Real Hopper/Ghidra, browser, or OS coverage: not applicable; verified through the resolver's own unit and boundary suites. - Package or release metadata impact: none. - Security, privacy, process, or containment review: closes a local memory-budget gap on untrusted bundle input. No new authority, no network, no process changes. ## Contract and boundary impact - Semantic owner and earliest changed stage: see above. - Contribution scope fit and linked maintainer decision: ordinary fix within an existing boundary; not applicable. - CLI and MCP/tool-catalog contract: unchanged. - Provider, bridge, target-format, or platform compatibility: unchanged. - Evidence, artifact, provenance, or reconstruction contract: unchanged. - Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable. - Generated metadata (`docs/public/product-catalog.json`), package, or installation impact (CI generates and validates ignored catalogs and `skills/`; edit authored instructions in `.agents/skills/reverse-engineer-anything/` and never commit build outputs): none. Expected effects (check known effects; use documentation-only on its own). Unchecked items do not establish absence; leave uncertainties visible. - [ ] Read existing files or captured data. - [ ] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [ ] Change process memory, registers, files, or configuration. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [ ] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. ## Author readiness Human owner: @Dextheking1 - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. ## Before merge - [ ] This PR addresses a concrete problem or an agreed enhancement. - [ ] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [ ] The PR has one focused outcome and the title follows `type(scope): outcome`. - [ ] Related issue is linked, or the reason for not linking one is stated above. - [ ] Tests cover changed observable behavior and meaningful failure paths. - [ ] Owning docs, contracts, and generated metadata are updated where needed. - [ ] User-visible CLI/MCP changes include representative output. - [ ] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#7391
No description provided.