mirror of
https://github.com/tenrok/axios.git
synced 2026-06-17 19:21:29 +03:00
fix(security): guard mergeConfig value reads with hasOwnProp
This commit is contained in:
@@ -99,7 +99,9 @@ export default function mergeConfig(config1, config2) {
|
||||
utils.forEach(Object.keys({ ...config1, ...config2 }), function computeConfigValue(prop) {
|
||||
if (prop === '__proto__' || prop === 'constructor' || prop === 'prototype') return;
|
||||
const merge = utils.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;
|
||||
const configValue = merge(config1[prop], config2[prop], prop);
|
||||
const a = utils.hasOwnProp(config1, prop) ? config1[prop] : undefined;
|
||||
const b = utils.hasOwnProp(config2, prop) ? config2[prop] : undefined;
|
||||
const configValue = merge(a, b, prop);
|
||||
(utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user