Commit c48b070
Replace unmaintained aab-parser to clear protobufjs CVEs (REV-36)
protobufjs entered the tree only via aab-parser@1.0.1, which hard-pins
protobufjs ^6.11.2. Every reachable 6.x version is affected by 11 npm audit
advisories (worst: critical 9.8 RCE), and all fixes land above the pinned
range, so npm audit fix could not resolve it.
An npm `overrides` bump was insufficient: overrides are honored only for the
root project (so end-users installing the published CLI stay vulnerable), and
protobufjs 7.x's strict import resolution exposed that aab-parser ships a
broken Resources.proto (imports an unshipped Configuration.proto), breaking AAB
parsing at runtime. No maintained pure-JS alternative exists — the maintained
options wrap Google's Java bundletool and would add a JRE requirement.
Instead, vendor the small piece actually used:
- Remove aab-parser; add maintained protobufjs ^7.6.3 and jszip ^3.10.1 as
direct deps.
- script/utils/aab-utils.ts: parseAabManifest() reproducing aab-parser's logic
(jszip -> decode aapt.pb.XmlNode -> extract attributes), same shape/errors.
- script/utils/aab-resources-descriptor.ts: exact aapt.pb schema embedded as a
compiled JSON descriptor, so it ships through plain tsc with no .proto asset
and no Configuration.proto import.
- Swap the single call site in command-executor.ts.
Verified: tsc clean; protobufjs gone from npm audit; differential test on a
real 36MB app-release.aab shows byte-identical output between old aab-parser
(protobufjs 6.11.x) and the vendored parser (7.6.5).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent e06571d commit c48b070
5 files changed
Lines changed: 987 additions & 59 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | 27 | | |
29 | 28 | | |
30 | 29 | | |
| |||
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
1564 | 1564 | | |
1565 | 1565 | | |
1566 | 1566 | | |
1567 | | - | |
| 1567 | + | |
1568 | 1568 | | |
1569 | 1569 | | |
1570 | 1570 | | |
| |||
0 commit comments