rea/tests/boundary/cli
nakshatra k 7711b00005
fix(apple): preflight XML plist nesting before keyed archive decoding (#2161)
* fix(apple): preflight XML plist nesting before keyed archive decoding

inspect_keyed_archive documented a 128-level nesting limit, but the XML
plist path reached recursive decoding before any depth check: plist and
the prototype-key traversal in parseXmlPropertyList recurse once per
nesting level, so a ~75 KiB, 3000-level XML plist exhausted the call
stack and reported Maximum call stack size exceeded instead of the
bounded-resource limit that shallower over-limit documents (129, 200)
already produced. The CLI classified both as truncated, so no crash or
classification bypass was involved; the diagnostic was the defect.

Reject excessive nesting in parseXmlPropertyList before any recursive
pass, using the projection's own limit (MAX_PLIST_DEPTH) so the error is
identical to the one projectPlistValue raises: callers keep the
limit/truncated classification with no error-handler translation. Depth
counts values the way the projection does - container members nest one
level deeper, dictionary keys name members rather than nesting, and a
self-closing element is the value at its own level - so the guard
rejects exactly the documents the projection rejected, at the same
boundary, and every in-limit document decodes unchanged. The guard sits
at the shared decoder boundary, so Interface Builder, app Info.plist
resolution and native inspect_plist gain the same deterministic limit;
the binary plist path keeps its existing expansion preflight.

Binary plist behavior, ordinary XML decode, __proto__ omission counting,
and archive digest/Evidence provenance are unchanged. OpenStep
autodetection is untouched by this guard, as the existing Interface
Builder preflight also scopes its depth check to XML.

Regression coverage: decoder unit tests at and just past the limit for
dictionary and array nesting with self-closing and opaque markup,
module tests through decodeKeyedArchiveBytes including a valid
NSKeyedArchiver XML envelope at the limit, a production-boundary test
through inspectBundleKeyedArchive, and the compiled public CLI
reporting code truncated / reason limit for a 3000-level plist.

* fix(apple): check XML nesting against parsed element structure

Reuse the iterative XML decoder document for depth preflight and prototype-key lookup. Bound recursive plist wrappers alongside dictionaries and arrays without interpreting markup inside attributes or DOCTYPE declarations as values.

Validated with 104 focused tests including compiled CLI, MCP prototype-key, and Interface Builder coverage; npm run check and verify:test-discovery passed. No real-provider verification was run.

---------

Co-authored-by: Zburgers <Zburgers@users.noreply.github.com>
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-10-12 23:12:10 +08:00
..
adbCli.test.ts fix(adb): preserve device paths and prevent destination collisions 2026-10-12 05:57:35 +08:00
analysisSelectorCli.test.ts fix(cli): accept exact native names through explicit selectors 2026-10-09 05:46:16 +08:00
analysisViewCli.test.ts feat(analysis): add opt-in retained inventory and WASM views (#2122) 2026-10-12 21:17:52 +08:00
androidCliCancellation.test.ts feat(android): integrate static APK analysis with headless JADX (#738) 2026-10-06 12:46:48 +00:00
apktoolCli.test.ts test(cli): consolidate schema coverage and assert input refusals 2026-10-12 05:24:33 +08:00
browserCli.test.ts fix(ci): synchronize browser fixture events before inspection (#1534) 2026-10-10 18:44:49 +08:00
browserCompareJsonFiles.test.ts fix(browser): bound screenshot comparison memory 2026-10-11 11:11:38 +08:00
browserRedirectShapeCompleteness.test.ts fix(cli): accept JSON files for web capture and screenshot comparisons (#1397) 2026-10-09 19:29:42 -07:00
cliCompileCache.test.ts test(cli): cache subprocess compilation within each worker 2026-10-11 18:01:32 +08:00
cliInputSchemaRequired.test.ts fix(cli): reuse firmware and web module input constraints 2026-10-12 12:37:00 +08:00
cliLogLevelConfiguration.test.ts fix(cli): report an invalid REA_LOG_LEVEL as configuration (#2140) 2026-10-12 06:07:37 -07:00
cliOptionAliases.test.ts fix(cli): preserve native option descriptions in help 2026-10-11 06:41:46 +08:00
cliOutput.test.ts refactor!: enforce canonical evidence and provider boundaries 2026-10-09 20:18:52 +08:00
cliServeHarness.ts fix(adb): share host configuration refusals with apktool (#1954) 2026-10-12 05:09:13 +08:00
cliSetup.test.ts fix(setup): register a stable launcher when run through bunx (#1731) 2026-10-11 19:17:15 +08:00
cliStartupImports.test.ts perf(cli): bundle runtime entries to reduce Windows startup I/O (#1996) 2026-10-12 09:25:27 +08:00
cliToolCoverage.test.ts refactor(catalog): import CLI metadata from its owner 2026-10-10 00:49:14 +08:00
clientProfileLifecycle.test.ts fix(setup): name each skill directory in the uninstall summary (#2118) 2026-10-12 04:55:15 -07:00
clientProfiles.test.ts perf(tests): reuse stateless workflows and immutable fixtures 2026-10-11 13:20:15 +08:00
developmentTests.test.ts chore(test): separate development feedback from full verification (#599) 2026-10-06 00:59:26 +08:00
dispatcher.test.ts fix(cli): report an invalid REA_LOG_LEVEL as configuration (#2140) 2026-10-12 06:07:37 -07:00
dylibResolutionCli.test.ts fix(apple): validate build-version tool records within cmdsize (#1784) 2026-10-11 17:50:56 +08:00
electronCli.test.ts refactor!: enforce canonical evidence and provider boundaries 2026-10-09 20:18:52 +08:00
electronWrappedCallPaths.test.ts fix(javascript): retain guards without duplicating observed IPC calls 2026-10-12 10:08:39 +08:00
evidenceBundleCommands.test.ts fix(io): retain cleanup ownership and honor cancellation 2026-10-12 14:12:44 +08:00
flutterCli.test.ts feat(flutter): identify Dart snapshot builds and inspect AOT payloads by pure APK parsing (#1582) 2026-10-12 22:35:55 +08:00
fridaCli.test.ts fix(frida): name the argument each Frida input error rejects (#2217) 2026-10-12 23:00:59 +08:00
hopperLaunchFailureCli.test.ts fix(hopper): wait for late bridges during cleanup (#1866) 2026-10-11 22:50:27 +08:00
javascriptApplicationJsonOutput.test.ts fix(javascript): trace wrapped Electron IPC paths in large bundles (#1874) 2026-10-12 09:28:59 +08:00
javascriptApplicationProgress.test.ts fix(artifacts)!: retain cleanup owners through client shutdown 2026-10-11 04:43:02 +08:00
javascriptArtifactBomRanges.test.ts fix(javascript): preserve original BOM source coordinates (#1093) 2026-10-09 00:09:55 +08:00
javascriptArtifactTypeScriptDialect.test.ts perf(tests): consolidate TypeScript dialect producer checks 2026-10-11 13:29:50 +08:00
javascriptBundlerRuntimeScopes.test.ts fix(javascript): retain runtime scope in bundled module relationships 2026-10-11 01:36:12 +08:00
javascriptBundlerSelfReferences.test.ts fix(javascript): omit self-referential static references with disclosure (#1157) 2026-10-09 10:01:59 +08:00
javascriptIntegrityPolicyCli.test.ts feat(javascript): record Electron integrity mismatches 2026-10-10 02:49:46 +08:00
javascriptRuntimeObservationCli.test.ts refactor(javascript): group domain semantics and contracts (#907) 2026-10-07 17:16:58 +08:00
javascriptSelfImportRelationships.test.ts fix(javascript): keep TypeScript substitution out of runtime paths 2026-10-12 01:41:23 +08:00
jebCli.test.ts fix(jeb): confine an invalid REA_JEB_MCP_URL to the JEB tools (#2145) 2026-10-12 06:49:15 -07:00
jsonInputSize.test.ts perf(evidence): fuse streamed JSON token handling (#1694) 2026-10-11 12:36:35 +08:00
jsonInputStatus.test.ts fix(cli): classify JSON input permission denials 2026-10-10 03:52:35 +08:00
jsonOutput.test.ts perf(cli): write compact JSON when output is not a terminal (#1413) 2026-10-09 20:29:48 -07:00
keyedArchivePrototypeKeyCli.test.ts fix(plist): decode formatted XML dictionary keys 2026-10-12 05:57:34 +08:00
keyedArchiveXmlNestingCli.test.ts fix(apple): preflight XML plist nesting before keyed archive decoding (#2161) 2026-10-12 23:12:10 +08:00
mcpDoctorHelpCli.test.ts refactor!: enforce canonical evidence and provider boundaries 2026-10-09 20:18:52 +08:00
nativeDemangleCli.test.ts test: strengthen public input and module lookup controls 2026-10-12 11:59:23 +08:00
nativeMachoEchoedPathCli.test.ts fix(native): keep echoed Mach-O paths out of load commands and symbols 2026-10-06 23:40:35 -07:00
nativePlistCli.test.ts refactor: consolidate boundary semantics and prune redundant tests 2026-10-10 05:56:01 +08:00
nativePlistPrototypeKeyCli.test.ts fix(plist): read XML plists containing a __proto__ key 2026-10-06 23:58:59 -07:00
nativePlistSelectionFailureCli.test.ts fix(native): name the CLI flag that selects another plist 2026-10-09 09:32:24 +00:00
nativeSignatureCli.test.ts fix(native): keep echoed codesign paths out of signature fields (#865) 2026-10-07 13:20:12 +08:00
nativeUiScenarioInputCli.test.ts fix(contracts): align CLI/MCP boundary contracts (#946) 2026-10-08 00:03:36 +08:00
packageRunnerRegistration.test.ts fix(setup): register a stable launcher when run through bunx (#1731) 2026-10-11 19:17:15 +08:00
projectedErrorStatus.test.ts refactor!: simplify runtime tools and remove replay engines (#572) 2026-10-05 21:15:04 +08:00
rawBinaryCli.test.ts fix(targets): project invalid raw-binary loads as caller input (#2004) 2026-10-12 09:34:45 +08:00
reconstructionObligationLedgerCli.test.ts refactor(mcp): simplify evidence and workflows 2026-09-29 13:58:26 +08:00
referenceSourceExclusions.test.ts fix(reference)!: preserve exclusion rule provenance 2026-10-11 04:15:26 +08:00
referenceSourceImportStatus.test.ts test: retain focused CommonJS export regressions 2026-10-11 11:07:15 +08:00
referenceSourceUtf8.test.ts fix(reference): report malformed UTF-8 before import parsing 2026-10-10 01:45:00 +08:00
scenarioCliInputDiagnostics.test.ts fix(contracts): align CLI/MCP boundary contracts (#946) 2026-10-08 00:03:36 +08:00
skillSync.test.ts fix(cli): disable unmanaged skill synchronization 2026-10-05 23:27:46 -07:00
webScriptSelectionCli.test.ts fix(files): reject nonregular capture and JSON inputs 2026-10-10 01:49:54 +08:00
workflowInputIdentities.test.ts fix(mcp): preserve JavaScript workflow identity validation (#1366) 2026-10-10 05:11:38 +08:00