Skip to content

fix(plist): report omitted __proto__ entries in signatures and Interface Builder - #894

Merged
kaoru0822-kitauji merged 2 commits into
mainfrom
fix/plist-prototype-key-reporting
Oct 7, 2026
Merged

kaoru0822-kitauji merged 2 commits into
mainfrom
fix/plist-prototype-key-reporting

Conversation

@kaoru0822-kitauji

@kaoru0822-kitauji kaoru0822-kitauji commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

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_plist and inspect_keyed_archive report 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 adds Entitlements: 1 dictionary entry keyed __proto__ was omitted because REA results cannot represent that key.
  • Interface Builder XML plists (decode_interface_builder): the document decoded and archive_decode stayed complete. It is now partial with reason dictionary_entries_omitted, graph.truncated is 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 reads graph.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>&#95;&#95;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 & or ;.

No schema or catalog change. The archive_decode reason is a free-form string, and the new value sits beside one_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_signature with __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__ reports archive_decode partial (dictionary_entries_omitted), a truncated graph, and the per-document limitation.

npm run check:changed (22 files, 165 tests) and npm run docs:check pass. 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 on main on this host, because it has only the Command Line Tools and no ibtool.

No Hopper/Ghidra/IDA verification is needed.

🤖 Generated with Claude Code

…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 &#95;&#95;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]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-07T08:16:17.449386Z 5afd8a8 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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[&#x110000;]]> 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 👍 / 👎.

@kaoru0822-kitauji kaoru0822-kitauji Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed about the throw. In 5afd8a8 decodeXmlText leaves a reference beyond U+10FFFF as written, so <![CDATA[&#x110000;]]> 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[&#x110000;]]> 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]>
@kaoru0822-kitauji
kaoru0822-kitauji merged commit 15ab5db into main Oct 7, 2026
19 checks passed
@kaoru0822-kitauji
kaoru0822-kitauji deleted the fix/plist-prototype-key-reporting branch October 7, 2026 09:12
darsrc pushed a commit to darsrc/rea that referenced this pull request Oct 10, 2026
…eporting

fix(plist): report omitted __proto__ entries in signatures and Interface Builder
@morluto morluto added bug Something isn't working area: build Build, CI, packaging, and publishing labels Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: build Build, CI, packaging, and publishing bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants