fix(api): bind git scan session credentials to URL#213
Conversation
|
Warning Review limit reached
More reviews will be available in 27 minutes and 48 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: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Motivation
GitCloneSessionto attacker-controlled repository URLs by enforcing the original session URL as an authorization boundary.Description
git_scan_session_data(session, request_url, reuse_credentials)which returns session-derived credential token and branch cache only whenrequest_urlequals the session's storedurl, and rejects credential reuse withSESSION_URL_MISMATCHif the session carried a credential and the URLs differ./skills/git/scanto call the new helper and only use a session credential when the request explicitly omitscredential_idand the requested URL matches the session URL; otherwise fall back to explicitcredential_idor no credential.Testing
cargo fmt -p aghub-api --checkwhich passed.git diff --check) and file formatting verification which passed locally in the change set.cargo test -p aghub-api git_scan_session_data -- --nocapturebut test execution was blocked by the environment (missing sccache/toolchain wrapper) and by crates.io network proxy errors (HTTP 403) when downloading dependencies, so unit tests could not be executed end-to-end in this environment.Codex Task