Skip to content

πŸ›‘οΈ Sentinel: [HIGH] μ €μž₯된 SSRF 취약점 λ°©μ§€ 및 URL 검증 κ°„ μ˜ˆμ™Έ(AttributeError) 패치 - #924

Merged
seonghobae merged 2 commits into
developfrom
fix/sentinel-ssrf-type-check-14678305360862845164
Aug 12, 2026
Merged

πŸ›‘οΈ Sentinel: [HIGH] μ €μž₯된 SSRF 취약점 λ°©μ§€ 및 URL 검증 κ°„ μ˜ˆμ™Έ(AttributeError) 패치#924
seonghobae merged 2 commits into
developfrom
fix/sentinel-ssrf-type-check-14678305360862845164

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

🚨 Severity: HIGH
πŸ’‘ Vulnerability:

  1. /api/v1/webhook μ—”λ“œν¬μΈνŠΈμ—μ„œ μ›Ήν›… URL을 λ°μ΄ν„°λ² μ΄μŠ€μ— μ €μž₯ν•  λ•Œ 사전에 μ•ˆμ „μ„±μ„ κ²€μ¦ν•˜μ§€ μ•Šμ•„ μ €μž₯된 SSRF(Stored SSRF) 취약점 λ°œμƒ κ°€λŠ₯성이 μžˆμ—ˆμŠ΅λ‹ˆλ‹€.
  2. _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)λ₯Ό κ°œμ„ ν–ˆμŠ΅λ‹ˆλ‹€.
  • CLI와 Control Plane μ–‘μͺ½μ˜ _is_safe_url() 내뢀에 λͺ…μ‹œμ μΈ νƒ€μž… 체크(isinstance(url, str)) λ‘œμ§μ„ μΆ”κ°€ν•˜μ—¬, λΉ„λ¬Έμžμ—΄ νƒ€μž…μ΄ μ£Όμž…λ˜λ”λΌλ„ 사전에 κ±°λΆ€λ˜λ„λ‘ λ³΄μ™„ν–ˆμŠ΅λ‹ˆλ‹€.

βœ… Verification:

  • tests/test_ssrf_protection.py 및 tests/test_controlplane.py에 μ˜¬λ°”λ₯΄μ§€ μ•Šμ€ νƒ€μž…(μ •μˆ˜ λ“±) μ£Όμž… 및 Localhost URL μš”μ²­μ„ κ±°λΆ€ν•˜λŠ” SSRF ν…ŒμŠ€νŠΈλ₯Ό μΆ”κ°€ν•˜μ—¬ λ³΄μ•ˆ κ°•ν™”κ°€ μ˜¬λ°”λ₯΄κ²Œ μž‘λ™ν•˜λŠ”μ§€ ν™•μΈν–ˆμŠ΅λ‹ˆλ‹€.
  • ν…ŒμŠ€νŠΈ μŠ€μœ„νŠΈ 컀버리지λ₯Ό 91%둜 μœ μ§€ν•˜λ©° 전체 940개 ν…ŒμŠ€νŠΈμ— μ„±κ³΅ν–ˆμŠ΅λ‹ˆλ‹€.

PR created automatically by Jules for task 14678305360862845164 started by @seonghobae

Summary by CodeRabbit

  • 버그 μˆ˜μ •

    • μ›Ήν›… URL 검증을 κ°•ν™”ν•΄ μ•ˆμ „ν•˜μ§€ μ•Šμ€ HTTP(S) URLκ³Ό 잘λͺ»λœ μž…λ ₯을 κ±°λΆ€ν•©λ‹ˆλ‹€.
    • μœ νš¨ν•˜μ§€ μ•Šμ€ μ›Ήν›… 섀정에 λŒ€ν•΄ μ„œλ²„ 였λ₯˜ λŒ€μ‹  400 Bad Requestλ₯Ό λ°˜ν™˜ν•©λ‹ˆλ‹€.
    • 숫자, λΆˆλ¦¬μ–Έ, null λ“± λΉ„λ¬Έμžμ—΄ URL μž…λ ₯으둜 μΈν•œ 처리 였λ₯˜λ₯Ό λ°©μ§€ν•©λ‹ˆλ‹€.
  • ν…ŒμŠ€νŠΈ

    • localhost λŒ€μƒ URL, μˆ«μžν˜• URL 및 λΉ„λ¬Έμžμ—΄ μž…λ ₯에 λŒ€ν•œ λ³΄μ•ˆ 검증 ν…ŒμŠ€νŠΈλ₯Ό μΆ”κ°€ν–ˆμŠ΅λ‹ˆλ‹€.

