-
Notifications
You must be signed in to change notification settings - Fork 0
🛡️ Sentinel: [CRITICAL] API Key DoS 취약점 수정 #486
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
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 |
|---|---|---|
|
|
@@ -114,7 +114,8 @@ async def require_api_key(request: Request, call_next): | |
| if configured_keys and not (request.method == "GET" and request.url.path == "/"): | ||
| provided_key = request.headers.get("x-api-key", "") | ||
| if not any( | ||
| hmac.compare_digest(provided_key, key) for key in configured_keys | ||
| hmac.compare_digest(provided_key.encode("utf-8"), key.encode("utf-8")) | ||
| for key in configured_keys | ||
|
Comment on lines
+117
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 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
if rg -n 'os\.getenv|os\.environ' saas_web.py; then
echo "runtime environment-variable access remains in saas_web.py" >&2
exit 1
fi
rg -n -C 3 'credential|registry|KV|get_configured_api_keys' \
saas_web.py tests/test_saas_web.pyRepository: ContextualWisdomLab/codec-carver Length of output: 345 Security Misconfiguration (CWE-16) Reachability: External · Exploitability: Difficult 런타임 API 키를 credential registry/KV에서 조회하십시오.
🤖 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 var, not KV
AGENTS.md requires runtime secrets be read from a KV/credential registry and names
get_configured_api_keysreadingCODEC_CARVER_API_KEYSas a known deviation to migrate. This PR hardens the auth path but leaves the env-var read in place. Pre-existing and unchanged here.(Refers to this code)
Was this helpful? React with 👍 or 👎 to provide feedback.