🛡️ Sentinel: [HIGH] Fix timing attack and info disclosure in internal router#199
🛡️ Sentinel: [HIGH] Fix timing attack and info disclosure in internal router#199ivanleekk wants to merge 1 commit into
Conversation
Co-authored-by: ivanleekk <84584280+ivanleekk@users.noreply.github.com>
|
👋 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. |
🚨 Severity: HIGH
💡 Vulnerability: The internal scheduler API (
/internal/tasks/daily-snapshot) had two security issues:!=) for a secret token in a custom HTTP Header, opening it up to timing attacks.str(e)) in a 500 error response, potentially leaking internal implementation details (e.g., database connection strings, file paths) to the client.🎯 Impact:
SCHEDULER_SECRETcharacter by character.🔧 Fix:
!=check withsecrets.compare_digestfor constant-time comparison to prevent timing attacks, adding an explicitis Nonecheck to prevent runtime type errors if the header is omitted.logger.error("...", exc_info=True)to internally record the stack trace and maintain observability.✅ Verification:
backend/src/routers/internal.pyhave been verified.uv run ruff check src/routers/internal.py).PR created automatically by Jules for task 16789968966607745194 started by @ivanleekk