Repository navigation
fix: close SSRF gaps in MCP OAuth discovery and web_crawl urllib fallback - #5970
praisonai-triage-agent[bot] wants to merge 3 commits into
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
@coderabbitai review |
|
/review |
|
β Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
|
[Medium impact] The PR appears safe to merge; no new actionable issues were found. SummaryThe PR checks OAuth URLs before fetching metadata and checks each redirect before following it. The urllib crawler fallback now follows the same pattern.
|
|
@claude You are the FINAL architecture reviewer. If the branch is under MervinPraison/PraisonAI (not a fork), you are able to make modifications to this branch and push directly. SCOPE: Review changes in this PR. Python SDK: praisonaiagents, praisonai. TypeScript SDK: src/praisonai-ts/. Do NOT modify src/praisonai-rust. Read ALL comments above from Gemini, Qodo, CodeRabbit, and Copilot carefully before responding. MANDATORY READ (before reviewing):
Phase 1: Review per AGENTS.md
MANDATORY COMMENT FORMAT β include this Phase 1 table in your review comment: Phase 1 β AGENTS.md review
For TypeScript PRs (src/praisonai-ts/), also add: Phase 2: FIX Valid Issues Phase 3: Final Verdict |
Phase 1 β AGENTS.md review
Phase 2 β Fixes pushed (18eba52)
Files modified: Tests: Skipped: nothing else was raised. Qodo was billing-blocked and CodeRabbit gave no actionable items. Phase 3 β Verdictβ Approve. Every Phase 1 row passes and both review findings are fixed. |
|
@claude this PR has merge conflicts with |
β¦ard (fixes #5967) - oauth_discovery._require_https now also rejects private/link-local/ ambiguous hosts via tools.url_safety.is_safe_http_url (loopback still allowed for local testing) - _get_json follows redirects manually, validating each hop before it is requested - oauth_registration reuses the single _require_https; credential POSTs (token exchange, refresh, DCR) no longer follow redirects - web_crawl urllib fallback walks redirects by hand with SSRF checks per hop Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
β¦ct walk Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
18eba52 to
ae0c5f2
Compare
|
Rebased onto Resolved: Follow-up test fix: Tests: Skipped: none. The OAuth files rebased cleanly. |
|
@claude CI failed on HEAD Failed checks
Failures (extracted)
Critical review firstBefore changing code or tests, decide which side is wrong:
SDK guardrails (AGENTS.md):
What to do
|
CI failure on
|
Fixes #5967
Changes
Gap 1: MCP OAuth (
praisonaiagents/mcp/)oauth_discovery._require_https: still requires HTTPS, but now also runstools.url_safety.is_safe_http_urlon non-loopback hosts. This blockshttps://169.254.169.254,https://10.x,https://[::ffff:169.254.169.254],https://0177.0.0.1, etc. Loopback (localhost/127.0.0.1/::1) is still allowed for local testing, as before._get_jsonfollows redirects manually (allow_redirects=False, max 3 hops). Each hop is checked before it is requested, so no request is sent to a disallowed redirect target.oauth_registrationimports the same_require_httpsinstead of keeping a duplicate copy.allow_redirects=False, so a 307/308 can't re-send a refresh token or client secret to another host.Gap 2:
web_crawlurllib fallback (tools/web_crawl_tools.py)No new params, exports or dependencies.
Verification
blockedfor all three URLs andinternal server was hit: [].test_web_crawl_urllib_fallback_does_not_follow_redirect_to_internalis a real-socket version of PoC 2. It fails onmainand passes here.example.comtests no longer need live DNS.tests/unit/mcp, the security tests and the web_crawl tests: 141 passed, 3 skipped. Fulltests/unit: the failures on this branch are exactly the ones onmain(missing optional deps in this environment); no new failures.π€ Generated with Claude Code