Harden SQLCipher PRAGMA key against SQL injection #45
Labels
No labels
architecture
backlog
enhancement
module:documents
module:hardware
module:manage
module:pipeline
module:voice
priority:backlog
priority:high
priority:medium
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Circuit-Forge/circuitforge-core#45
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug
circuitforge_core/db/base.pyline 26 uses raw string interpolation to set the SQLCipher database key:If
keycontains a single quote or other SQL metacharacters, this is a SQL injection vector. All products that pass a per-user key toget_connection()in cloud mode are affected (Peregrine, Kiwi, Snipe).Fix
SQLCipher 4.x supports parameterized PRAGMA:
Confirm which SQLCipher version is pinned in requirements before choosing the approach. Add a test with a key containing
'to regression-cover this.Affected files
circuitforge_core/db/base.pyline 26Priority
Fix before any product ships cloud user data encryption. Low exploitability in current deployments (key comes from env, not user input) but the pattern is unsafe as the codebase grows.
Labels
security,bug