Repository navigation
fix(plist): report omitted __proto__ entries in signatures and Interface Builder - #894
Conversation
…ace Builder #885 decodes XML plists that contain a __proto__ key by omitting those entries, but signature entitlements and Interface Builder plists dropped the omission count. inspect_signature returned an entitlement set that looked complete, and archive_decode stayed complete. Both now report the omission: a signature limitation, and a partial archive_decode facet with reason dictionary_entries_omitted and a per-document limitation. The placeholder that stands in for __proto__ was reserved against the raw XML text, so an entity-encoded key such as __rea_prototype_key__ decoded to the placeholder and was omitted as if it were __proto__. The placeholder is now reserved against the decoded text. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6729ee7636
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ): PropertyListWithoutPrototypeKeys => { | ||
| // The decoded text holds every key the decoder can produce, including | ||
| // entity-encoded spellings of the placeholder, so no source key aliases it. | ||
| const decoded = decodeXmlText(text); |
There was a problem hiding this comment.
Restrict entity decoding to XML key text
When a valid plist contains entity-looking text in a comment or CDATA section, this whole-document decode treats it as an actual character reference even though XML does not expand references there. For example, <![CDATA[�]]> is valid literal string content, but decodeXmlText passes 0x110000 to String.fromCodePoint and throws a RangeError, so previously readable plists now fail in every caller of parseXmlPropertyList. Scan only decoded <key> contents for placeholder collisions, or otherwise avoid interpreting comments and CDATA.
AGENTS.md reference: AGENTS.md:L54-L56
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Agreed about the throw. In 5afd8a8 decodeXmlText leaves a reference beyond U+10FFFF as written, so <![CDATA[�]]> and comments with such text parse as before. The new test covers both.
I kept the whole-document scan rather than scanning only KEY_TOKEN matches. The parser also accepts key spellings the token pattern does not match, such as <key >…</key>, and they could still decode to the placeholder. Decoding comment or CDATA text too can only make the placeholder longer. It cannot drop or alias an entry.
Reserving the __proto__ placeholder decodes the whole document, so <![CDATA[�]]> or a comment with an out-of-range reference threw a RangeError, and every XML plist reader failed on a valid document. References beyond U+10FFFF now stay as written. The XML decoder still rejects them outside comments and CDATA. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…eporting fix(plist): report omitted __proto__ entries in signatures and Interface Builder
Summary
Follow-up to #885, which merged before its three review comments were addressed.
#885 decodes XML plists containing a legal
__proto__key by omitting those entries and counting them.inspect_plistandinspect_keyed_archivereport the count, but two sites dropped it:inspect_signature: an entitlements plist with a__proto__entry returned the remaining entitlements with no limitation, so the set looked complete. It now addsEntitlements: 1 dictionary entry keyed __proto__ was omitted because REA results cannot represent that key.decode_interface_builder): the document decoded andarchive_decodestayedcomplete. It is nowpartialwith reasondictionary_entries_omitted,graph.truncatedis true, and a per-document limitation names the archive path, e.g.Contents/Resources/Prototype.nib: 1 dictionary entry keyed __proto__ was omitted …. Asset catalog analysis readsgraph.truncated, so its resource-key joins now also say they may be incomplete.Placeholder collision. Before decoding, each
__proto__key is replaced with a placeholder. The placeholder was checked only against the raw XML, so<key>__rea_prototype_key__</key>did not match, but it decoded to the placeholder. That unrelated entry was then dropped and counted as__proto__. The placeholder is now checked against the entity-decoded text. Literal spellings appear there unchanged, because the placeholder contains no∨.No schema or catalog change. The
archive_decodereason is a free-form string, and the new value sits besideone_or_more_archives_invalid.Verification
New cases (each fails on
main):src/domain/propertyListKeys.test.ts: an entity-encoded key that decodes to the placeholder is kept, while the real__proto__entry is still omitted.tests/boundary/providers/native/nativeProvider.test.ts:inspect_signaturewith__proto__in the codesign entitlements output keeps the other entitlements and reports the limitation.tests/boundary/filesystem/interfaceBuilderBundle.test.ts: an XML NIB plist with__proto__reportsarchive_decodepartial (dictionary_entries_omitted), a truncated graph, and the per-document limitation.npm run check:changed(22 files, 165 tests) andnpm run docs:checkpass. So do the native signature CLI, native inventory golden, binary target, and plist prototype-key CLI boundary tests. The ibtool-compiled NIB tests (nibNativeHierarchy, the compiled storyboard case) fail the same way onmainon this host, because it has only the Command Line Tools and noibtool.No Hopper/Ghidra/IDA verification is needed.
🤖 Generated with Claude Code