Skip to content

fix(url): malformed webhook URL에서 empty host를 거부 - #1210

Draft
seonghobae wants to merge 4 commits into
developfrom
repair/empty-host-validation-1208
Draft

fix(url): malformed webhook URL에서 empty host를 거부#1210
seonghobae wants to merge 4 commits into
developfrom
repair/empty-host-validation-1208

Conversation

@seonghobae

Copy link
Copy Markdown
Contributor

Problem

_is_safe_url()urlparse() 뒤 hostname이 비어 있어도 socket.getaddrinfo("")gaierror를 기존 dummy-domain compatibility 경로가 삼켜 최종 True를 반환할 수 있습니다. 그 결과 /api/v1/webhook ingestion이 http://, https://, http://user:pass@ 같은 구조적으로 잘못된 URL을 받아들일 수 있습니다.

현재 _send_alert()는 이후 urllib.request에서 이런 URL의 실제 전송에 실패하고 False를 반환하므로, 이 PR은 해당 입력만으로 내부 주소에 도달하는 CRITICAL SSRF를 입증했다고 주장하지 않습니다. 문제는 URL-validation invariant가 fail-open이라는 점입니다.

Minimal repair

  • scheme 검증 뒤 parsed.hostname이 비어 있으면 DNS 조회 전에 즉시 False.
  • webhook API에서 empty-host URL 세 종류가 400 invalid webhook url을 반환하는 regression 유지.
  • 기존 public HTTP/HTTPS webhook, redirect guard, DNS compatibility 정책은 변경하지 않음.
  • 이전 PR의 과도한 .jules/sentinel.md 보안 일반화는 승계하지 않음.

Lineage

PR #1208의 유효 production/test delta만 ordinary commit lineage에서 승계했습니다. Exact successor head: 56515db327993fd0c7c074fe4bc1abe25fc9cc96. Protected develop@e71d37e7c58118e6764c96ab7c4492fe33eed6f8 대비 fresh compare는 appguardrail_core/controlplane.py +2 lines, tests/test_controlplane.py +9 lines뿐입니다.

Acceptance

Draft 상태에서 exact-head unit/integration tests, SAST/security checks와 independent review가 GREEN이어야 합니다. 별도 connect-time DNS rebinding/TOCTOU 문제는 이 empty-host repair와 합쳐서 해결했다고 주장하지 않습니다.

seonghobae and others added 4 commits September 10, 2026 18:54
The `_is_safe_url` function failed to explicitly reject URLs with empty
hostnames (e.g. `http://`), relying on exceptions from downstream
`socket.getaddrinfo` which were silently caught. This updates the logic
to fail fast if the hostname is empty.

Also added tests to ensure protection against this bypass.
The `_is_safe_url` function failed to explicitly reject URLs with empty
hostnames (e.g. `http://`), relying on exceptions from downstream
`socket.getaddrinfo` which were silently caught. This updates the logic
to fail fast if the hostname is empty.

Also added tests to ensure protection against this bypass.
The `_is_safe_url` function failed to explicitly reject URLs with empty
hostnames (e.g. `http://`), relying on exceptions from downstream
`socket.getaddrinfo` which were silently caught. This updates the logic
to fail fast if the hostname is empty.

Also added tests to ensure protection against this bypass.
@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working priority: high

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant