You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Adapters/Storage/Mongo/MongoStorageAdapter.js
-59
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,6 @@ import Parse from 'parse/node';
18
18
import_from'lodash';
19
19
importdefaultsfrom'../../../defaults';
20
20
importloggerfrom'../../../logger';
21
-
importurlfrom'url';
22
21
23
22
// @flow-disable-next
24
23
constmongodb=require('mongodb');
@@ -132,7 +131,6 @@ export class MongoStorageAdapter implements StorageAdapter {
132
131
this._maxTimeMS=mongoOptions.maxTimeMS;
133
132
this.canSortOnJoinTables=true;
134
133
deletemongoOptions.maxTimeMS;
135
-
registerSecurityChecks(this);
136
134
}
137
135
138
136
connect(){
@@ -1059,61 +1057,4 @@ export class MongoStorageAdapter implements StorageAdapter {
1059
1057
});
1060
1058
}
1061
1059
}
1062
-
constregisterSecurityChecks=database=>{
1063
-
letdatabaseURI=database._uri;
1064
-
constdatabaseCheck=newParse.SecurityCheck({
1065
-
group: Parse.SecurityCheck.Category.Database,
1066
-
title: `Weak Database Password`,
1067
-
warning:
1068
-
'The database password set lacks complexity and length. This could potentially allow an attacker to brute force their way into the database, exposing the database.',
'The database requires no authentication to the admin port. This could potentially allow an attacker to easily access the database, exposing all of the database.',
'The database requires no authentication to connect. This could potentially allow an attacker to easily access the database, exposing all of the database.',
title: `No Class Level Permissions on ${className}`,
15
15
warning: `Any client can create, find, count, get, update, delete, or add field on ${className}. This allows an attacker to create new objects or fieldNames without restriction and potentially flood the database. Set CLPs using Parse Dashboard.`,
16
16
success: `Class Level Permissions on ${className}`,
@@ -25,14 +25,14 @@ async function registerCLP(options) {
25
25
if(className==='_User'&&key==='create'){
26
26
continue;
27
27
}
28
-
constoptionCheck=newParse.SecurityCheck({
29
-
group: Parse.SecurityCheck.Category.CLP,
28
+
constoptionCheck=newSecurityCheck({
29
+
group: SecurityCheck.Category.CLP,
30
30
title: `Unrestricted access to ${key}.`,
31
31
warning: `Any client can ${key} on ${className}.`,
32
32
success: `${key} is restricted on ${className}`,
33
33
});
34
-
constaddFileCheck=newParse.SecurityCheck({
35
-
group: Parse.SecurityCheck.Category.CLP,
34
+
constaddFileCheck=newSecurityCheck({
35
+
group: SecurityCheck.Category.CLP,
36
36
title: `Certain users can add fields.`,
37
37
warning: `Certain users can add fields on ${className}. This allows these users to create new fieldNames and potentially flood the schema. Set CLPs using Parse Dashboard.`,
38
38
success: `AddField is restricted on ${className}`,
@@ -44,10 +44,10 @@ async function registerCLP(options) {
'Clients are currently allowed to create new classes. This allows an attacker to create new classes without restriction and potentially flood the database. Change the Parse Server configuration to allowClientClassCreation: false.',
@@ -56,8 +56,8 @@ function checkServerConfig(options) {
'The masterKey set to your configuration lacks complexity and length. This could potentially allow an attacker to brute force the masterKey, exposing all the entire Parse Server.',
@@ -76,8 +76,8 @@ function checkServerConfig(options) {
'The server url is currently HTTP. This allows an attacker to listen to all traffic in-between the server and the client. Change the Parse Server configuration serverURL to HTTPS.',
@@ -86,10 +86,10 @@ function checkServerConfig(options) {
'Public file upload is currently enabled. This allows a client to upload files without requiring login or authentication. Remove enableForPublic from fileUpload in the Parse Server configuration.',
'The database password set lacks complexity and length. This could potentially allow an attacker to brute force their way into the database, exposing the database.',
'The database requires no authentication to the admin port. This could potentially allow an attacker to easily access the database, exposing all of the database.',
'The database requires no authentication to connect. This could potentially allow an attacker to easily access the database, exposing all of the database.',
0 commit comments