Compare commits

...
9 Commits
Author SHA1 Message Date
Manuel 7e1da90bb2 added changelog 2021-08-20 19:56:37 +02:00
Manuel 0e3cae5c67 audit fix 2021-08-20 19:24:01 +02:00
Manuel f0d5232443 bumped version 2021-08-20 19:20:04 +02:00
Manuel a3483d82c8 fix changelog skip 4.5.1 2021-08-18 23:03:09 +02:00
Manuel 3c42584f59 4.5.2 2021-08-18 22:54:51 +02:00
Manuel 97b1dcad3b revert to version 4.5.0 for testing 2021-08-18 22:52:54 +02:00
Manuel 3a5c38d2e4 revert to version 4.5.0 for testing 2021-08-18 22:49:06 +02:00
Manuel 93d643e3eb change to RestWrite.createSession 2021-08-18 22:42:24 +02:00
Manuel 1306da7454 Merge pull request from GHSA-23r4-5mxp-c7g5 2021-08-18 22:24:29 +02:00
5 changed files with 600 additions and 431 deletions
+26 -1
View File
@@ -1,7 +1,32 @@
## Parse Server Changelog
### master
[Full Changelog](https://github.com/parse-community/parse-server/compare/4.5.0...master)
[Full Changelog](https://github.com/parse-community/parse-server/compare/4.10.0...master)
### 4.10.0
[Full Changelog](https://github.com/parse-community/parse-server/compare/4.5.2...4.10.0)
*Versions >4.5.2 and <4.10.0 are skipped.*
> ⚠️ A security incident caused a number of incorrect version tags to be pushed to the Parse Server repository. These version tags linked to a personal fork of a contributor who had write access to the repository. The code to which these tags linked has not been reviewed or approved by Parse Platform. Even though no releases were published with these incorrect versions, it was possible to define a Parse Server dependency that pointed to these version tags, for example if you defined this dependency:
> ```js
> "parse-server": "git@github.com:parse-community/parse-server.git#4.9.3"
> ```
>
> We have since deleted the incorrect version tags, but they may still show up if your personal fork on GitHub or locally. We do not know when these tags have been pushed to the Parse Server repository, but we first became aware of this issue on July 21, 2021. We are not aware of any malicious code or concerns related to privacy, security or legality (e.g. proprietary code). However, it has been reported that some functionality does not work as expected and the introduction of security vulnerabilities cannot be ruled out.
>
> You may be also affected if you used the Bitnami image for Parse Server. Bitnami picked up the incorrect version tag `4.9.3` and published a new Bitnami image for Parse Server.
>
>**If you are using any of the affected versions, we urgently recommend to upgrade to version `4.10.0`.**
### 4.5.2
[Full Changelog](https://github.com/parse-community/parse-server/compare/4.5.0...4.5.2)
### Security Fixes
- SECURITY FIX: Fixes incorrect session property `authProvider: password` of anonymous users. When signing up an anonymous user, the session field `createdWith` indicates incorrectly that the session has been created using username and password with `authProvider: password`, instead of an anonymous sign-up with `authProvider: anonymous`. This fixes the issue by setting the correct `authProvider: anonymous` for future sign-ups of anonymous users. This fix does not fix incorrect `authProvider: password` for existing sessions of anonymous users. Consider this if your app logic depends on the `authProvider` field. (Corey Baker) [GHSA-23r4-5mxp-c7g5](https://github.com/parse-community/parse-server/security/advisories/GHSA-23r4-5mxp-c7g5)
### 4.5.1
*This version was published by mistake and was deprecated.*
### 4.5.0
[Full Changelog](https://github.com/parse-community/parse-server/compare/4.4.0...4.5.0)
+508 -372
View File
File diff suppressed because it is too large Load Diff
+7 -7
View File
@@ -1,6 +1,6 @@
{
"name": "parse-server",
"version": "4.5.0",
"version": "4.10.0",
"description": "An express module providing a Parse-compatible API server",
"main": "lib/index.js",
"repository": {
@@ -25,7 +25,7 @@
"@graphql-tools/utils": "6.2.4",
"@parse/fs-files-adapter": "1.2.0",
"@parse/push-adapter": "3.4.0",
"@parse/s3-files-adapter": "1.6.0",
"@parse/s3-files-adapter": "1.6.2",
"@parse/simple-mailgun-adapter": "1.1.0",
"apollo-server-express": "2.19.0",
"bcryptjs": "2.4.3",
@@ -43,16 +43,16 @@
"jsonwebtoken": "8.5.1",
"jwks-rsa": "1.11.0",
"ldapjs": "2.2.2",
"lodash": "4.17.20",
"lodash": "4.17.21",
"lru-cache": "5.1.1",
"mime": "2.4.6",
"mongodb": "3.6.3",
"parse": "2.19.0",
"pg-promise": "10.8.1",
"pluralize": "8.0.0",
"redis": "3.0.2",
"redis": "3.1.2",
"semver": "7.3.2",
"subscriptions-transport-ws": "0.9.18",
"subscriptions-transport-ws": "0.10.0",
"tv4": "1.3.0",
"uuid": "8.3.1",
"winston": "3.3.3",
@@ -60,7 +60,7 @@
"ws": "7.4.0"
},
"devDependencies": {
"@babel/cli": "7.10.0",
"@babel/cli": "7.14.8",
"@babel/core": "7.10.0",
"@babel/plugin-proposal-object-rest-spread": "7.10.0",
"@babel/plugin-transform-flow-strip-types": "7.9.0",
@@ -84,7 +84,7 @@
"graphql-tag": "2.10.1",
"husky": "4.2.5",
"jasmine": "3.5.0",
"jsdoc": "3.6.3",
"jsdoc": "3.6.7",
"jsdoc-babel": "0.5.0",
"lint-staged": "10.2.3",
"mongodb-runner": "mongodb-js/runner",
+55 -51
View File
@@ -2374,59 +2374,63 @@ describe('Parse.User testing', () => {
});
});
it('user get session from token on signup', done => {
Promise.resolve()
.then(() => {
return Parse.User.signUp('finn', 'human', { foo: 'bar' });
})
.then(user => {
request({
headers: {
'X-Parse-Application-Id': 'test',
'X-Parse-Session-Token': user.getSessionToken(),
'X-Parse-REST-API-Key': 'rest',
},
url: 'http://localhost:8378/1/sessions/me',
}).then(response => {
const b = response.data;
expect(typeof b.sessionToken).toEqual('string');
expect(typeof b.createdWith).toEqual('object');
expect(b.createdWith.action).toEqual('signup');
expect(typeof b.user).toEqual('object');
expect(b.user.objectId).toEqual(user.id);
done();
});
});
it('user get session from token on signup', async () => {
const user = await Parse.User.signUp('finn', 'human', { foo: 'bar' });
const response = await request({
headers: {
'X-Parse-Application-Id': 'test',
'X-Parse-Session-Token': user.getSessionToken(),
'X-Parse-REST-API-Key': 'rest',
},
url: 'http://localhost:8378/1/sessions/me',
});
const data = response.data;
expect(typeof data.sessionToken).toEqual('string');
expect(typeof data.createdWith).toEqual('object');
expect(data.createdWith.action).toEqual('signup');
expect(data.createdWith.authProvider).toEqual('password');
expect(typeof data.user).toEqual('object');
expect(data.user.objectId).toEqual(user.id);
});
it('user get session from token on login', done => {
Promise.resolve()
.then(() => {
return Parse.User.signUp('finn', 'human', { foo: 'bar' });
})
.then(() => {
return Parse.User.logOut().then(() => {
return Parse.User.logIn('finn', 'human');
});
})
.then(user => {
request({
headers: {
'X-Parse-Application-Id': 'test',
'X-Parse-Session-Token': user.getSessionToken(),
'X-Parse-REST-API-Key': 'rest',
},
url: 'http://localhost:8378/1/sessions/me',
}).then(response => {
const b = response.data;
expect(typeof b.sessionToken).toEqual('string');
expect(typeof b.createdWith).toEqual('object');
expect(b.createdWith.action).toEqual('login');
expect(typeof b.user).toEqual('object');
expect(b.user.objectId).toEqual(user.id);
done();
});
});
it('user get session from token on username/password login', async () => {
await Parse.User.signUp('finn', 'human', { foo: 'bar' });
await Parse.User.logOut();
const user = await Parse.User.logIn('finn', 'human');
const response = await request({
headers: {
'X-Parse-Application-Id': 'test',
'X-Parse-Session-Token': user.getSessionToken(),
'X-Parse-REST-API-Key': 'rest',
},
url: 'http://localhost:8378/1/sessions/me',
});
const data = response.data;
expect(typeof data.sessionToken).toEqual('string');
expect(typeof data.createdWith).toEqual('object');
expect(data.createdWith.action).toEqual('login');
expect(data.createdWith.authProvider).toEqual('password');
expect(typeof data.user).toEqual('object');
expect(data.user.objectId).toEqual(user.id);
});
it('user get session from token on anonymous login', async () => {
const user = await Parse.AnonymousUtils.logIn();
const response = await request({
headers: {
'X-Parse-Application-Id': 'test',
'X-Parse-Session-Token': user.getSessionToken(),
'X-Parse-REST-API-Key': 'rest',
},
url: 'http://localhost:8378/1/sessions/me',
});
const data = response.data;
expect(typeof data.sessionToken).toEqual('string');
expect(typeof data.createdWith).toEqual('object');
expect(data.createdWith.action).toEqual('login');
expect(data.createdWith.authProvider).toEqual('anonymous');
expect(typeof data.user).toEqual('object');
expect(data.user.objectId).toEqual(user.id);
});
it('user update session with other field', done => {
+4
View File
@@ -857,6 +857,10 @@ RestWrite.prototype.createSessionToken = async function () {
return;
}
if (this.storage['authProvider'] == null && this.data.authData) {
this.storage['authProvider'] = Object.keys(this.data.authData).join(',');
}
const { sessionData, createSession } = Auth.createSession(this.config, {
userId: this.objectId(),
createdWith: {