explorerhq / django-sql-explorer

Easily share data across your company via SQL queries.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Views return 404 for invalid object ids

jayvdb opened this issue · comments

If <int:query_id> in paths is not filled with an integer, the explorer-ui views currently reply with 404.

They should detect the incorrect type of value was used (Unfortunately Django doesnt do this), and reply with Bad Request (400) rather than Page not Found (404), and in the process avoid unnecessary db hits which could contribute to denial of service attacks.

This occurs for

  • /explorer-ui/<int:query_id>/
  • /explorer-ui/<int:query_id>/download
  • /explorer-ui/<int:query_id>/email_csv
  • /explorer-ui/<int:query_id>/stream

apologies. I found my problem elsewhere.