fix: Remote code execution via MongoDB BSON parser through prototype pollution; fixes security vulnerability [GHSA-462x-c3jw-7vr6](https://github.com/parse-community/parse-server/security/advisories/GHSA-462x-c3jw-7vr6) (#8674)
This commit is contained in:
12
src/Utils.js
12
src/Utils.js
@@ -358,6 +358,18 @@ class Utils {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static checkProhibitedKeywords(config, data) {
|
||||
if (config?.requestKeywordDenylist) {
|
||||
// Scan request data for denied keywords
|
||||
for (const keyword of config.requestKeywordDenylist) {
|
||||
const match = Utils.objectContainsKeyValue(data, keyword.key, keyword.value);
|
||||
if (match) {
|
||||
throw `Prohibited keyword in request data: ${JSON.stringify(keyword)}.`;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Utils;
|
||||
|
||||
Reference in New Issue
Block a user