π‘οΈ Sentinel: [HIGH] μ μ₯λ SSRF μ·¨μ½μ λ°©μ§ λ° URL κ²μ¦ κ° μμΈ(AttributeError) ν¨μΉ - #924
Conversation
- `appguardrail_core/controlplane.py`μ `/api/v1/webhook` POST νΈλ€λ¬μμ μ λ¬λ `url`μ μ μ₯ μ λͺ μμ μΌλ‘ κ²μ¦ - `_is_safe_url()` ν¬νΌ(μ μ΄ νλ©΄κ³Ό CLI λͺ¨λ)μ νμ 체ν¬(`if not isinstance(url, str)`)λ₯Ό μΆκ°νμ¬, λ¬Έμμ΄ μΈ μ λ ₯ μ `urllib.parse.urlparse`μμ `AttributeError` μμΈ(API 500 μλ¬)κ° λ°μνμ§ μλλ‘ μμ - 400 Bad Request λ± κ΄λ ¨λ λ¨μ ν μ€νΈλ₯Ό μμ νμ¬ SSRF λ°©μ΄ λ‘μ§μ μμ μ± νμΈ
|
π Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a π emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Warning Review limit reached
Next review available in: 47 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: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: π Files selected for processing (2)
π WalkthroughWalkthroughμΉν
μ€μ APIκ° JSON κ°μ²΄μ μμ ν HTTP(S) URLλ§ νμ©ν©λλ€. λΉλ¬Έμμ΄ URLκ³Ό localhost λμ URLμ 400 μλ΅μΌλ‘ κ±°λΆν©λλ€. CLIμ control-planeμ ChangesμΉν SSRF 보νΈ
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
π₯ Pre-merge checks | β 5β Passed checks (5 passed)
β¨ Finishing Touches π‘ 1π οΈ Fix failing CI checks π‘
π Generate docstrings
π§ͺ 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
π€ Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@appguardrail_core/controlplane.py`:
- Around line 635-641: Update the request-body handling used by the webhook
update flow around _body() and set_webhook so an empty Content-Length body is
rejected with 400 "invalid JSON body" instead of being normalized to {}.
Preserve explicit deletion only when the parsed JSON contains "url": null, and
add a regression test covering an empty-body request.
πͺ Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
βΉοΈ Review info
βοΈ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 587943ff-a058-422d-b761-80bd0ca312ba
π Files selected for processing (5)
.jules/sentinel.mdappguardrail_core/controlplane.pyscanner/cli/appguardrail.pytests/test_controlplane.pytests/test_ssrf_protection.py
π¨ Severity: HIGH
π‘ Vulnerability:
/api/v1/webhookμλν¬μΈνΈμμ μΉν URLμ λ°μ΄ν°λ² μ΄μ€μ μ μ₯ν λ μ¬μ μ μμ μ±μ κ²μ¦νμ§ μμ μ μ₯λ SSRF(Stored SSRF) μ·¨μ½μ λ°μ κ°λ₯μ±μ΄ μμμ΅λλ€._is_safe_url()κ²μ¦ λ‘μ§μ νμ 체ν¬κ° μμ΄ μ μμ μΈ μ¬μ©μ(μ: JSON λ³Έλ¬Έμ URLμ μ μνμ΄λ λ°°μ΄λ‘ μ λ¬)κ° νΈμΆ μurllib.parse.urlparseμ μν μκΈ°μΉ λͺ»ν μμΈ μ²λ¦¬(AttributeError)κ° μ λ°λμ΄, μ΄ν리μΌμ΄μ μΆ©λ(API 500 μλ¬)λ‘ μ΄μ΄μ§ μ μμμ΅λλ€.π― Impact: 곡격μκ° λ΄λΆ μΈνλΌλ§(localhost λλ λ§ν¬ λ‘컬)μΌλ‘μ μμ HTTP μμ²(SSRF)μ μ±κ³΅μν€κ±°λ, νλ³νμ΄ μ λλ λ°μ΄ν°λ₯Ό νμ©νμ¬ API μλ΅μ λ§λΉμν¬ μ μλ κ°μ©μ± μ ν 리μ€ν¬κ° μ‘΄μ¬νμ΅λλ€.
π§ Fix:
set_webhook()μ΄μ μ_is_safe_url()λ‘urlνλμ 무결μ±μ νκ°νλλ‘ POST νΈλ€λ¬(appguardrail_core/controlplane.py)λ₯Ό κ°μ νμ΅λλ€._is_safe_url()λ΄λΆμ λͺ μμ μΈ νμ 체ν¬(isinstance(url, str)) λ‘μ§μ μΆκ°νμ¬, λΉλ¬Έμμ΄ νμ μ΄ μ£Όμ λλλΌλ μ¬μ μ κ±°λΆλλλ‘ λ³΄μνμ΅λλ€.β Verification:
tests/test_ssrf_protection.pyλ°tests/test_controlplane.pyμ μ¬λ°λ₯΄μ§ μμ νμ (μ μ λ±) μ£Όμ λ° Localhost URL μμ²μ κ±°λΆνλ SSRF ν μ€νΈλ₯Ό μΆκ°νμ¬ λ³΄μ κ°νκ° μ¬λ°λ₯΄κ² μλνλμ§ νμΈνμ΅λλ€.PR created automatically by Jules for task 14678305360862845164 started by @seonghobae
Summary by CodeRabbit
λ²κ·Έ μμ
400 Bad Requestλ₯Ό λ°νν©λλ€.nullλ± λΉλ¬Έμμ΄ URL μ λ ₯μΌλ‘ μΈν μ²λ¦¬ μ€λ₯λ₯Ό λ°©μ§ν©λλ€.ν μ€νΈ