π‘οΈ Sentinel: [CRITICAL] Fix info disclosure and timing attack vulnerabilities in internal router#198
Conversation
β¦ernal router 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: CRITICAL
π‘ Vulnerability: The internal daily-snapshot cronjob endpoint (
/internal/tasks/daily-snapshot) had two critical vulnerabilities:verify_scheduler_secretdependency used standard string comparison (!=) for validating the scheduler secret, allowing an attacker to theoretically guess the token character by character based on response times.scheduled_snapshot_jobleaked raw Python exception stack traces and strings (str(e)) directly to the client in HTTP 500 error responses, potentially exposing database states, column names, or other internal application context.π― Impact: Attackers could bypass authentication by guessing the scheduler secret, allowing them to repeatedly trigger massive database snapshot runs (DoS attack vector), and could mine the server for internal schema or backend state context via forced generic 500 exceptions.
π§ Fix:
x_scheduler_secret != expected_secretwith Python's securesecrets.compare_digestfunction. Added a check forNoneto preventTypeError.except Exception as e:toexcept Exception:, catching the error to log internally using Python's standardlogginglibrary withexc_info=Truefor debugging, while serving a sanitized, generic 500 error response to the client.β Verification:
cat,diff).uv run ruff check) to ensure valid formatting and module-level import locations.PR created automatically by Jules for task 13062859209899411874 started by @ivanleekk