Skip to content

πŸ›‘οΈ Sentinel: [CRITICAL] Fix info disclosure and timing attack vulnerabilities in internal router#198

Open
ivanleekk wants to merge 1 commit into
devfrom
sentinel-fix-internal-router-security-13062859209899411874
Open

πŸ›‘οΈ Sentinel: [CRITICAL] Fix info disclosure and timing attack vulnerabilities in internal router#198
ivanleekk wants to merge 1 commit into
devfrom
sentinel-fix-internal-router-security-13062859209899411874

Conversation

@ivanleekk

Copy link
Copy Markdown
Owner

🚨 Severity: CRITICAL
πŸ’‘ Vulnerability: The internal daily-snapshot cronjob endpoint (/internal/tasks/daily-snapshot) had two critical vulnerabilities:

  1. Timing Attack: The verify_scheduler_secret dependency used standard string comparison (!=) for validating the scheduler secret, allowing an attacker to theoretically guess the token character by character based on response times.
  2. Information Disclosure: The scheduled_snapshot_job leaked 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:

  1. Replaced x_scheduler_secret != expected_secret with Python's secure secrets.compare_digest function. Added a check for None to prevent TypeError.
  2. Modified the catch block from except Exception as e: to except Exception:, catching the error to log internally using Python's standard logging library with exc_info=True for debugging, while serving a sanitized, generic 500 error response to the client.

βœ… Verification:

  • Reviewed the modifications using manual verification (cat, diff).
  • Ran Python linters (uv run ruff check) to ensure valid formatting and module-level import locations.
  • Ran backend pytest suite, observing the same passing/failing state as pre-patch tests, ensuring no logic regressions were introduced.

PR created automatically by Jules for task 13062859209899411874 started by @ivanleekk

…ernal router

Co-authored-by: ivanleekk <84584280+ivanleekk@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

πŸ‘‹ 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant