Skip to content

Commit e94448b

Browse files
committed
sc
1 parent 6c9021b commit e94448b

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

spec/SecurityCheckGroups.spec.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ describe('Security Check Groups', () => {
4949
expect(group.checks()[6].checkState()).toBe(CheckState.success);
5050
expect(group.checks()[8].checkState()).toBe(CheckState.success);
5151
expect(group.checks()[9].checkState()).toBe(CheckState.success);
52+
expect(group.checks()[10].checkState()).toBe(CheckState.success);
53+
expect(group.checks()[11].checkState()).toBe(CheckState.success);
5254
});
5355

5456
it('checks fail correctly', async () => {
@@ -67,6 +69,10 @@ describe('Security Check Groups', () => {
6769
graphQLDepth: -1,
6870
graphQLFields: -1,
6971
};
72+
config.passwordPolicy = {
73+
resetPasswordSuccessOnInvalidEmail: false,
74+
};
75+
config.emailVerifySuccessOnInvalidEmail = false;
7076
await reconfigureServer(config);
7177

7278
const group = new CheckGroupServerConfig();
@@ -79,6 +85,8 @@ describe('Security Check Groups', () => {
7985
expect(group.checks()[6].checkState()).toBe(CheckState.fail);
8086
expect(group.checks()[8].checkState()).toBe(CheckState.fail);
8187
expect(group.checks()[9].checkState()).toBe(CheckState.fail);
88+
expect(group.checks()[10].checkState()).toBe(CheckState.fail);
89+
expect(group.checks()[11].checkState()).toBe(CheckState.fail);
8290
});
8391

8492
it_only_db('mongo')('checks succeed correctly (MongoDB specific)', async () => {

src/Security/CheckGroups/CheckGroupServerConfig.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,30 @@ class CheckGroupServerConfig extends CheckGroup {
151151
}
152152
},
153153
}),
154+
new Check({
155+
title: 'Password reset endpoint user enumeration mitigated',
156+
warning:
157+
'The password reset endpoint returns distinct error responses for invalid email addresses, which allows attackers to enumerate registered users.',
158+
solution:
159+
"Change Parse Server configuration to 'passwordPolicy.resetPasswordSuccessOnInvalidEmail: true'.",
160+
check: () => {
161+
if (config.passwordPolicy?.resetPasswordSuccessOnInvalidEmail === false) {
162+
throw 1;
163+
}
164+
},
165+
}),
166+
new Check({
167+
title: 'Email verification endpoint user enumeration mitigated',
168+
warning:
169+
'The email verification endpoint returns distinct error responses for invalid email addresses, which allows attackers to enumerate registered users.',
170+
solution:
171+
"Change Parse Server configuration to 'emailVerifySuccessOnInvalidEmail: true'.",
172+
check: () => {
173+
if (config.emailVerifySuccessOnInvalidEmail === false) {
174+
throw 1;
175+
}
176+
},
177+
}),
154178
new Check({
155179
title: 'LiveQuery regex timeout enabled',
156180
warning:

0 commit comments

Comments
 (0)