fix(import): bound archive expansion before inflation - #3711
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Codex review: needs maintainer review before merge. Reviewed September 16, 2026, 12:18 AM ET / 04:18 UTC (Revision 2). ClawSweeper reviewWhat this changesChecks GitHub archive limits before decompression, preserves skipping of oversized files, and adds boundary regressions and an import safety specification. Merge readiness✅ Ready for maintainer review No blocking findings. The hardening remains necessary on current main and in v0.23.3, and this patch preserves selective import compatibility while addressing the reported expansion defect. Priority: P2 Review scores
Verification
How this fits togetherClawHub’s GitHub importer downloads repository archives to discover and publish selected skill files. This change bounds archive extraction before those files reach preview and publishing. flowchart TD
A[Owned GitHub repository] --> B[Bounded ZIP download]
B --> C[Check entry headers]
C --> D[Skip excluded files]
C --> E[Reject exceeded budgets]
C --> F[Inflate retained files]
F --> G[Check actual bytes and preview skills]
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Enforce header budgets in the existing archive helper while preserving selective skipping and retaining the actual-byte checks. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main inflates every archive entry before enforcing its expansion limits, and the supplied corrupted-payload regressions distinguish that failure. This review did not execute tests. Is this the best way to solve the issue? Yes—the filter is the narrowest effective location. Reusing Skill Sync’s whole-archive rejection policy would violate selective import behavior, while post-extraction checks alone cannot prevent allocation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 56550718d163. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
This comment has been minimized.
This comment has been minimized.
521fcbd to
2342f44
Compare
GitHub repository imports currently inflate the entire ZIP before checking entry-count and expanded-size limits. This applies those limits in fflate's pre-inflate filter, while preserving selective imports: an unrelated file over 10 MiB is skipped and a valid small skill still imports.
Refs #3678. Follows the hardening approach proposed in #3679 and resolves its skip-to-rejection compatibility regression. That contributor branch is unchanged.
The filter counts all entries toward the 7,500-entry limit, counts only retained files toward 80 MiB, and skips directories, invalid paths, Mac junk and oversized files before allocation. Actual-byte checks remain after extraction. The existing import spec records this contract.
Before/after proof
Ran the same three regressions against main
91aecdc22c531f0612e3819038655ca9ca3d7da9, PR #3679 head786ce7d7dd3e19d4fe64aad4466f3fcae8a7485d, and this fix. These execute the production archive helper with real ZIP data and fflate on macOS/Bun 1.4.0.The oversized-file case first verifies normal valid-archive behavior. Each pre-inflate regression then corrupts only the DEFLATE payload of the entry that must be skipped/rejected, keeping the ZIP headers intact. Attempting inflation raises
invalid block type, so a post-inflate limit cannot pass the test. Exactly 7,500 files and exactly 80 MiB are also verified as accepted.Validation
bun run ci:static: passed.bun run ci:unit: 6,698 passed, 3 skipped; coverage gate passed.bun run ci:types-build: passed.bunx tsc -p convex/tsconfig.json --noEmit: passed.No production deploy was performed. This does not claim to fix #3700 or #3666: their nested picker paths use GitHub tree/blob fetching and bypass ZIP extraction, and their production exceptions remain uncorrelated.
Refreshed landing validation — September 16
Rebased onto main
3ab0037e1bas2342f443d622839e0f3b160550c4bab0273561f1. Git range-diff confirms the archive patch is unchanged.The earlier hosted moderation, inspector-version, and publish-new-version failures coincided with one-second Convex timeouts across unrelated queries. Inspected browser artifacts show the apparent missing-file symptom was an application error boundary after
skills:listVersionstimed out. All three same browser scenarios pass on the refreshed branch on the first local attempt.Refreshed validation:
ci:static, fullci:unit(6,917 tests), and explicit root/schema/CLI/Convex TypeScript checks pass. Existing paired ZIP regression proof and clean autoreview apply to the unchanged patch. Fresh hosted CI is being checked before merge.