Skip to content

๐Ÿ›ก๏ธ Sentinel: [HIGH] Fix AttributeError in URL parsing - #914

Closed
seonghobae wants to merge 1 commit into
developfrom
sentinel-ssrf-type-check-13393151165230795568
Closed

๐Ÿ›ก๏ธ Sentinel: [HIGH] Fix AttributeError in URL parsing#914
seonghobae wants to merge 1 commit into
developfrom
sentinel-ssrf-type-check-13393151165230795568

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

๐Ÿšจ Severity: HIGH
๐Ÿ’ก Vulnerability: _is_safe_url ํ•จ์ˆ˜์— ๋ฌธ์ž์—ด์ด ์•„๋‹Œ ๊ฐ’(True, None, 123 ๋“ฑ)์ด ์ „๋‹ฌ๋  ๊ฒฝ์šฐ urllib.parse.urlparse์—์„œ AttributeError ์˜ˆ์™ธ๊ฐ€ ๋ฐœ์ƒํ•˜์—ฌ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์ถฉ๋Œ ๋ฐ API 500 ์—๋Ÿฌ๋ฅผ ์œ ๋ฐœํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
๐ŸŽฏ Impact: ์ž˜๋ชป๋œ ์ž…๋ ฅ ๊ฐ’์œผ๋กœ ์ธํ•œ ํ”„๋กœ์„ธ์Šค ๋น„์ •์ƒ ์ข…๋ฃŒ ๋ฐ ์„œ๋น„์Šค ๊ฐ€์šฉ์„ฑ ์ €ํ•˜ (Denial of Service).
๐Ÿ”ง Fix: URL ๋ฌธ์ž์—ด ํŒŒ์‹ฑ ์ „ isinstance(url, str) ์ฒดํฌ๋ฅผ ์ถ”๊ฐ€ํ•˜์—ฌ, ๋ฌธ์ž์—ด์ด ์•„๋‹Œ ์ž…๋ ฅ๊ฐ’์— ๋Œ€ํ•ด์„œ๋Š” ์•ˆ์ „ํ•˜๊ฒŒ False๋ฅผ ๋ฐ˜ํ™˜(Fail Closed)ํ•˜๋„๋ก ์ˆ˜์ •ํ–ˆ์Šต๋‹ˆ๋‹ค.
โœ… Verification: pytest tests/test_ssrf_protection.py๋ฅผ ํ†ตํ•ด ๋ฌธ์ž์—ด ์™ธ ํƒ€์ž…์— ๋Œ€ํ•ด ์˜ฌ๋ฐ”๋ฅด๊ฒŒ ์‹คํŒจํ•˜๋Š”์ง€ ๊ฒ€์ฆ ์™„๋ฃŒ.


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

Summary by CodeRabbit

  • ๋ฒ„๊ทธ ์ˆ˜์ •

    • URL ๊ฒ€์ฆ ์‹œ ๋ฌธ์ž์—ด์ด ์•„๋‹Œ ์ž…๋ ฅ์„ ์•ˆ์ „ํ•˜์ง€ ์•Š์€ URL๋กœ ์ฒ˜๋ฆฌํ•˜๋„๋ก ๊ฐœ์„ ํ–ˆ์Šต๋‹ˆ๋‹ค.
    • ์ž˜๋ชป๋œ ์ž…๋ ฅ์œผ๋กœ ์ธํ•œ ์ฒ˜๋ฆฌ ์˜ค๋ฅ˜ ๋Œ€์‹  ์•ˆ์ „ํ•˜๊ฒŒ ์‹คํŒจํ•ฉ๋‹ˆ๋‹ค.
  • ํ…Œ์ŠคํŠธ

    • ๋ถˆ๋ฆฌ์–ธ, ์ˆซ์ž, None, ๋ชฉ๋ก ๋“ฑ ๋‹ค์–‘ํ•œ ๋น„๋ฌธ์ž์—ด ์ž…๋ ฅ์— ๋Œ€ํ•œ ๊ฒ€์ฆ์„ ์ถ”๊ฐ€ํ–ˆ์Šต๋‹ˆ๋‹ค.

