Repository navigation
feat(artifacts): decode Android Verified Boot vbmeta images offline - #13239
Conversation
Codex Review Summary: ❌ FailedThis 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. |
[Medium impact] The reviewed changes appear safe to merge; no actionable issue remains. SummaryAdds offline recognition, inspection, and extraction for standalone Android Verified Boot images.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Local AVB0 image] --> B[Check header and limits]
B --> C[Decode descriptors]
C --> D[Header facts and decoded prefix]
D --> E[Inventory and stored children]
D --> F[Summary counts]
E --> G[Byte-exact extraction]
Reviews (17) · Last reviewed commit: "chore: merge main into fix/android-vbmet..." · Reviewed by Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4a79afb600
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 888cef32b5
ℹ️ 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".
With raised descriptor_bytes and auxiliary_block_bytes limits, a valid
KERNEL_CMDLINE longer than half the host string bound passed the byte
limits, and toString("hex") then threw ERR_STRING_TOO_LONG, which
surfaced as an I/O error. Check the field against the host bound before
hex encoding and report a typed capacity failure with its own limit.
A header whose declared blocks do not fit the file, or whose descriptor range does not fit its auxiliary block, now reports truncation or a malformed range instead of a limit a larger budget cannot repair. The over-budget fixtures are now fully present so they still prove the limit.
|
@mvanhorn thanks for the PR — there is 1 open review thread here:
Could you address or reply to this? Once it's resolved and CI is green we can take another look. |
|
This is handled on the current head (a5cb624), which is why the thread shows as outdated: the vbmeta auxiliary, descriptor-table and descriptor-count budgets are now per-call reader limits instead of fixed limits, so an image like the 4,097-descriptor example can be admitted by raising them. The branch conflicts with main now, so that is the next thing to clear. |
|
@mvanhorn also, this branch has merge conflicts with |
# Conflicts: # src/artifacts/artifactFormats.ts # src/artifacts/inventory/ArtifactGraphConstruction.test.ts # src/domain/artifactFormatMetadata.ts
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Conflicts with main are resolved in 1f487a8, a merge commit that moves the vbmeta metadata schema into main's new |
…aders The summary counts every descriptor tag in a single loop instead of six filtered arrays, and androidVbmeta reuses one BinaryReader per buffer. The malformed-header refusal fixtures follow main's unsupported_target classification for malformed target bytes.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Resolve the inspect_artifact advertised schema summary conflict.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Malformed vbmeta headers classify as unsupported_target, not invalid_request, matching analysisErrorClassification and the refusal fixtures.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
What is all this
…On Tue, Nov 24, 2026, 6:23 PM Matt Van Horn ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In docs/guides/firmware/android-vbmeta.md
<#13239 (comment)>:
> +read. A declared image that ends past the file is `truncated`. A structural
+mismatch is `invalid_request`. These refusals do not produce an empty
Fixed in a38a1c9
<a38a1c9>.
Malformed headers classify as unsupported_target
(analysisErrorClassification.ts maps malformed there, and the refusal
fixtures assert it), so the guide now names that code.
—
Reply to this email directly, view it on GitHub
<#13239?email_source=notifications&email_token=CUSLMP54TQRNKR2YWN2T76L52YRARA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTMMBUHE2TEOBUHE4KM4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOSWGM33PORSXEX3DNRUWG2Y#discussion_r4688389068>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/CUSLMP5NPRDLEHQODESZG3T52YRARAVCNFSNUABGKJSXA33TNF2G64TZHMYTEMBZHE3DMOJTGM5US43TOVSTWNRVGM2TSMZXG42DPILWAI>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/CUSLMP7DQACFYRZWH6I47ML52YRARA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTMMBUHE2TEOBUHE4KM4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOSVGM33PORSXEX3JN5ZQ>
and Android
<https://github.com/notifications/mobile/android/CUSLMP7AG4KBFEE56K7AWHD52YRARA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTMMBUHE2TEOBUHE4KM4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOSXGM33PORSXEX3BNZSHE33JMQ>.
Download it today!
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
|
This is a pull request that adds Android vbmeta parsing to rea, and the email was a notification from its review thread. You can stop these from the Unsubscribe link in the email or the Notifications button on the PR page. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Merged current main into this branch. Three follow-up commits: - 3716ef8 regenerates the advertised schema hashes for extract_artifact and inspect_artifact after the merge. - 4fc3ade is the merge itself. CI on 295006a is still running. |
|
this overlaps #14465; the shared parser should preserve your partial facts and its raw descriptor-byte children. keeping both open while those pieces are consolidated; the limit-result test and Author readiness still need attention. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
I’m working through the remaining refusal-contract fixes and adding the descriptor-byte children from #14465 to this parser. I’ll leave Author readiness for you to complete after reviewing the final change. |
Co-authored-by: iamcipherdev <[email protected]>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
…ed schema summaries
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Summary
REA can inspect boot images that carry an AVB footer, but a standalone
vbmeta.img(the image fastboot flashes to thevbmetapartition) is not recognized as a format. An analyst who pulls one from a factory image gets an unknown blob and has to runavbtool info_imageoutside REA, losing Evidence provenance.This adds an offline
android-vbmetaartifact format.inspect-artifactandextract-artifact(and the MCPinspect_artifact/extract_artifacttools) now decode the vbmeta header and its descriptors and expose the authentication block, public key, public key metadata, and each successfully decoded descriptor as stored children. No issue exists for this; it is a format-inspection addition within the supported contribution scope.Problem and expected behavior
Use case: given
vbmeta.img, answer "which partitions does this chain to, which hash and hashtree descriptors does it carry, what rollback index and flags are set, and which key signed it" without leaving REA.Observable outcome:
AVB0and has a well-formed header is recognized asandroid-vbmetaregardless of filename.signatures_verifiedis alwaysfalse.Change and scope
Descriptor-byte extraction consolidates the useful child behavior from feat(artifacts): inspect standalone AVB0 vbmeta headers and descriptors #14465; thanks @iamcipherdev. It reuses this parser and retains partial facts, adjustable limits, and existing key children.
Refusal fixtures, CLI/MCP assertions, and the guide now match the owning contracts: malformed/truncated targets use
unsupported_targetwithdetails.failure_kind; adjustable-limit refusals usepartial.src/domain/firmware/androidVbmeta.tsowns parsing. It validates the header (magic, block sizes and alignment, offset/size ranges inside the authentication and auxiliary blocks, the release string's final NUL at header byte 175, supported major version) and walks the descriptor table with per-type layouts. Malformed descriptors stop the walk with a tagged failure that records bothdescriptor_offsetand the offending field'soffset, while descriptors decoded before it are kept.src/artifacts/AndroidVbmetaArtifactReader.tsconsumes the parser's facts. Coverage iscompleteonly when every descriptor decoded and the major version is supported; otherwise it isunknown, with the tentative facts still reported. Returned metadata is an independent snapshot of the reader's cached facts.src/domain/analysisView/androidVbmetaSummary.tsadds the summary projection; format registration lives inartifactFormats.ts,artifactFormatRecognition.ts, andtargetFormats.ts.Docs: new
docs/guides/firmware/android-vbmeta.md, plus CLI, firmware-analysis, and skill reference updates.Not included: signature or digest verification, AVB footers on partition images other than boot images, and any device or runtime interaction.
Contract and boundary impact
androidVbmeta.tsproduces parsed facts; the reader, summary view, and inventory graph consume them without reparsing raw bytes.inspect_artifact/extract_artifactrecognize one more format value,android-vbmeta, and accept one new optionalartifact_limits.android_vbmetagroup (authentication_block_bytes,auxiliary_block_bytes,descriptor_bytes,descriptor_count). Defaults match the previous fixed budgets; a refusal reportsrequired_valueand the parameter to raise.android-vbmeta; existing formats unchanged.android-vbmetaandandroid-vbmeta-summarymetadata shapes; children carry stored ranges and SHA-256.docs/public/product-catalog.json), package, or installation impact: none committed; authored skill references updated under.agents/skills/reverse-engineer-anything/.Expected effects:
Evidence and regression coverage
src/domain/firmware/androidVbmeta.test.ts(header and descriptor decoding, every refusal with its field offset, malformed-descriptor prefix retention, chain rollback index location 0, release string final byte, unsupported major version),src/artifacts/AndroidVbmetaArtifactReader.test.ts(coverage, children, independent metadata snapshots),androidVbmetaSummary.test.ts,tests/acceptance/androidVbmetaCli.test.ts,tests/boundary/mcp/androidVbmetaMcp.test.ts, plus format recognition and inventory graph tests. Fixtures are generated inandroidVbmeta.fixture.ts.android-vbmeta; the boundary tests fail there.rea inspect-artifact vbmeta.img --detail summary --evidence_output vbmeta.evidence.json --json, excerpt ofroot_format_metadata):{ "kind": "android-vbmeta-summary", "magic": "AVB0", "required_libavb_version_major": 1, "algorithm_name": "SHA256_RSA2048", "rollback_index": "42", "flag_names": ["HASHTREE_DISABLED", "VERIFICATION_DISABLED"], "release_string": "avbtool 1.2.0", "signatures_verified": false, "descriptor_failure": null, "descriptor_count": 6, "property_count": 1, "hashtree_count": 1, "hash_count": 1, "kernel_cmdline_count": 1, "chain_partition_count": 1, "unknown_count": 1 }with limitations including "Signatures, hashes, and hashtree digests are recorded and not verified." and "1 descriptor with an unknown AVB tag (7) is retained with its tag, size, and file offset."
For evidence-bearing changes:
Demo
Rendered walkthrough of the CLI inspect and extract output above (simulated terminal, values taken from a real run on the generated fixture).
Maintainer validation
1f262f5d1356c3ce94fb0e9c99302fdb60d3349c; the two advertised input summaries now match the CI generator.a27e01086a5efd7d4ee74025f7478d8dd59ea557: all 12 test shards and all required checks, with 31 successful jobs and 19 intentional skips.Author-reported validation before consolidation
npx --no-install vitest runover the eight changed test files (vocabularies, reader, inventory graph, summary view, format recognition, domain parser, CLI acceptance, MCP boundary): passedandroidVbmeta.test.ts,AndroidVbmetaArtifactReader.test.ts): 21 passedandroidVbmetaCli.test.ts: 8 passedandroidVbmetaMcp.test.tsandtests/acceptance/tools/localToolContracts.test.ts: 2 and 11 passednpm run verify:test-discovery: all 3841 test and spec files discovered exactly oncenpm run format:check: all matched files use the correct formatCompatibility, safety, and release
AI was used for assistance.
Author readiness
Human owner: @mvanhorn
Before merge
type(scope): outcome.