mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
Blacklisted private member settings for HTTP calls
no-issue Previously it was possible to fetch the private key and session secret for the members service, this is a security issue as we do not have specific permissions for individual settings yet, and could have possibly exposed secrets to admin integrations.
This commit is contained in:
parent
770f6afa2a
commit
b3f66c6c91
1 changed files with 9 additions and 1 deletions
|
@ -9,6 +9,12 @@ const urlService = require('../../services/url');
|
|||
const common = require('../../lib/common');
|
||||
const settingsCache = require('../../services/settings/cache');
|
||||
|
||||
const SETTINGS_BLACKLIST = [
|
||||
'members_public_key',
|
||||
'members_private_key',
|
||||
'members_session_secret'
|
||||
];
|
||||
|
||||
module.exports = {
|
||||
docName: 'settings',
|
||||
|
||||
|
@ -28,7 +34,9 @@ module.exports = {
|
|||
// CASE: omit core settings unless internal request
|
||||
if (!frame.options.context.internal) {
|
||||
settings = _.filter(settings, (setting) => {
|
||||
return setting.type !== 'core';
|
||||
const isCore = setting.type === 'core';
|
||||
const isBlacklisted = SETTINGS_BLACKLIST.includes(setting.key);
|
||||
return !isBlacklisted && !isCore;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue