🛡️ Sentinel: [CRITICAL] Fix SQL Injection in PRAGMA table_info check#88
🛡️ Sentinel: [CRITICAL] Fix SQL Injection in PRAGMA table_info check#88mattjoyce wants to merge 1 commit into
Conversation
…ed table-valued functions Co-authored-by: mattjoyce <278869+mattjoyce@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. |
…verifies under cap-only (#88) A cap-only gateway (CAP_SETUID+CAP_SETGID, no CAP_CHOWN) cannot chown worker dirs, so they are init-provisioned (sysusers.d accounts + tmpfiles.d 0700 dirs) and the gateway VERIFIES them fail-closed (reconcileWorkerDir: best-effort provision, then verify). Ships deploy/systemd/ templates + DEPLOYMENT.md §5b. Test gates switch from euid to hasDropCapability; adds TestPrivsepDropUnderCapabilityOnly for systemd-run.
…verifies under cap-only (#88) A cap-only gateway (CAP_SETUID+CAP_SETGID, no CAP_CHOWN) cannot chown worker dirs, so they are init-provisioned (sysusers.d accounts + tmpfiles.d 0700 dirs) and the gateway VERIFIES them fail-closed (reconcileWorkerDir: best-effort provision, then verify). Ships deploy/systemd/ templates + DEPLOYMENT.md §5b. Test gates switch from euid to hasDropCapability; adds TestPrivsepDropUnderCapabilityOnly for systemd-run.
🛡️ Sentinel: [CRITICAL] Fix SQL Injection vulnerability in PRAGMA table_info
🚨 Severity: CRITICAL
💡 Vulnerability: The
sqliteColumnExistsfunction ininternal/storage/sqlite.gowas usingfmt.Sprintfto directly interpolate thetablevariable into the PRAGMA query string (PRAGMA table_info(%s);). This creates a critical SQL injection risk if user-controlled or variable data is passed to this check.🎯 Impact: If exploited, an attacker could inject arbitrary SQLite syntax, bypass schema checks, read unintended tables, or potentially escalate depending on the surrounding logic or available attack surface.
🔧 Fix: Refactored the function to use SQLite's table-valued PRAGMA function (
pragma_table_info(?)), allowing the table name to be safely passed as a bound parameter. Explicitly double-quoted the"notnull"reserved keyword in the column list to avoid syntax errors.✅ Verification: Verified by running
make testandgo test ./internal/storage/...to ensure all functionality and tests remain green.PR created automatically by Jules for task 2208617742026367357 started by @mattjoyce