๐ก๏ธ Sentinel: [HIGH] hmac.compare_digest DoS ์ทจ์ฝ์ ์์ - #523
๐ก๏ธ Sentinel: [HIGH] hmac.compare_digest DoS ์ทจ์ฝ์ ์์ #523seonghobae wants to merge 1 commit into
Conversation
๋น-ASCII ๋ฌธ์์ด์ `hmac.compare_digest`์ ์ ๋ฌํ๋ฉด `TypeError`๊ฐ ๋ฐ์ํ์ฌ ์๋น์ค ๊ฑฐ๋ถ(DoS)๋ฅผ ์ ๋ฐํ ์ ์๋ ์ทจ์ฝ์ ์ ์์ ํ์ต๋๋ค. ๋ฌธ์์ด์ ๋น๊ตํ๊ธฐ ์ ์ UTF-8 ๋ฐ์ดํธ๋ก ์ธ์ฝ๋ฉํ์ฌ ์ ๋ ฅ ๋ฌธ์์ ๊ด๊ณ์์ด ์์ ํ๊ฒ ์ฒ๋ฆฌ๋๋๋ก ๋ณ๊ฒฝํ์ผ๋ฉฐ, ๋ฃจํ ์ธ๋ถ์์ ์ ๊ณต๋ ํค๋ฅผ ๋ฏธ๋ฆฌ ์ธ์ฝ๋ฉํ์ฌ ๋น๊ต ์ฑ๋ฅ๋ ์ต์ ํํ์ต๋๋ค.
|
๐ 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Warning Review limit reachedNext included review available in 59 minutes. View limit detailsLimit details: Youโve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: โ๏ธ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: ๐ Files selected for processing (3)
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. Comment |
Verified succession
์ด generated branch์ ์ ํจํ ์ ํ ์๊ตฌ์ฌํญ์ "๋น-ASCII/์์ raw credential์ด API-key ์ธ์ฆ ๊ฒฝ๊ณ์์ ์ฒ๋ฆฌ๋์ง ์์
hmac.compare_digest(str, str)์์ธ๋ฅผ ๋ง๋ค์ง ์๊ณ 401๋ก ๊ฑฐ์ ๋์ด์ผ ํ๋ค"๋ ๊ฒ์ ๋๋ค. ํด๋น ๊ณ์ฝ์ canonical auth lane #520 exact9ee46273ad9e7023af23cf88e19e6ee808840334์ ์์ ์น๊ณ๋๊ณ ๋ ๊ฐํ๊ฒ ๊ฒ์ฆ๋ฉ๋๋ค.#523 exact
cc08a82005565b5483bd2b2a974195628465594f์ ์ค์ delta๋ ์ธ ๊ฒฝ๋ก๋ฟ์ ๋๋ค.saas_web.py:request.headers.get()์ผ๋ก ์ด๋ฏธ ๋ฌธ์์ด view๊ฐ ๋ ๊ฐ์ UTF-8 ์ฌ์ธ์ฝ๋ฉํ๋ ๋จ์ bytes ๋น๊ต;tests/test_saas_web.py: rawb'wrong-\xff-key'๊ฐ 401์ด์ด์ผ ํ๋ค๋ ํ๊ท;.jules/sentinel.md: ๋ฌธ์์ด view๋ฅผ ํญ์ UTF-8 bytes๋ก ๋ฐ๊พธ๋ผ๋ ์ผ๋ฐํ๋ ์๋ฐฉ ๋ฌธ๊ตฌ.Canonical #520์
request.scope['headers']์ raw ASGI bytes๋ฅผ ์ง์ ์ธ์ฆ authority๋ก ์ฌ์ฉํ๊ณ ์ ํํ ํ๋์X-API-Key๋ง ํ์ฉํฉ๋๋ค. ๋ฐ๋ผ์ malformed/non-ASCII raw bytes๋ ์์ธ ์์ด 401๋ก ๊ฑฐ์ ํ๋ฉด์, configured Unicode credential์ ์ง์ง UTF-8 bytes๋ Starlette/Latin-1 ๋ฌธ์์ด round-trip ์์ด ์ ์ ์ธ์ฆ๋ฉ๋๋ค. #520์ ์ด Unicode success path, ๋ค๋ฅธ Unicode credential rejection, duplicate-header fail-closed, ๊ธฐ์กด non-ASCII rejection์ ๋ชจ๋ executable regression์ผ๋ก ๋ณด์ ํฉ๋๋ค.#523์ ๋จ์
request.headers.get(...).encode('utf-8')๊ตฌํ์ Unicode configured key์ public contract๋ฅผ ์ถ์ํ ์ ์์ผ๋ฏ๋ก successor์ ์น๊ณํ ์ ํจํ ๋ณ๋ source delta๊ฐ ์๋๋๋ค..jules์ blanket ์๋ฐฉ ๊ท์น๋ ๊ฐ์ ์ด์ ๋ก canonical source๋ณด๋ค ์ฝํ๊ณ ๋ถ์ ํํด ๋ณ๋ ์น๊ณ ๋์์ด ์๋๋๋ค.#520์ protected
main@90717c6e9954bf3b7a351137995ebe89975e46c2๋ฅผ non-force two-parent descendant๋ก ์ด๋ฏธ ์ฑํํ๊ณ fresh compare๊ฐbehind_by=0์ธ exact head9ee46273...์ ๋๋ค. ํด๋น head์ hosted CI/security evidence๋ ์๋ก queued/pending์ด๋ฉฐ predecessor evidence๋ ์ด์ ํ์ง ์์ต๋๋ค.๋ฐ๋ผ์ ์ด PR์ ๋จ์ queue ์ ๋ฆฌ๊ฐ ์๋๋ผ ๋ชจ๋ ์ ํจ behavior/test contract๊ฐ stronger canonical successor #520์ ์์ ์น๊ณ๋๊ณ , ์ฝํ/ํ๊ท ๊ฐ๋ฅํ ๊ตฌํ๊ณผ ๊ณผ๋ํ ์ผ๋ฐํ ๋ฌธ๊ตฌ๋ ์๋์ ์ผ๋ก ์น๊ณํ์ง ์๋ verified-succession close ๋์์ ๋๋ค.