SQL injection risk in getTableCount via fmt.Sprintf table name interpolation #27
Loading…
Reference in New Issue
Block a user
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
getTableCountininternal/vaultik/snapshot.gousesfmt.Sprintfto interpolate a table name directly into a SQL query:While currently only called with hardcoded table names (
files,chunks,blobs), this is a dangerous pattern. If the function is ever called with user-provided input, it becomes a SQL injection vulnerability.Fix
Validate the table name against an allowlist of known tables before interpolation.