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

Cursor implementation is using eval() method #60

Closed
yurkovoznyak opened this issue May 22, 2020 · 1 comment
Closed

Cursor implementation is using eval() method #60

yurkovoznyak opened this issue May 22, 2020 · 1 comment

Comments

@yurkovoznyak
Copy link

Query cursor is a really powerful tool to implement pagination of a large dataset. A possible use case of this feature in API is to return the next page cursor value with response data.

But with the current implementation, it is not safe to do this, because the cursor string is passed to eval() method which is a security flaw.

Consider using json or pickle module to encode/decode filter options for queryset, that are stored in the cursor.

Another issue may be with the hacky user, that will change filter/limit/order values inside cursor, that will expose the whole collection data

@AxeemHaider
Copy link
Contributor

Thankfully @jackcvr is fixed this one on #59

For second part of your question you can encode and decode cursor on your end and then send to other users to avoid hacking in cursor. Any pull request for this will be acceptable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants