π‘οΈ Sentinel: [CRITICAL] Fix SQL injection in SQLite PRAGMA statement#98
π‘οΈ Sentinel: [CRITICAL] Fix SQL injection in SQLite PRAGMA statement#98mapleleaflatte03 wants to merge 3 commits into
Conversation
Co-authored-by: mapleleaflatte03 <240846662+mapleleaflatte03@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. |
β¦and fix acceptance test Co-authored-by: mapleleaflatte03 <240846662+mapleleaflatte03@users.noreply.github.com>
β¦and fix acceptance test Co-authored-by: mapleleaflatte03 <240846662+mapleleaflatte03@users.noreply.github.com>
π¨ Severity: CRITICAL
π‘ Vulnerability: In
intelligence/company/meridian_platform/observability_store.py, theMERIDIAN_OBSERVABILITY_SQLITE_JOURNAL_MODEenvironment variable was used directly in an f-string to construct aPRAGMA journal_mode=SQL statement.π― Impact: Because SQLite
PRAGMAstatements do not support parameterized queries (?), interpolating unvalidated inputs creates a SQL injection vulnerability. Althoughsqlite3.Connection.execute()prevents multiple semicolon-separated statements (which limits the blast radius), an attacker who can control environment variables could potentially exploit this injection vector.π§ Fix: Implemented a strict allowlist validation check. The
configured_journal_modeis now explicitly checked against all safe, valid SQLite journal modes (DELETE,TRUNCATE,PERSIST,MEMORY,WAL,OFF) as well as internal bypass values (DEFAULT,''). Any unrecognized value is safely overridden with the defaultWAL.β Verification:
PYTHONPATH=intelligence/company/meridian_platform:intelligence:kernel python3 -m unittest intelligence/company/meridian_platform/test_status_surface.py intelligence/company/meridian_platform/test_alerting.pyPR created automatically by Jules for task 3335065020537012677 started by @mapleleaflatte03