Skip to content

πŸ›‘οΈ Sentinel: [CRITICAL] API ν‚€ 인증의 DoS 취약점 μˆ˜μ • - #352

Open
seonghobae wants to merge 2 commits into
mainfrom
sentinel/fix-api-key-dos-6413954989246715754
Open

πŸ›‘οΈ Sentinel: [CRITICAL] API ν‚€ 인증의 DoS 취약점 μˆ˜μ •#352
seonghobae wants to merge 2 commits into
mainfrom
sentinel/fix-api-key-dos-6413954989246715754

Conversation

@seonghobae

Copy link
Copy Markdown
Contributor

🚨 Severity: CRITICAL
πŸ’‘ Vulnerability: API ν‚€ 인증 μ‹œ non-ASCII λ¬Έμžκ°€ ν¬ν•¨λœ 헀더λ₯Ό μ „λ‹¬ν•˜λ©΄ hmac.compare_digestμ—μ„œ TypeErrorκ°€ λ°œμƒν•˜μ—¬ 500 Internal Server Errorλ₯Ό μœ λ°œν•©λ‹ˆλ‹€.
🎯 Impact: μ•…μ˜μ μΈ μ‚¬μš©μžκ°€ 특수 λ¬Έμžκ°€ ν¬ν•¨λœ 인증 헀더λ₯Ό λŒ€λŸ‰μœΌλ‘œ μ „μ†‘ν•˜μ—¬ μ„œλ²„λ₯Ό ν¬λž˜μ‹œμ‹œν‚€κ±°λ‚˜ μ„œλΉ„μŠ€ κ±°λΆ€(DoS) 곡격을 μˆ˜ν–‰ν•  수 μžˆμŠ΅λ‹ˆλ‹€.
πŸ”§ Fix: hmac.compare_digestλ₯Ό ν˜ΈμΆœν•˜κΈ° 전에 두 인자λ₯Ό λͺ…μ‹œμ μœΌλ‘œ UTF-8 λ°”μ΄νŠΈ 슀트링(.encode('utf-8'))으둜 μΈμ½”λ”©ν•˜μ—¬ νƒ€μž… 였λ₯˜λ₯Ό λ°©μ§€ν–ˆμŠ΅λ‹ˆλ‹€.
βœ… Verification: ν…ŒμŠ€νŠΈ μ½”λ“œ test_require_api_key_non_asciiλ₯Ό μΆ”κ°€ν•˜μ—¬ non-ASCII λ¬Έμžκ°€ ν¬ν•¨λœ 헀더 처리 μ‹œ μ„œλ²„κ°€ ν¬λž˜μ‹œλ˜μ§€ μ•Šκ³  401 였λ₯˜λ₯Ό λ°˜ν™˜ν•¨μ„ ν™•μΈν–ˆμŠ΅λ‹ˆλ‹€. 전체 ν…ŒμŠ€νŠΈ μŠ€μœ„νŠΈλ„ μ„±κ³΅μ μœΌλ‘œ ν†΅κ³Όν–ˆμŠ΅λ‹ˆλ‹€.


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

API ν‚€ 인증 μ‹œ `hmac.compare_digest`에 non-ASCII λ¬Έμžκ°€ ν¬ν•¨λœ λ¬Έμžμ—΄μ΄ 전달될 경우 `TypeError`κ°€ λ°œμƒν•˜μ—¬ μ„œλ²„κ°€ 500 μ—λŸ¬λ₯Ό λ°˜ν™˜ν•˜λŠ” 취약점을 μˆ˜μ •ν–ˆμŠ΅λ‹ˆλ‹€.
두 인자λ₯Ό `.encode('utf-8')`둜 λ³€ν™˜ν•˜μ—¬ μ•ˆμ „ν•˜κ²Œ λ°”μ΄νŠΈ μŠ€νŠΈλ§μ„ λΉ„κ΅ν•˜λ„λ‘ κ°œμ„ ν–ˆμŠ΅λ‹ˆλ‹€.
@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 4, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

Next review available in: 6 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

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: c205dfea-95d0-425e-b098-d5c3470c95ba

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 963291f and 85c21ba.

πŸ“’ Files selected for processing (3)
  • .jules/sentinel.md
  • saas_web.py
  • tests/test_saas_web.py

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

- API ν‚€ 인증 μ‹œ `hmac.compare_digest`에 non-ASCII λ¬Έμžκ°€ ν¬ν•¨λœ λ¬Έμžμ—΄μ΄ 전달될 경우 `TypeError`κ°€ λ°œμƒν•˜μ—¬ μ„œλ²„κ°€ 500 μ—λŸ¬λ₯Ό λ°˜ν™˜ν•˜λŠ” 취약점을 μˆ˜μ •ν–ˆμŠ΅λ‹ˆλ‹€. (`.encode('utf-8')` 적용)
- `tests/test_saas_web.py`μ—μ„œ `starlette` μž„ν¬νŠΈλ₯Ό `_HAS_FASTAPI` 쑰건문 λ‚΄λΆ€λ‘œ μ΄λ™μ‹œμΌœ, `fastapi`κ°€ μ„€μΉ˜λ˜μ§€ μ•Šμ€ ν™˜κ²½μ—μ„œλ„ CI ν…ŒμŠ€νŠΈ μˆ˜μ§‘(collection) μ‹œ `ModuleNotFoundError`κ°€ λ°œμƒν•˜μ§€ μ•Šλ„λ‘ μˆ˜μ •ν–ˆμŠ΅λ‹ˆλ‹€.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant