Skip to content

Cannot run distinct query as normal user #1042

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

Closed
jost-s opened this issue Dec 23, 2019 · 2 comments
Closed

Cannot run distinct query as normal user #1042

jost-s opened this issue Dec 23, 2019 · 2 comments

Comments

@jost-s
Copy link

jost-s commented Dec 23, 2019

Issue Description

I want to run a distinct query but get error message that master key was not provided. Checking in the code and tests this seems intentional. Why should these queries only be executed with master key?

Steps to reproduce

Run a query like new Parse.Query('SomeObject').distinct('property') from a client app.

Expected Results

Query is run successfully.

Actual Outcome

Error is thrown "Master Key was not provided".

Test Case

To accurately reproduce your issue. Add your test cases here and read the Contributing Guide to run the tests.

Environment Setup

  • Server

    • parse-server version (Be specific! Don't say 'latest'.) : 3.9.0
    • Operating System: macOS 10.13
    • Hardware: MacBook Pro 2018
    • Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): localhost
  • JS SDK

    • JS SDK version: 2.0.0
    • Application? (Browser, Node, React-Native, etc): Browser

Logs/Trace

@dplewis
Copy link
Member

dplewis commented Dec 23, 2019

You should use distinct in a cloud code where you have master key provided.

We found that aggregate calls are unsafe to call without master key.

Here is a past security example where expensive calls can lead to an attack.

@dplewis dplewis closed this as completed Dec 23, 2019
@jost-s
Copy link
Author

jost-s commented Dec 23, 2019

@dplewis Alright, got it, thank you!

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