Skip to content

fix: Add table name whitelist to prevent SQL injection in project del…#170

Merged
prabinoid merged 1 commit intonaxa-devfrom
pr-7218
Apr 13, 2026
Merged

fix: Add table name whitelist to prevent SQL injection in project del…#170
prabinoid merged 1 commit intonaxa-devfrom
pr-7218

Conversation

@prabinoid
Copy link
Copy Markdown

…etion

The DELETE query loop in Project.delete() interpolated table names directly into an f-string. Added an explicit whitelist with a validation check before each query to prevent SQL injection if table names ever become user-controlled. Flagged by Bandit (B608) and Semgrep.

What type of PR is this? (check all applicable)

  • 🍕 Feature
  • 🐛 Bug Fix
  • 📝 Documentation
  • 🧑‍💻 Refactor
  • ✅ Test
  • 🤖 Build or CI
  • ❓ Other (please specify)

Related Issue

Example: Fixes #123

Describe this PR

A brief description of how this solves the issue.

Screenshots

Please provide screenshots of the change.

Alternative Approaches Considered

Did you attempt any other approaches that are not documented in code?

Review Guide

Notes for the reviewer. How to test this change?

Checklist before requesting a review

[optional] What gif best describes this PR or how it makes you feel?

…etion

The DELETE query loop in Project.delete() interpolated table names
directly into an f-string. Added an explicit whitelist with a
validation check before each query to prevent SQL injection if
table names ever become user-controlled. Flagged by Bandit (B608)
and Semgrep.
@prabinoid prabinoid merged commit d10445a into naxa-dev Apr 13, 2026
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants