Skip to content

๐Ÿ›ก๏ธ Sentinel: [CRITICAL] ๋น„ ASCII API ํ‚ค๋กœ ์ธํ•œ 500 ์„œ๋ฒ„ ์˜ค๋ฅ˜(DoS) ์ทจ์•ฝ์  ์ˆ˜์ • - #340

Closed
seonghobae wants to merge 1 commit into
mainfrom
sentinel-fix-hmac-dos-3473964550003763815
Closed

๐Ÿ›ก๏ธ Sentinel: [CRITICAL] ๋น„ ASCII API ํ‚ค๋กœ ์ธํ•œ 500 ์„œ๋ฒ„ ์˜ค๋ฅ˜(DoS) ์ทจ์•ฝ์  ์ˆ˜์ •#340
seonghobae wants to merge 1 commit into
mainfrom
sentinel-fix-hmac-dos-3473964550003763815

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

๐Ÿšจ Severity: CRITICAL
๐Ÿ’ก Vulnerability: hmac.compare_digest ํ•จ์ˆ˜๋Š” ๋น„ ASCII ๋ฌธ์ž๊ฐ€ ํฌํ•จ๋œ ๋ฌธ์ž์—ด์„ ๋น„๊ตํ•  ๋•Œ TypeError๋ฅผ ๋ฐœ์ƒ์‹œํ‚ต๋‹ˆ๋‹ค. ๊ณต๊ฒฉ์ž๊ฐ€ ๋น„์ •์ƒ์ ์ธ ๋น„ ASCII ๋ฌธ์ž๊ฐ€ ํฌํ•จ๋œ X-API-Key ํ—ค๋”๋ฅผ ์ „์†กํ•˜๋ฉด, ์•ฑ์ด 401 ์‘๋‹ต ๋Œ€์‹  500 ์„œ๋ฒ„ ์˜ค๋ฅ˜๋กœ ๋ถ•๊ดด๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
๐ŸŽฏ Impact: ์ด๋ฅผ ์•…์šฉํ•˜๋ฉด ๊ฐ„๋‹จํ•œ ์š”์ฒญ๋งŒ์œผ๋กœ ์„œ๋ฒ„์— ์ฒ˜๋ฆฌ๋˜์ง€ ์•Š์€ ์˜ˆ์™ธ๋ฅผ ๋ฐ˜๋ณต์ ์œผ๋กœ ๋ฐœ์ƒ์‹œ์ผœ ์„œ๋น„์Šค ๊ฑฐ๋ถ€(DoS) ์ƒํƒœ๋ฅผ ์œ ๋ฐœํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
๐Ÿ”ง Fix: hmac.compare_digest ํ˜ธ์ถœ ์‹œ ์ œ๊ณต๋œ ํ‚ค์™€ ์„ค์ •๋œ ํ‚ค ๋ชจ๋‘ .encode("utf-8")์„ ์‚ฌ์šฉํ•˜์—ฌ ๋ช…์‹œ์ ์œผ๋กœ ๋ฐ”์ดํŠธ๋กœ ๋ณ€ํ™˜ํ•œ ํ›„ ๋น„๊ตํ•˜๋„๋ก ์ˆ˜์ •ํ–ˆ์Šต๋‹ˆ๋‹ค.
โœ… Verification: tests/test_saas_web.py์— ๋น„ ASCII ๋ฌธ์ž๊ฐ€ ํฌํ•จ๋œ API ํ‚ค ํ—ค๋”๋ฅผ ์ „์†กํ•ด๋„ 500 ์˜ค๋ฅ˜ ์—†์ด 401 ์‘๋‹ต์ด ์ •์ƒ ๋ฐ˜ํ™˜๋˜๋Š”์ง€ ํ™•์ธํ•˜๋Š” ๋‹จ์œ„ ํ…Œ์ŠคํŠธ๋ฅผ ์ถ”๊ฐ€ํ•˜๊ณ  ํ†ต๊ณผ๋ฅผ ํ™•์ธํ–ˆ์Šต๋‹ˆ๋‹ค.


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

Summary by CodeRabbit

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

    • ๋น„ASCII ๋ฌธ์ž๊ฐ€ ํฌํ•จ๋œ API ํ‚ค๋„ ์ธ์ฆ ์ฒ˜๋ฆฌ ์ค‘ ์˜ค๋ฅ˜ ์—†์ด ์•ˆ์ „ํ•˜๊ฒŒ ๊ฒ€์ฆ๋˜๋„๋ก ๊ฐœ์„ ํ–ˆ์Šต๋‹ˆ๋‹ค.
    • ์ž˜๋ชป๋œ API ํ‚ค ์ž…๋ ฅ ์‹œ ์„œ๋ฒ„ ์˜ค๋ฅ˜ ๋Œ€์‹  HTTP 401 ์‘๋‹ต์ด ๋ฐ˜ํ™˜๋ฉ๋‹ˆ๋‹ค.
  • ํ…Œ์ŠคํŠธ

    • ๋น„ASCII API ํ‚ค์— ๋Œ€ํ•œ ์ธ์ฆ ๋™์ž‘์„ ๊ฒ€์ฆํ•˜๋Š” ํ…Œ์ŠคํŠธ๋ฅผ ์ถ”๊ฐ€ํ–ˆ์Šต๋‹ˆ๋‹ค.