๐Ÿšจ Severity: HIGH
๐Ÿ’ก Vulnerability: `_is_safe_url` ํ•จ์ˆ˜์— ๋ฌธ์ž์—ด์ด ์•„๋‹Œ ๊ฐ’(True, None, 123 ๋“ฑ)์ด ์ „๋‹ฌ๋  ๊ฒฝ์šฐ `urllib.parse.urlparse`์—์„œ `AttributeError` ์˜ˆ์™ธ๊ฐ€ ๋ฐœ์ƒํ•˜์—ฌ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์ถฉ๋Œ ๋ฐ API 500 ์—๋Ÿฌ๋ฅผ ์œ ๋ฐœํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
๐ŸŽฏ Impact: ์ž˜๋ชป๋œ ์ž…๋ ฅ ๊ฐ’์œผ๋กœ ์ธํ•œ ํ”„๋กœ์„ธ์Šค ๋น„์ •์ƒ ์ข…๋ฃŒ ๋ฐ ์„œ๋น„์Šค ๊ฐ€์šฉ์„ฑ ์ €ํ•˜ (Denial of Service).
๐Ÿ”ง Fix: URL ๋ฌธ์ž์—ด ํŒŒ์‹ฑ ์ „ `isinstance(url, str)` ์ฒดํฌ๋ฅผ ์ถ”๊ฐ€ํ•˜์—ฌ, ๋ฌธ์ž์—ด์ด ์•„๋‹Œ ์ž…๋ ฅ๊ฐ’์— ๋Œ€ํ•ด์„œ๋Š” ์•ˆ์ „ํ•˜๊ฒŒ `False`๋ฅผ ๋ฐ˜ํ™˜(Fail Closed)ํ•˜๋„๋ก ์ˆ˜์ •ํ–ˆ์Šต๋‹ˆ๋‹ค.
โœ… Verification: `pytest tests/test_ssrf_protection.py`๋ฅผ ํ†ตํ•ด ๋ฌธ์ž์—ด ์™ธ ํƒ€์ž…์— ๋Œ€ํ•ด ์˜ฌ๋ฐ”๋ฅด๊ฒŒ ์‹คํŒจํ•˜๋Š”์ง€ ๊ฒ€์ฆ ์™„๋ฃŒ.
@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 10, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. ๐ŸŽ‰

โ„น๏ธ Recent review info
โš™๏ธ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f794855b-0b78-4765-a781-47a7c10b8cba

๐Ÿ“ฅ Commits

Reviewing files that changed from the base of the PR and between 0d07baa and bdc3adf.

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

๐Ÿ“ Walkthrough

Walkthrough

๋‘ _is_safe_url ํ•จ์ˆ˜๊ฐ€ URL ํŒŒ์‹ฑ ์ „์— ๋ฌธ์ž์—ด ํƒ€์ž…์„ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค. ๋ฌธ์ž์—ด์ด ์•„๋‹Œ ์ž…๋ ฅ์€ False๋กœ ์ฒ˜๋ฆฌ๋ฉ๋‹ˆ๋‹ค. ๋ถˆ๋ฆฌ์–ธ, ์ •์ˆ˜, None, ๋ฆฌ์ŠคํŠธ ์ž…๋ ฅ์— ๋Œ€ํ•œ ํ…Œ์ŠคํŠธ์™€ ์š”๊ตฌ์‚ฌํ•ญ์ด ์ถ”๊ฐ€๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

Changes

URL ์ž…๋ ฅ ๊ฒ€์ฆ

Layer / File(s) Summary
์•ˆ์ „ํ•œ URL ์ž…๋ ฅ ๊ฒฝ๊ณ„
.jules/sentinel.md, appguardrail_core/controlplane.py, scanner/cli/appguardrail.py, tests/test_ssrf_protection.py
๋‘ _is_safe_url ๊ตฌํ˜„์ด ๋ฌธ์ž์—ด์ด ์•„๋‹Œ ์ž…๋ ฅ์„ ์ฆ‰์‹œ ๊ฑฐ๋ถ€ํ•ฉ๋‹ˆ๋‹ค. ๊ด€๋ จ ์š”๊ตฌ์‚ฌํ•ญ์ด ์ถ”๊ฐ€๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ๋น„๋ฌธ์ž์—ด ์ž…๋ ฅ์ด ๋ชจ๋‘ False๋ฅผ ๋ฐ˜ํ™˜ํ•˜๋Š”์ง€ ํ…Œ์ŠคํŠธํ•ฉ๋‹ˆ๋‹ค.

Estimated code review effort: 1 (๋งค์šฐ ๋‚ฎ์Œ) | ~5๋ถ„

