Skip to content

CLP (Read only) and write request using master key:  #1976

@neophob

Description

@neophob

Issue Description

  • set READ Only CLP (Simple Config)
  • try to update an entry / create a new entry

According to the Parse Docs, using the master key for an action should bypass all security checks:

The master key, on the other hand, is definitely a security mechanism. Using the master key allows you to bypass all of your app's security mechanisms, such as class-level permissions and ACLs. Having the master key is like having root access to your app's servers, and you should guard your master key with the same zeal with which you would guard your production machines' root password.

Steps to reproduce

  1. Create a Custom Table, set CLP to read only
  2. Use this code to create a new entry:
exports.createNewEntry = function(param) {
  const ParseEntry = Parse.Object.extend('Yourname');
  let parseEntry = new ParseEntry();
  parseEntry.set('param', param);

  let acl = new Parse.ACL();
  acl.setPublicReadAccess(true);
  acl.setPublicWriteAccess(false);
  parseEntry.setACL(acl);

  return parseEntry.save({}, { useMasterKey: true })
    .then(parseEntry => {
       ...
    });
};
  1. Result: ERROR: ParseError { code: 119, message: 'Permission denied for this action.' }

When I edit the CLP and allow write permission (or only the Create in the advanced section) this code works.

Expected Results

Bypass CLP/ACL Permission when using Master Key

Actual Outcome

No Permission

Environment Setup

  • Server
    • parse-server version: 2.2.11
    • Operating System: Linux (Ubuntu)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions