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

Fix error 206 for new Facebook user when verifyUserEmails is true #8352

Closed
wants to merge 50 commits into from

Conversation

ashish-naik
Copy link

New Pull Request Checklist

  • [x ] I am not disclosing a vulnerability.
  • [ x] I am creating this PR in reference to an issue.

Issue Description

When verifyUserEmails is true, if a new Facebook user tries to login then gets error 206 wherein PFUser project fails to get saved.

Closes: #6511

Approach

In current implementation of RestWrite.prototype.handleAuthData, storage['authProvider'] is not set when user with authData does not exist.
storage['authProvider'] needs to be set before evaluating whether users with authData exists or not.

TODOs before merging

  • [X ] Add tests
  • Add changes to documentation (guides, repository pages, in-code descriptions)
  • Add security check
  • Add new Parse Error codes to Parse JS SDK

snyk-bot and others added 30 commits October 31, 2022 15:29
# [5.4.0-alpha.1](5.3.0...5.4.0-alpha.1) (2022-10-31)

### Bug Fixes

* authentication adapter app ID validation may be circumvented; this fixes a vulnerability that affects configurations which allow users to authenticate using the Parse Server authentication adapter for *Facebook* or *Spotify* and where the server-side authentication adapter configuration `appIds` is set as a string (e.g. `abc`) instead of an array of strings (e.g. `["abc"]`) ([GHSA-r657-33vp-gp22](GHSA-r657-33vp-gp22)) [skip release] ([#8187](#8187)) ([8c8ec71](8c8ec71))
* brute force guessing of user sensitive data via search patterns (GHSA-2m6g-crv8-p3c6) ([#8146](#8146)) [skip release] ([4c0c7c7](4c0c7c7))
* certificate in Apple Game Center auth adapter not validated [skip release] ([#8058](#8058)) ([75af9a2](75af9a2))
* graphQL query ignores condition `equalTo` with value `false` ([#8032](#8032)) ([7f5a15d](7f5a15d))
* internal indices for classes `_Idempotency` and `_Role` are not protected in defined schema ([#8121](#8121)) ([c16f529](c16f529))
* invalid file request not properly handled [skip release] ([#8062](#8062)) ([4c9e956](4c9e956))
* liveQuery with `containedIn` not working when object field is an array ([#8128](#8128)) ([1d9605b](1d9605b))
* protected fields exposed via LiveQuery (GHSA-crrq-vr9j-fxxh) [skip release] ([#8076](#8076)) ([9fd4516](9fd4516))
* push notifications `badge` doesn't update with Installation beforeSave trigger ([#8162](#8162)) ([3c75c2b](3c75c2b))
* query aggregation pipeline cannot handle value of type `Date` when `directAccess: true` ([#8167](#8167)) ([e424137](e424137))
* relation constraints in compound queries `Parse.Query.or`, `Parse.Query.and` not working ([#8203](#8203)) ([28f0d26](28f0d26))
* security upgrade undici from 5.6.0 to 5.8.0 ([#8108](#8108)) ([4aa016b](4aa016b))
* server crashes when receiving file download request with invalid byte range; this fixes a security vulnerability that allows an attacker to impact the availability of the server instance; the fix improves parsing of the range parameter to properly handle invalid range requests ([GHSA-h423-w6qv-2wj3](GHSA-h423-w6qv-2wj3)) [skip release] ([#8238](#8238)) ([c03908f](c03908f))
* session object properties can be updated by foreign user; this fixes a security vulnerability in which a foreign user can write to the session object of another user if the session object ID is known; the fix prevents writing to foreign session objects ([GHSA-6w4q-23cf-j9jp](GHSA-6w4q-23cf-j9jp)) [skip release] ([#8180](#8180)) ([37fed30](37fed30))
* sorting by non-existing value throws `INVALID_SERVER_ERROR` on Postgres ([#8157](#8157)) ([3b775a1](3b775a1))
* updating object includes unchanged keys in client response for certain key types ([#8159](#8159)) ([37af1d7](37af1d7))

### Features

* add convenience access to Parse Server configuration in Cloud Code via `Parse.Server` ([#8244](#8244)) ([9f11115](9f11115))
* add option to change the default value of the `Parse.Query.limit()` constraint ([#8152](#8152)) ([0388956](0388956))
* add support for MongoDB 6 ([#8242](#8242)) ([aba0081](aba0081))
* add support for Postgres 15 ([#8215](#8215)) ([2feb6c4](2feb6c4))
* liveQuery support for unsorted distance queries ([#8221](#8221)) ([0f763da](0f763da))
…d via Cloud Code Webhooks or Triggers; fixes security vulnerability [GHSA-xprv-wvh7-qqqx](GHSA-xprv-wvh7-qqqx) (#8304)
BREAKING CHANGE: This release removes Node 12 and Node 17 support
# [6.0.0-alpha.1](5.4.0-alpha.1...6.0.0-alpha.1) (2022-11-10)

### Bug Fixes

* Remove Node 12 and Node 17 support ([#8279](#8279)) ([2546cc8](2546cc8))

### BREAKING CHANGES

* This release removes Node 12 and Node 17 support ([2546cc8](2546cc8))
…r authentication (MFA), authentication challenges, and provide a more powerful interface for writing custom authentication adapters (#8156)
# [6.0.0-alpha.2](6.0.0-alpha.1...6.0.0-alpha.2) (2022-11-10)

### Features

* Improve authentication adapter interface to support multi-factor authentication (MFA), authentication challenges, and provide a more powerful interface for writing custom authentication adapters ([#8156](#8156)) ([5bbf9ca](5bbf9ca))
… request `Parse.Cloud.httpRequest` (#8287)

BREAKING CHANGE: The convenience method for HTTP requests `Parse.Cloud.httpRequest` is removed; use your preferred 3rd party library for making HTTP requests
# [6.0.0-alpha.3](6.0.0-alpha.2...6.0.0-alpha.3) (2022-11-10)

### Features

* Remove deprecation `DEPPS4`: Remove convenience method for http request `Parse.Cloud.httpRequest`  ([#8287](#8287)) ([2d79c08](2d79c08))

### BREAKING CHANGES

* The convenience method for HTTP requests `Parse.Cloud.httpRequest` is removed; use your preferred 3rd party library for making HTTP requests ([2d79c08](2d79c08))
…lts to true (#8284)

BREAKING CHANGE: Config option `directAccess` defaults to true; set this to `false` in environments where multiple Parse Server instances run behind a load balancer and Parse requests within the current Node.js environment should be routed via the load balancer and distributed as HTTP requests among all instances via the `serverURL`.
# [6.0.0-alpha.4](6.0.0-alpha.3...6.0.0-alpha.4) (2022-11-10)

### Features

* Remove deprecation `DEPPS2`: Config option `directAccess` defaults to true ([#8284](#8284)) ([f535ee6](f535ee6))

### BREAKING CHANGES

* Config option `directAccess` defaults to true; set this to `false` in environments where multiple Parse Server instances run behind a load balancer and Parse requests within the current Node.js environment should be routed via the load balancer and distributed as HTTP requests among all instances via the `serverURL`. ([f535ee6](f535ee6))
…` crashes server (#8280)

BREAKING CHANGE: Throwing an error in Cloud Code Triggers `afterLogin`, `afterLogout` returns a rejected promise; in previous releases it crashed the server if you did not handle the error on the Node.js process level; consider adapting your code if your app currently handles these errors on the Node.js process level with `process.on('unhandledRejection', ...)`
# [6.0.0-alpha.5](6.0.0-alpha.4...6.0.0-alpha.5) (2022-11-10)

### Bug Fixes

* Throwing error in Cloud Code Triggers `afterLogin`, `afterLogout` crashes server ([#8280](#8280)) ([130d290](130d290))

### BREAKING CHANGES

* Throwing an error in Cloud Code Triggers `afterLogin`, `afterLogout` returns a rejected promise; in previous releases it crashed the server if you did not handle the error on the Node.js process level; consider adapting your code if your app currently handles these errors on the Node.js process level with `process.on('unhandledRejection', ...)` ([130d290](130d290))
BREAKING CHANGE: This release removes support for MongoDB 4.0; the new minimum supported MongoDB version is 4.2. which also removes support for the deprecated MongoDB MMAPv1 storage engine
# [6.0.0-alpha.6](6.0.0-alpha.5...6.0.0-alpha.6) (2022-11-10)

### Features

* Remove support for MongoDB 4.0 ([#8292](#8292)) ([37245f6](37245f6))

### BREAKING CHANGES

* This release removes support for MongoDB 4.0; the new minimum supported MongoDB version is 4.2. which also removes support for the deprecated MongoDB MMAPv1 storage engine ([37245f6](37245f6))
BREAKING CHANGE: This release upgrades to Redis 4; if you are using the Redis cache adapter with Parse Server then this is a breaking change as the Redis client options have changed; see the [Redis migration guide](https://github.com/redis/node-redis/blob/redis%404.0.0/docs/v3-to-v4.md) for more details (#8293)
# [6.0.0-alpha.7](6.0.0-alpha.6...6.0.0-alpha.7) (2022-11-11)

### Features

* Upgrade Redis 3 to 4 ([#8293](#8293)) ([7d622f0](7d622f0))

### BREAKING CHANGES

* This release upgrades to Redis 4; if you are using the Redis cache adapter with Parse Server then this is a breaking change as the Redis client options have changed; see the [Redis migration guide](https://github.com/redis/node-redis/blob/redis%404.0.0/docs/v3-to-v4.md) for more details (#8293) ([7d622f0](7d622f0))
BREAKING CHANGE: This release restricts the use of `masterKey` to localhost by default; if you are using Parse Dashboard on a different server to connect to Parse Server you need to add the IP address of the server that hosts Parse Dashboard to this option (#8281)
# [6.0.0-alpha.8](6.0.0-alpha.7...6.0.0-alpha.8) (2022-11-11)

### Features

* Restrict use of `masterKey` to localhost by default ([#8281](#8281)) ([6c16021](6c16021))

### BREAKING CHANGES

* This release restricts the use of `masterKey` to localhost by default; if you are using Parse Dashboard on a different server to connect to Parse Server you need to add the IP address of the server that hosts Parse Dashboard to this option (#8281) ([6c16021](6c16021))
…` defaults to `true` (#8283)

BREAKING CHANGE: The Parse Server option `enforcePrivateUsers` is set to `true` by default; in previous releases this option defaults to `false`; this change improves the default security configuration of Parse Server (#8283)
# [6.0.0-alpha.9](6.0.0-alpha.8...6.0.0-alpha.9) (2022-11-16)

### Features

* Remove deprecation `DEPPS3`: Config option `enforcePrivateUsers` defaults to `true` ([#8283](#8283)) ([ed499e3](ed499e3))

### BREAKING CHANGES

* The Parse Server option `enforcePrivateUsers` is set to `true` by default; in previous releases this option defaults to `false`; this change improves the default security configuration of Parse Server (#8283) ([ed499e3](ed499e3))
mtrezza and others added 20 commits November 16, 2022 23:18
# [6.0.0-alpha.10](6.0.0-alpha.9...6.0.0-alpha.10) (2022-11-19)

### Bug Fixes

* Cloud Code trigger `beforeSave` does not work with `Parse.Role` ([#8320](#8320)) ([f29d972](f29d972))
# [6.0.0-alpha.11](6.0.0-alpha.10...6.0.0-alpha.11) (2022-11-25)

### Bug Fixes

* Parse Server option `masterKeyIps` does not include localhost by default for IPv6 ([#8322](#8322)) ([ab82635](ab82635))
# [6.0.0-alpha.12](6.0.0-alpha.11...6.0.0-alpha.12) (2022-11-26)

### Features

* Upgrade Redis 3 to 4 for LiveQuery ([#8333](#8333)) ([b2761fb](b2761fb))
# [6.0.0-alpha.13](6.0.0-alpha.12...6.0.0-alpha.13) (2022-12-07)

### Features

* Add option to change the log level of the logs emitted by triggers ([#8328](#8328)) ([8f3b694](8f3b694))
# [6.0.0-alpha.14](6.0.0-alpha.13...6.0.0-alpha.14) (2022-12-16)

### Features

* Write log entry when request with master key is rejected as outside of `masterKeyIps` ([#8350](#8350)) ([e22b73d](e22b73d))
@parse-github-assistant
Copy link

The branch release can only be set as base branch by members of @parse-community/core-maintainers.

Pull requests are usually opened against the default branch alpha, which is the working branch. Different repositories may have base branches with different names. If you are sure you need to open this pull request against a different branch, please ask someone from the team mentioned above.

@parse-github-assistant
Copy link

Thanks for opening this pull request!

  • 🎉 We are excited about your hands-on contribution!

@codecov
Copy link

codecov bot commented Dec 17, 2022

Codecov Report

Base: 94.12% // Head: 94.24% // Increases project coverage by +0.11% 🎉

Coverage data is based on head (5a26426) compared to base (1d277db).
Patch coverage: 98.35% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff             @@
##           release    #8352      +/-   ##
===========================================
+ Coverage    94.12%   94.24%   +0.11%     
===========================================
  Files          182      180       -2     
  Lines        13775    13987     +212     
===========================================
+ Hits         12966    13182     +216     
+ Misses         809      805       -4     
Impacted Files Coverage Δ
src/Deprecator/Deprecations.js 100.00% <ø> (ø)
src/GraphQL/loaders/parseClassTypes.js 94.87% <ø> (ø)
src/Security/CheckGroups/CheckGroupDatabase.js 94.73% <ø> (ø)
src/cloud-code/Parse.Cloud.js 99.18% <ø> (-0.03%) ⬇️
src/Adapters/Cache/RedisCacheAdapter.js 91.11% <84.00%> (+3.39%) ⬆️
src/Config.js 88.69% <87.50%> (-0.24%) ⬇️
src/Routers/UsersRouter.js 96.21% <98.57%> (+1.83%) ⬆️
src/request.js 98.86% <98.86%> (-1.14%) ⬇️
src/Adapters/Auth/index.js 98.79% <100.00%> (+5.24%) ⬆️
src/Adapters/Cache/LRUCache.js 100.00% <100.00%> (ø)
... and 27 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

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

Successfully merging this pull request may close these issues.

8 participants