fix: use whitelist for SQL table names in getTableCount (closes #7) #38
No reviewers
Labels
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sneak/vaultik#38
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/sql-injection-whitelist"
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?
Summary
Replace regex-based validation in
getTableCount()with a strict whitelist of allowed table names (files,chunks,blobs). The whitelist check now runs before the nil-DB early return, ensuring invalid names are always rejected regardless of DB state.Also removes the now-unused
regexpimport.Test
Added
table_count_test.gowith tests for:make test output
All tests pass, 0 lint issues.
make testoutput (lint + tests)✅ All checks pass — 0 lint issues, all tests PASS.
why do we have this? table names aren’t user-supplied. it’s our own code. remove this nonsense.
You're right — table names are hardcoded in our own code, not user-supplied. No attack vector. Closed.
Pull request closed