`hmac.compare_digest` ํ•จ์ˆ˜๊ฐ€ ๋น„ ASCII ๋ฌธ์ž๊ฐ€ ํฌํ•จ๋œ ๋ฌธ์ž์—ด์„ ๋น„๊ตํ•  ๋•Œ `TypeError`๋ฅผ ๋ฐœ์ƒ์‹œํ‚ค๋Š” ๋ฌธ์ œ๋ฅผ ์ˆ˜์ •ํ–ˆ์Šต๋‹ˆ๋‹ค.
์ด๋ฅผ ์•…์šฉํ•˜๋ฉด ์•…์˜์ ์ธ `X-API-Key` ํ—ค๋” ์ „์†ก ์‹œ 500 ๋‚ด๋ถ€ ์„œ๋ฒ„ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•˜์—ฌ DoS ๊ณต๊ฒฉ(CWE-400)์œผ๋กœ ์ด์–ด์งˆ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
`hmac.compare_digest` ํ˜ธ์ถœ ์‹œ ์ œ๊ณต๋œ ํ‚ค์™€ ์„ค์ •๋œ ํ‚ค ๋ชจ๋‘ `.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 2, 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: d638cb12-40fe-4633-a58e-37ae90e03359

๐Ÿ“ฅ Commits

Reviewing files that changed from the base of the PR and between 5a92586 and 03c61e9.

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

๐Ÿ“ Walkthrough

Walkthrough

API ํ‚ค ๋น„๊ต ์ „์— ์„ค์ •๊ฐ’๊ณผ ์š”์ฒญ ํ—ค๋”๋ฅผ UTF-8 ๋ฐ”์ดํŠธ๋กœ ๋ณ€ํ™˜ํ•ฉ๋‹ˆ๋‹ค. ๋น„ASCII API ํ‚ค ์ž…๋ ฅ์—์„œ ์˜ˆ์™ธ๊ฐ€ ๋ฐœ์ƒํ•˜์ง€ ์•Š๊ณ  401 ์‘๋‹ต์ด ๋ฐ˜ํ™˜๋˜๋Š” ํšŒ๊ท€ ํ…Œ์ŠคํŠธ์™€ Sentinel ๊ธฐ๋ก์„ ์ถ”๊ฐ€ํ–ˆ์Šต๋‹ˆ๋‹ค.

Changes

API ํ‚ค ์ธ์ฆ ์•ˆ์ •์„ฑ

Layer / File(s) Summary
API ํ‚ค ๋น„๊ต ๋ฐ ํšŒ๊ท€ ๊ฒ€์ฆ
saas_web.py, tests/test_saas_web.py, .jules/sentinel.md
hmac.compare_digest์— UTF-8 ๋ฐ”์ดํŠธ๋ฅผ ์ „๋‹ฌํ•˜๋„๋ก ๋ณ€๊ฒฝํ–ˆ์Šต๋‹ˆ๋‹ค. ๋น„ASCII X-API-Key ํ—ค๋”๊ฐ€ 401 ์‘๋‹ต์„ ๋ฐ˜ํ™˜ํ•˜๋Š”์ง€ ํ…Œ์ŠคํŠธํ•ฉ๋‹ˆ๋‹ค. ๋™์ผํ•œ ์ทจ์•ฝ์ ๊ณผ ๋Œ€์‘์ฑ…์„ Sentinel์— ๊ธฐ๋กํ–ˆ์Šต๋‹ˆ๋‹ค.

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

Possibly related PRs

  • ContextualWisdomLab/codec-carver#303: ๋™์ผํ•œ API ํ‚ค ๋น„๊ต ์ˆ˜์ •๊ณผ ๋น„ASCII ์ž…๋ ฅ์— ๋Œ€ํ•œ DoS ๋Œ€์‘์„ ๋‹ค๋ฃน๋‹ˆ๋‹ค.
  • ContextualWisdomLab/codec-carver#308: saas_web.py์˜ API ํ‚ค ๋น„๊ต ์ˆ˜์ •๊ณผ ์œ ๋‹ˆ์ฝ”๋“œ ์ธ์ฆ ํ…Œ์ŠคํŠธ๋ฅผ ํฌํ•จํ•ฉ๋‹ˆ๋‹ค.
  • ContextualWisdomLab/codec-carver#326: ๋น„๊ต ์ „์— API ํ‚ค๋ฅผ UTF-8 ๋ฐ”์ดํŠธ๋กœ ๋ณ€ํ™˜ํ•˜๊ณ  ํšŒ๊ท€ ํ…Œ์ŠคํŠธ๋ฅผ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค.
๐Ÿšฅ 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 ์ œ๋ชฉ์€ ๋น„ASCII API ํ‚ค๋กœ ๋ฐœ์ƒํ•˜๋Š” 500 ์˜ค๋ฅ˜์™€ DoS ์ทจ์•ฝ์  ์ˆ˜์ •์ด๋ผ๋Š” ํ•ต์‹ฌ ๋ณ€๊ฒฝ์„ ๋ช…ํ™•ํ•˜๊ฒŒ ์„ค๋ช…ํ•ฉ๋‹ˆ๋‹ค.
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
๐Ÿ“ Generate docstrings
  • Create stacked PR
  • Commit on current branch
๐Ÿงช Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sentinel-fix-hmac-dos-3473964550003763815

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

Copy link
Copy Markdown
Contributor Author

Superseded by canonical PR #361, which includes this non-ASCII API-key rejection and the larger credential-registry and result-retention security boundary. Closing the duplicate so validation converges on one head.

@seonghobae seonghobae closed this Aug 7, 2026
@google-labs-jules

Copy link
Copy Markdown

Superseded by canonical PR #361, which includes this non-ASCII API-key rejection and the larger credential-registry and result-retention security boundary. Closing the duplicate so validation converges on one head.

Understood. Acknowledging that this work is superseded by PR #361 and is now obsolete. 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

None yet

Development

Successfully merging this pull request may close these issues.

1 participant