π‘οΈ Sentinel: [HIGH] Fix timing attack and info disclosure in internal router#209
π‘οΈ Sentinel: [HIGH] Fix timing attack and info disclosure in internal router#209ivanleekk 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:
verify_scheduler_secretdependency used standard string equality (!=) for token comparison, which is vulnerable to timing attacks.scheduled_snapshot_jobendpoint caught generic exceptions and returneddetail=str(e)in the 500 HTTP response, which could disclose sensitive server internal details, stack traces, or configuration errors to an attacker.π― Impact:
π§ Fix:
verify_scheduler_secretto usesecrets.compare_digestfor constant-time string comparison (after safely checking forNone).scheduled_snapshot_jobto catch the genericException, log it internally usinglogger.error("...", exc_info=True)for debugging, and return a sanitized, generic 500 error to the client.β Verification:
uv run ruff check src/routers/internal.pyto ensure no linting errors.PR created automatically by Jules for task 17647889293721990540 started by @ivanleekk