- `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 λ°©μ–΄ 둜직의 μ•ˆμ „μ„± 확인
@google-labs-jules

Copy link
Copy Markdown

πŸ‘‹ 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@seonghobae, you've reached your PR review limit, so we couldn't start this review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6d181075-d0ed-4fca-b517-7e477c2bd743

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 67725ad and 24a3083.

πŸ“’ Files selected for processing (2)
  • appguardrail_core/controlplane.py
  • tests/test_controlplane.py
πŸ“ Walkthrough

Walkthrough

μ›Ήν›… μ„€μ • APIκ°€ JSON 객체와 μ•ˆμ „ν•œ HTTP(S) URL만 ν—ˆμš©ν•©λ‹ˆλ‹€. λΉ„λ¬Έμžμ—΄ URLκ³Ό localhost λŒ€μƒ URL은 400 μ‘λ‹΅μœΌλ‘œ κ±°λΆ€ν•©λ‹ˆλ‹€. CLI와 control-plane의 _is_safe_url도 λΉ„λ¬Έμžμ—΄ μž…λ ₯을 κ±°λΆ€ν•©λ‹ˆλ‹€.

Changes

μ›Ήν›… SSRF 보호

Layer / File(s) Summary
URL μž…λ ₯ 검증 계약
appguardrail_core/controlplane.py, scanner/cli/appguardrail.py, tests/test_ssrf_protection.py
_is_safe_url이 URL νŒŒμ‹± 전에 λ¬Έμžμ—΄ νƒ€μž…μ„ ν™•μΈν•©λ‹ˆλ‹€. None, μ •μˆ˜, λΆˆλ¦¬μ–Έ μž…λ ₯은 Falseλ₯Ό λ°˜ν™˜ν•©λ‹ˆλ‹€.
μ›Ήν›… μ„€μ • API 검증
appguardrail_core/controlplane.py, tests/test_controlplane.py, .jules/sentinel.md
μ›Ήν›… POST μš”μ²­μ΄ JSON 객체와 μ•ˆμ „ν•œ URL을 κ²€μ¦ν•©λ‹ˆλ‹€. 잘λͺ»λœ λ³Έλ¬Έμ΄λ‚˜ URLμ—λŠ” 400 Bad Request와 invalid webhook url 였λ₯˜λ₯Ό λ°˜ν™˜ν•©λ‹ˆλ‹€. μœ νš¨ν•œ URL λ˜λŠ” null만 μ €μž₯ν•˜κ³  μ‘λ‹΅ν•©λ‹ˆλ‹€.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • ContextualWisdomLab/appguardrail#910: μ›Ήν›… URL 검증과 _is_safe_url 변경이 직접 μ—°κ²°λ©λ‹ˆλ‹€.
  • ContextualWisdomLab/appguardrail#914: _is_safe_urlμ—μ„œ URL νŒŒμ‹± μ „ λΉ„λ¬Έμžμ—΄ μž…λ ₯을 κ±°λΆ€ν•˜λŠ” λ³€κ²½κ³Ό μ—°κ²°λ©λ‹ˆλ‹€.
  • ContextualWisdomLab/appguardrail#919: control-planeκ³Ό CLI에 λΉ„λ¬Έμžμ—΄ 검증 및 κ΄€λ ¨ ν…ŒμŠ€νŠΈλ₯Ό μΆ”κ°€ν•œ λ³€κ²½κ³Ό κ²ΉμΉ©λ‹ˆλ‹€.
πŸš₯ Pre-merge checks | βœ… 5
βœ… Passed checks (5 passed)
Check name Status Explanation
Description Check βœ… Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check βœ… Passed 제λͺ©μ€ μ €μž₯된 SSRF 방지와 URL 검증 쀑 AttributeError μˆ˜μ •μ„ λͺ…ν™•ν•˜κ³  κ°„κ²°ν•˜κ²Œ μ„€λͺ…ν•˜λ©° λ³€κ²½ 사항과 직접 κ΄€λ ¨λ©λ‹ˆλ‹€.
Docstring Coverage βœ… Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check βœ… Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check βœ… Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches πŸ’‘ 1
πŸ› οΈ Fix failing CI checks πŸ’‘
  • Create stacked PR
  • Commit on current branch
πŸ“ Generate docstrings
  • Create stacked PR
  • Commit on current branch
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/sentinel-ssrf-type-check-14678305360862845164

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.

❀️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 932f98f and 67725ad.

πŸ“’ Files selected for processing (5)
  • .jules/sentinel.md
  • appguardrail_core/controlplane.py
  • scanner/cli/appguardrail.py
  • tests/test_controlplane.py
  • tests/test_ssrf_protection.py

Comment thread appguardrail_core/controlplane.py
@seonghobae
seonghobae merged commit bb10d4d into develop Aug 12, 2026
38 checks passed
@seonghobae
seonghobae deleted the fix/sentinel-ssrf-type-check-14678305360862845164 branch August 12, 2026 05:33
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Security Aug 12, 2026
seonghobae added a commit that referenced this pull request Aug 12, 2026
Restack PR #910 onto the protected develop head after #924 integrated the runtime boundary fix. Keep only the unique packaged scanner rule, CWE-918 taxonomy, and focused regression coverage; drop superseded runtime and formatting changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant