Skip to content

Restrict use of masterKey to localhost by default #8245

Closed
@mtrezza

Description

@mtrezza

New Feature / Enhancement Checklist

Current Limitation

By default, Parse Server allows to use the master key with remote access. This creates a security risk because an exposed master key allows to access Parse Server with highest privileges via remote network requests against the public Parse Server API.

Parse Server already recommends in the documentation that the master key should never be used client side. Having the master key usable via remote access by default is contradictory to that advice.

Feature / Enhancement Description

To improve the default security of Parse Server, default the existing Parse Server option masterKeyIPs to 127.0.0.1, i.e. localhost.

The most common use case for master key being used remotely may be Parse Dashboard, which unfortunately still requires the master key, but that will hopefully change soon.

The feature must consider dynamic IP addresses, so it must be possible to not set any IP address restriction. That is currently the default, by not setting masterKeyIPs. If the new default is 127.0.0.1, it's unclear how to set no restriction, because masterKeyIPs: [] currently means "don't allow any IP address".

A suggested solution is to allow using CIDR notation in masterKeyIPs. If the string misses the CIDR range, it should be interpreted as using the range of /32. This also causes the least adoption effort for developers.

  • don't allow any IP address: masterKeyIPs: []
  • allow any IP address: masterKeyIPs: ['0.0.0.0/0']
  • allow only a single IP address: masterKeyIPs: ['10.0.0.1/32'] or masterKeyIPs: ['10.0.0.1']
  • allow only a specific IP address range: masterKeyIPs: ['10.0.0.1/16']

Example Use Case

n/a

Alternatives / Workarounds

n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    state:breakingBreaking change requires major version increment and `BREAKING CHANGE` commit messagestate:releasedReleased as stable versionstate:released-betaReleased as beta versiontype:featureNew feature or improvement of existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions