Skip to content

Field email is not removed from Parse.User for unauthorized requests. #3593

@johanarnor

Description

@johanarnor

Issue Description

A user is fetched by another user, thus an "unauthorized" request. Even though it is stated that since 2.3.0, the email field on the user it is still present in the response.

Steps to reproduce

  • Don't specify userSensitiveFields, i.e. let it default to email only.
  • Make an unauthorized request to fetch a user.
  • Read the email property of the returned user.

Expected Results

The email property should be stripped.

Actual Outcome

The email property is still present.

Environment Setup

  • Server

    • parse-server version : 2.3.6
    • Operating System: Linux
    • Hardware: Heroku
    • Localhost or remote server?: Localhost/Heroku - same result
  • Database

    • MongoDB version: 3.0.12
    • Storage engine: MMAPv1
    • Localhost or remote server: mLab

Logs/Trace

When the userSensitiveFields field is not set, the userSensitiveFields array (in config) is split up on characters:
userSensitiveFields: [ 'e', 'm', 'a', 'i', 'l' ],

This makes the cleanup removes fields e, m, etc...

When specifying userSensitiveFields to e.g. config.userSensitiveFields = ['test'], the userSensitiveFields array is represented correctly:
userSensitiveFields: [ 'test', 'email' ],

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