refactor(security): extract curl probe policy#4885
Conversation
|
Warning Review limit reached
More reviews will be available in 31 minutes and 35 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (11)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
PR Review AdvisorFindings: 0 needs attention, 1 worth checking, 0 nice ideas Review findings🛠️ Needs attention
🔎 Worth checking
🌱 Nice ideas
Consider writing more tests for
Since last review detailsCurrent findings:
This is an automated advisory review. A human maintainer must make the final merge decision. |
E2E Advisor RecommendationRequired E2E: Auto-dispatched E2E: Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
|
E2E Scenario Advisor RecommendationRequired scenario E2E: Dispatch required scenario E2E:
Full scenario advisor summaryE2E Scenario AdvisorBase: Required scenario E2E
Optional scenario E2E
Relevant changed files
|
Selective E2E Results — ✅ All requested jobs passedRun: 27050466714
|
Selective E2E Results — ✅ All requested jobs passedRun: 27051116486
|
Summary
Extracts the curl probe validation and spawn-argument construction introduced in #4878 into a dedicated helper module, then reuses that helper from additional host/sandbox probe call sites. This keeps the SSRF/file-read/multi-transfer policy behind a smaller, auditable boundary while preserving existing probe behavior and coverage.
Related Issue
Refs #3654; follow-up to #4878.
Changes
src/lib/adapters/http/curl-args.tsfor curl probe URL validation, option policy, trusted config handling, and spawn argv construction.src/lib/adapters/http/probe.tsto import the helper instead of carrying the policy inline.buildValidatedCurlCommandArgs()for direct curl command callers that need validation without therunCurlProbe()output wrapper.Type of Change
Verification
npx prek run --all-filespassesnpm testpassesnpm run docsbuilds without warnings (doc changes only)npm testwas attempted, but the existing installer integration testtest/install-preflight.test.ts > warns on Podman but still runs onboardingfails in this environment because host CDI detection turns the Podman warning path into a missing-CDI issue path before onboarding. Targeted probe tests andnpm run typecheck:clipass.Signed-off-by: Carlos Villela cvillela@nvidia.com