Revise PR #242: bearer token still crosses origins on redirect, plus a missing route - #264
Conversation
…OST /refs/fetch route, pass data_dir through for consistent base URL resolution
|
ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing |
|
Warning Review limit reached
Next review available in: 22 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| _FILES_SEGMENT = "files/" | ||
|
|
||
|
|
||
| def _reject_dot_segments(path: str) -> None: |
There was a problem hiding this comment.
WARNING: Double-encoded path traversal possible in _reject_dot_segments
urllib.parse.unquote only performs single-level decoding, so a path like %252e%252e (double-encoded ..) bypasses the dot-segment check. An attacker could craft a ref URI with double-encoded dots to traverse directories if the downstream server decodes paths more than once.
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
| ) | ||
| self._send_json(200, result) | ||
|
|
||
| def _handle_refs_fetch(self) -> None: |
There was a problem hiding this comment.
WARNING: Missing _apply_token_binding on /refs/fetch
Unlike other data endpoints (/ingest, /search), this handler does not call _apply_token_binding(agent, project). Registry-token verification and active-grant checks are skipped, so a bearer-token holder without an active grant can fetch files.
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
| raise _BadRequest("'ref' (object) is required") | ||
| if not isinstance(agent, str) or not agent: | ||
| raise _BadRequest("'agent' (non-empty string) is required") | ||
| result = runner.run( |
There was a problem hiding this comment.
WARNING: Domain exceptions from fetch_by_ref return 500 instead of proper HTTP status codes
service.fetch_by_ref raises NotFoundError (should be 404), UnauthorizedError (should be 401/403), and HashMismatchError (should be 400), but _dispatch only catches _BadRequest, ValueError, and Exception. These domain errors fall through to the generic 500 handler.
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
Code Review SummaryStatus: 3 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (4 files)
Fix these issues in Kilo Cloud Reviewed by step-3.7-flash · Input: 84.5K · Output: 31.2K · Cached: 1.4M |
All three blockers on #242 are fixed and I proved each by running. One required change: the test guarding the token does not actually guard it.Reviewed on head Blocker 1, the bearer token crossing origins on redirect: FIXED, proven both directionsSame two-server setup that closed #238: a controller that 302s to an attacker origin, and an The vulnerable half is the control: it shows the probe is capable of catching a leak, so the Blocker 2,
|
|
Merging as-is on Jay's call, with the required test change carded as a follow-up rather than blocking the fix. What is landing: the What is NOT landing, and why it is carded: The honest statement of what merges here: the fix is proven by my probe, not by the suite. A future refactor of |
CARD TITLE (intent, not commit subject): Revise PR #242: bearer token still crosses origins on redirect, plus a missing route
Autonomous build of board card tsk-revvkw.
Files:
taosmd/config.py | 47 +++++++
taosmd/http_server.py | 16 +++
taosmd/ref_fetch.py | 154 +++++++++++++++++++++++
taosmd/remote.py | 8 ++
taosmd/service.py | 62 ++++++++-
tests/test_http_server.py | 35 ++++++
tests/test_ref_fetch.py | 314 ++++++++++++++++++++++++++++++++++++++++++++++
7 files changed, 635 insertions(+), 1 deletion(-)