-
Notifications
You must be signed in to change notification settings - Fork 0
๐ก๏ธ Sentinel: [CRITICAL] hmac.compare_digest์ TypeError๋ก ์ธํ API ํค DoS ์ทจ์ฝ์ ์์ #471
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
๐ก๏ธ Sentinel: [CRITICAL] hmac.compare_digest์ TypeError๋ก ์ธํ API ํค DoS ์ทจ์ฝ์ ์์ #471
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -113,8 +113,9 @@ async def require_api_key(request: Request, call_next): | |
| configured_keys = get_configured_api_keys() | ||
| if configured_keys and not (request.method == "GET" and request.url.path == "/"): | ||
| provided_key = request.headers.get("x-api-key", "") | ||
| provided_key_bytes = provided_key.encode("utf-8") | ||
| if not any( | ||
| hmac.compare_digest(provided_key, key) for key in configured_keys | ||
| hmac.compare_digest(provided_key_bytes, key.encode("utf-8")) for key in configured_keys | ||
|
Comment on lines
+116
to
+118
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ๐ Security & Privacy | ๐ Major | ๐๏ธ Heavy lift ๋ฐํ์ API ํค๋ฅผ credential registry/KV์์ ์ฝ๋๋ก ๋ณ๊ฒฝํด์ผ ํฉ๋๋ค. ๋ฐ์ดํธ ๋น๊ต ๋ณ๊ฒฝ์ ์ฌ๋ฐ๋ฆ
๋๋ค. ๊ทธ๋ฌ๋ As per coding guidelines: ๐ค Prompt for AI AgentsSource: Coding guidelines |
||
| ): | ||
| return JSONResponse( | ||
| status_code=401, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๐ Info: API keys still read from env, not KV
get_configured_api_keysreadsCODEC_CARVER_API_KEYSviaos.environ(saas_web.py:97), the exact deviation AGENTS.md flags for migration to the credential registry. This PR does not touch that line, so it is unchanged here, but the migration remains outstanding.Was this helpful? React with ๐ or ๐ to provide feedback.