Repository navigation
fix(chrome): isolate and clean up compatibility preloads - #386
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. |
|
Codex review: needs real behavior proof before merge. Reviewed September 22, 2026, 2:02 AM ET / 06:02 UTC (Revision 2). ClawSweeper reviewWhat this changesThe PR creates Chrome compatibility scripts in private temporary directories and removes them when transport setup fails or the transport closes. Merge readiness⛔ Blocked before merge - 2 items remain This remains a useful, focused security fix: current main and v0.13.13 retain the vulnerable fallback write. No introduced correctness defect was found, but the earlier runtime evidence covers a narrower revision. Priority: P2 Review scores
Verification
How this fits togetherMCPorter launches Chrome DevTools MCP servers with a compatibility script imported through Node’s startup options. When the packaged script is missing, this subsystem creates the fallback file and transfers its cleanup ownership to the server transport. flowchart TD
A[Chrome server command] --> B[Compatibility eligibility]
B --> C{Packaged script available?}
C -->|Yes| D[Packaged script]
C -->|No| E[Private temporary script]
D --> F[Node startup import]
E --> F
F --> G[Server transport]
G --> H[Remove owned temporary directory]
Before merge
Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Keep private, exclusive fallback creation coupled to transport ownership, while preserving packaged-script preference and existing launch options. Do we have a high-confidence way to reproduce the issue? Yes: current main writes through a pre-created symlink at the predictable fallback filename when packaged candidates are absent; the added regression exercises that mechanism. This review did not execute it. Is this the best way to solve the issue? Yes: private allocation, exclusive creation, and ownership-based cleanup narrowly repair the existing fallback without changing its generated script or adding configuration. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b67907939bd7. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
Co-authored-by: Sebastien Tardif <[email protected]>
b9ab9a2 to
2b68e3f
Compare
The Chrome compatibility fallback wrote JavaScript to a predictable shared-temp filename before loading it through NODE_OPTIONS. A pre-created symlink could overwrite an unrelated file or substitute code.
Create each fallback exclusively in a unique private directory: mode 0700/0600 on POSIX, and a verified current-user-only ACL on Windows. Carry cleanup ownership with the compatibility result so transport shutdown and failed setup remove the temporary directory. Packaged preload files remain caller-independent and are never deleted.
Validation: the synthetic symlink regression overwrites its victim before the fix and preserves it afterward. Tests verify permissions, loading the generated module, transport cleanup wiring, and removal after write failure. AWS Crabbox pnpm check and the full suite passed (2,020 tests; 27 skipped); independent P0–P2 review is clean. No real Chrome attachment was made. Contributor credit and changelog thanks are preserved for @SebTardif.