Repository navigation
🛡️ Sentinel: [CRITICAL] Fix API Key DoS vulnerability (API 키 DoS 취약점 수정) #491
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
|
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. 🔍 API keys still read from env var AGENTS.md marks the (Refers to this code) Was this helpful? React with 👍 or 👎 to provide feedback. |
| 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. 📝 Info: Encoding fix resolves the crash
Was this helpful? React with 👍 or 👎 to provide feedback.
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 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -e
printf '%s\n' '--- saas_web.py: configured-key helper and middleware ---'
sed -n '80,125p' saas_web.py
printf '%s\n' '--- scoped repository conventions ---'
find /tmp/coderabbit-repo-knowledge/contextualwisdomlab-codec-carver-ba5d139d -type f -path '*/contextualwisdomlab-codec-carver-ba5d139d*' -prune -o -false
head -5 /tmp/coderabbit-repo-knowledge/contextualwisdomlab-codec-carver-ba5d139d/*/*.md 2>/dev/null || trueRepository: ContextualWisdomLab/codec-carver Length of output: 6735 Security Misconfiguration (CWE-526) Reachability: External · Exploitability: Difficult API 키를 런타임 환경 변수에서 읽지 않도록 변경하십시오.
🤖 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.
🟡 Wrong year on new log entry
The new entry is dated
2024-08-28, two years before the surrounding 2026-dated entries and the actual fix date of 2026-08-28. The chronological log is now out of order.Was this helpful? React with 👍 or 👎 to provide feedback.