Skip to content

Commit c84eb3b

Browse files
committed
fixed database check
1 parent 60c6cbf commit c84eb3b

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/Security/CheckGroups/CheckGroupDatabase.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,16 @@ class CheckGroupDatabase extends CheckGroup {
3838
}),
3939
new Check({
4040
title: 'Secure database password',
41-
warning: 'The Parse Server master key is insecure and vulnerable to brute force attacks.',
42-
solution: 'Choose a more complex master key with a combination of upper- and lowercase characters, numbers and special characters.',
41+
warning: 'The database password is insecure and vulnerable to brute force attacks.',
42+
solution: 'Choose a longer and/or more complex password with a combination of upper- and lowercase characters, numbers and special characters.',
4343
check: () => {
44-
const masterKey = config.masterKey;
45-
const hasUpperCase = /[A-Z]/.test(masterKey);
46-
const hasLowerCase = /[a-z]/.test(masterKey);
47-
const hasNumbers = /\d/.test(masterKey);
48-
const hasNonAlphasNumerics = /\W/.test(masterKey);
44+
const password = databaseUrl.match(/\/\/\S+:(\S+)@/)[1];
45+
const hasUpperCase = /[A-Z]/.test(password);
46+
const hasLowerCase = /[a-z]/.test(password);
47+
const hasNumbers = /\d/.test(password);
48+
const hasNonAlphasNumerics = /\W/.test(password);
4949
// Ensure length
50-
if (masterKey.length < 14) {
50+
if (password.length < 14) {
5151
throw 1;
5252
}
5353
// Ensure at least 3 out of 4 requirements passed

src/Security/CheckGroups/CheckGroupServerConfig.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class CheckGroupServerConfig extends CheckGroup {
2121
new Check({
2222
title: 'Secure master key',
2323
warning: 'The Parse Server master key is insecure and vulnerable to brute force attacks.',
24-
solution: 'Choose a more complex master key with a combination of upper- and lowercase characters, numbers and special characters.',
24+
solution: 'Choose a longer and/or more complex master key with a combination of upper- and lowercase characters, numbers and special characters.',
2525
check: () => {
2626
const masterKey = config.masterKey;
2727
const hasUpperCase = /[A-Z]/.test(masterKey);

0 commit comments

Comments
 (0)