Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protect against GET SQL injection #13

Closed
simonw opened this issue Mar 13, 2021 · 1 comment
Closed

Protect against GET SQL injection #13

simonw opened this issue Mar 13, 2021 · 1 comment
Labels
enhancement New feature or request security

Comments

@simonw
Copy link
Owner

simonw commented Mar 13, 2021

I'm really nervous about allowing attackers to trick my into visiting /dashboard/?sql=... with some hitherto unexpected evil query that somehow bypasses read-only protections or executed an XSS of some sort.

But I still want to be able to bookmark and share queries.

Maybe a solution can involve signatures? Execute queries with an authenticated CSRF protected POST, it then redirects and adds a signed parameter to verify that it's not from any untrusted source.

@simonw simonw added enhancement New feature or request security labels Mar 13, 2021
@simonw simonw added this to the First non-alpha release milestone Mar 13, 2021
@simonw
Copy link
Owner Author

simonw commented Mar 14, 2021

I'm going to use Django's signing for this:

from django.core import signing
signed_query = signing.dumps(sql_query, salt="django_sql_dashboard:query")

@simonw simonw closed this as completed in edbde26 Mar 14, 2021
simonw added a commit that referenced this issue Mar 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request security
Projects
None yet
Development

No branches or pull requests

1 participant