fix(security): bound plugin manifest reads in audit deep scan#101773
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 15, 2026, 11:40 PM ET / July 16, 2026, 03:40 UTC. Summary PR surface: Source +16, Tests +19. Total +35 across 2 files. Reproducibility: yes. Current main has an unbounded Review metrics: 1 noteworthy metric.
Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Land a bounded manifest read after the security owner confirms a canonical size policy and that warning plus directory fallback is the intended scan-coverage behavior, sharing the limit with other plugin-manifest consumers if they enforce the same contract. Do we have a high-confidence way to reproduce the issue? Yes. Current main has an unbounded Is this the best way to solve the issue? Yes mechanically: the shared regular-file reader is the narrowest safe way to bound the read and preserve audit completion. Final acceptance still depends on owner confirmation of the threshold and scan-coverage contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 957cc81175a3. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +16, Tests +19. Total +35 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (22 earlier review cycles; latest 8 shown)
|
|
@clawsweeper re-review — added real CLI proof with an oversized plugin manifest. Created a 1 MiB + 1 byte ( The deep audit surfaces |
|
🦞🧹 I asked ClawSweeper to review this item again. |
1260d8d to
699db8e
Compare
ca804bc to
12136cc
Compare
2bf27c9 to
47d1257
Compare
2643221 to
877d810
Compare
e2294c1 to
cf5d427
Compare
5330407 to
be5bbe0
Compare
|
@clawsweeper re-review — branch is now rebased onto the latest This PR addresses the unbounded deep-audit read of installed-plugin Could a maintainer please take a look? Thanks! |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
63e3fd3 to
a9b3c64
Compare
a9b3c64 to
7b55336
Compare
|
Merged via squash.
|
What Problem This Solves
readPluginManifestExtensionsinsrc/security/audit-extra.async.tsread each installed plugin'spackage.jsonwith an unboundedfs.readFile. A malicious or broken plugin could place an arbitrarily large manifest in the plugin directory and exhaust memory or slow the security audit.Why This Change Was Made
The audit deep scan now enforces a hard 1 MiB size limit on plugin
package.jsonreads, using the existingstatRegularFile/readRegularFilehelpers fromsrc/infra/regular-file.js, which also reject symlinks and non-file targets. Oversized manifests throw a clear error that surfaces as aplugins.code_safety.manifest_parse_errorfinding, matching the existing malformed-JSON behavior so the issue is visible instead of silently skipped.User Impact
Users will receive a clear security audit warning if any installed plugin manifest exceeds 1 MiB, and the audit will no longer attempt to load unbounded file content during deep scan.
Evidence
src/security/audit-extra.async.test.tsthat creates apackage.jsonof1 MiB + 1bytes and asserts amanifest_parse_errorfinding is emitted for the oversized plugin.node scripts/run-vitest.mjs src/security/audit-extra.async.test.ts --runpasses (7/7 tests).oxlintclean on changed files.Real behavior proof