Possibly related PRs

  • ContextualWisdomLab/appguardrail#877: ๋™์ผํ•œ _is_safe_url ๊ตฌํ˜„์˜ URL ์•ˆ์ „์„ฑ ๊ฒ€์ฆ์„ ์ˆ˜์ •ํ•ฉ๋‹ˆ๋‹ค.
  • ContextualWisdomLab/appguardrail#885: ๋™์ผํ•œ _is_safe_url ๊ฒ€์ฆ์„ ๋ฆฌ๋‹ค์ด๋ ‰ํŠธ ๋ณด์•ˆ์— ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.
  • ContextualWisdomLab/appguardrail#910: ๋™์ผํ•œ ๋‘ _is_safe_url ๊ตฌํ˜„์—์„œ ๋น„๋ฌธ์ž์—ด ์ž…๋ ฅ์„ ๊ฑฐ๋ถ€ํ•ฉ๋‹ˆ๋‹ค.
๐Ÿšฅ Pre-merge checks | โœ… 4 | โŒ 1

โŒ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage โš ๏ธ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
โœ… Passed checks (4 passed)
Check name Status Explanation
Description Check โœ… Passed Check skipped - CodeRabbitโ€™s high-level summary is enabled.
Title check โœ… Passed ์ œ๋ชฉ์€ ๋น„๋ฌธ์ž์—ด URL ์ž…๋ ฅ์œผ๋กœ ๋ฐœ์ƒํ•˜๋Š” AttributeError ์ˆ˜์ •์ด๋ผ๋Š” ์ฃผ์š” ๋ณ€๊ฒฝ ์‚ฌํ•ญ์„ ๋ช…ํ™•ํ•˜๊ฒŒ ์„ค๋ช…ํ•ฉ๋‹ˆ๋‹ค.
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
๐Ÿ“ Generate docstrings ๐Ÿ’ก
  • Create stacked PR
  • Commit on current branch
๐Ÿงช Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sentinel-ssrf-type-check-13393151165230795568

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.

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

OpenCode cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head bdc3adfde3d0abfd0ec14e3fdd12e2383843512d.

  • Head SHA: bdc3adfde3d0abfd0ec14e3fdd12e2383843512d

  • Workflow run: 31361242910

  • Workflow attempt: 1

Coverage evidence

Coverage evidence job did not run or did not publish coverage evidence.

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file (3 files)"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file (3 files)"]
  R1 --> V1["required checks"]
  Evidence --> S2["Test: test_ssrf_protection.py"]
  S2 --> I2["regression suite"]
  I2 --> R2["Review risk: Test: test_ssrf_protection.py"]
  R2 --> V2["targeted test run"]
Loading

@opencode-agent

Copy link
Copy Markdown
Contributor

OpenCode Review Overview

  • Head SHA: bdc3adfde3d0abfd0ec14e3fdd12e2383843512d
  • Workflow run: 31361242910
  • Workflow attempt: 1
  • Gate result: REQUEST_CHANGES (approval step)

Pull request overview

OpenCode cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head bdc3adfde3d0abfd0ec14e3fdd12e2383843512d.

  • Head SHA: bdc3adfde3d0abfd0ec14e3fdd12e2383843512d

  • Workflow run: 31361242910

  • Workflow attempt: 1

Coverage evidence

Coverage evidence job did not run or did not publish coverage evidence.

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file (3 files)"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file (3 files)"]
  R1 --> V1["required checks"]
  Evidence --> S2["Test: test_ssrf_protection.py"]
  S2 --> I2["regression suite"]
  I2 --> R2["Review risk: Test: test_ssrf_protection.py"]
  R2 --> V2["targeted test run"]
Loading

Copy link
Copy Markdown
Contributor Author

Closing as superseded by #919 with the functional lineage preserved. Both branches add the same fail-closed string-type guard to the CLI and control-plane _is_safe_url boundaries on the same protected develop@0d07baae44a40edfcaec5e42c7fb9351510ca9f0. #919 additionally makes the public type contract truthful (object), documents both boundary functions, and tests integer, boolean, None, list, and mapping inputs. This branch has no distinct product behavior that is lost; #919 remains open and is not merge-ready while its current OpenCode coverage-evidence blocker and unrelated formatting churn are unresolved.

@seonghobae seonghobae closed this Aug 11, 2026
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Security Aug 11, 2026
@google-labs-jules

Copy link
Copy Markdown

Closing as superseded by #919 with the functional lineage preserved. Both branches add the same fail-closed string-type guard to the CLI and control-plane _is_safe_url boundaries on the same protected develop@0d07baae44a40edfcaec5e42c7fb9351510ca9f0. #919 additionally makes the public type contract truthful (object), documents both boundary functions, and tests integer, boolean, None, list, and mapping inputs. This branch has no distinct product behavior that is lost; #919 remains open and is not merge-ready while its current OpenCode coverage-evidence blocker and unrelated formatting churn are unresolved.

Understood. Acknowledging that this work is superseded and stopping work on this task.

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