fix(http-bridge): add validateSelector guard in handleUpload - #36
Conversation
Defense-in-depth: validate the selector parameter at the HTTP handler boundary before it reaches cometClient.uploadFile(). Mirrors the guard added to src/index.ts in PR #32 (fix/validate-selector-27). - Import validateSelector from upload-validator.js - Add conditional guard (only when selector !== undefined) with try/catch - Return structured ToolResult error on invalid selector The inner guard in cdp-client.ts still fires as a fallback. This change ensures the HTTP bridge entry point is consistent with the MCP tool handler pattern established in PR #32.
Security & Code Quality Review — PR #36 (commit
|
RapierCraft
left a comment
There was a problem hiding this comment.
APPROVED: commit e1f1d72 after context-aware security review (1 agent: General Security). 0 findings. Build passes. Safe to merge.
Defense-in-depth selector validation guard in handleUpload() is correct and consistent with the established pattern in src/index.ts. No blocking issues.
PR Review Summary: #36 — fix(http-bridge): add validateSelector guard in handleUploadReview IntegrityReviewed commit: Verdict: APPROVEDContext-Aware ReviewDomains: Security/Validation | Agents: 1 (General Security) Integration Checks (Phase 2.5)Import verification: PASS — Risk Matrix
FindingsNone — 0 findings at any confidence level. Automated Checks
RecommendationMerge approved. PR implements the defense-in-depth selector validation guard at the HTTP bridge handler boundary, consistent with the pattern established in src/index.ts by PR #32. Context-aware review complete. 1 agent + integration checks. 0 findings triaged. PR #36 merged to |
Summary
Adds defense-in-depth selector validation at the HTTP bridge handler boundary in `handleUpload()`. This mirrors the guard added to `src/index.ts` in PR #32, which left the parallel HTTP entry point unprotected.
The inner guard in `cdp-client.ts` still fires as a fallback — this is a consistency fix, not a functional vulnerability patch.
Changes
Testing
<script>): returns structured error before reaching CDP [type:api]npm run buildpasses [type:unit]Closes #33
Implementation branch:
fix/http-bridge-selector-validation-33Base:
main