fix: Authentication provider credentials are usable across Parse Server apps; fixes security vulnerability [GHSA-837q-jhwx-cmpv](https://github.com/parse-community/parse-server/security/advisories/GHSA-837q-jhwx-cmpv) (#9667)
This commit is contained in:
@@ -20,6 +20,7 @@ import {
|
||||
SecurityOptions,
|
||||
} from './Options/Definitions';
|
||||
import ParseServer from './cloud-code/Parse.Server';
|
||||
import Deprecator from './Deprecator/Deprecator';
|
||||
|
||||
function removeTrailingSlash(str) {
|
||||
if (!str) {
|
||||
@@ -84,6 +85,7 @@ export class Config {
|
||||
pages,
|
||||
security,
|
||||
enforcePrivateUsers,
|
||||
enableInsecureAuthAdapters,
|
||||
schema,
|
||||
requestKeywordDenylist,
|
||||
allowExpiredAuthDataToken,
|
||||
@@ -129,6 +131,7 @@ export class Config {
|
||||
this.validateSecurityOptions(security);
|
||||
this.validateSchemaOptions(schema);
|
||||
this.validateEnforcePrivateUsers(enforcePrivateUsers);
|
||||
this.validateEnableInsecureAuthAdapters(enableInsecureAuthAdapters);
|
||||
this.validateAllowExpiredAuthDataToken(allowExpiredAuthDataToken);
|
||||
this.validateRequestKeywordDenylist(requestKeywordDenylist);
|
||||
this.validateRateLimit(rateLimit);
|
||||
@@ -504,6 +507,15 @@ export class Config {
|
||||
}
|
||||
}
|
||||
|
||||
static validateEnableInsecureAuthAdapters(enableInsecureAuthAdapters) {
|
||||
if (enableInsecureAuthAdapters && typeof enableInsecureAuthAdapters !== 'boolean') {
|
||||
throw 'Parse Server option enableInsecureAuthAdapters must be a boolean.';
|
||||
}
|
||||
if (enableInsecureAuthAdapters) {
|
||||
Deprecator.logRuntimeDeprecation({ usage: 'insecure adapter' });
|
||||
}
|
||||
}
|
||||
|
||||
get mount() {
|
||||
var mount = this._mount;
|
||||
if (this.publicServerURL) {
|
||||
|
||||
Reference in New Issue
Block a user