🛡️ Sentinel: [HIGH] Fix SQL injection in SQLite PRAGMA configuration - #278
🛡️ Sentinel: [HIGH] Fix SQL injection in SQLite PRAGMA configuration#278mapleleaflatte03 wants to merge 1 commit into
Conversation
…ration 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. |
🚨 Severity: HIGH
💡 Vulnerability: A SQL injection vulnerability (specifically configuration/PRAGMA injection) existed in
observability_store.pywhere thePRAGMA journal_modevalue was directly interpolated from theMERIDIAN_OBSERVABILITY_SQLITE_JOURNAL_MODEenvironment variable without strict validation. SQLitePRAGMAstatements do not support parameterized queries.🎯 Impact: An attacker or malicious user who can control this environment variable could potentially inject arbitrary SQL commands (e.g.,
WAL; DROP TABLE audit_events;), leading to data loss, unauthorized data manipulation, or denial of service within the observability database.🔧 Fix: Implemented an explicit allowlist
{'DELETE', 'TRUNCATE', 'PERSIST', 'MEMORY', 'WAL', 'OFF', '', 'DEFAULT'}for theconfigured_journal_mode. If the environment variable provides a value not in this allowlist, it safely falls back to'WAL'.✅ Verification:
PYTHONPATH=intelligence/company/meridian_platform python3 -m unittest discover -s intelligence/company/meridian_platform -p "test_*.py"to ensure the backend starts correctly and no new regressions were introduced (existing failures were preserved).'WAL; DROP TABLE') now correctly fall back to'WAL'instead of throwing a syntax error or executing the malicious payload..jules/sentinel.mddocumenting this codebase-specific PRAGMA injection pattern.PR created automatically by Jules for task 9149440834022562291 started by @mapleleaflatte03