We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b93e3a2 commit 8cad7f7Copy full SHA for 8cad7f7
lib/options.ts
@@ -182,7 +182,8 @@ export type ParserOptions = DeepPartial<$RefParserOptions>;
182
*/
183
function merge(target: any, source: any) {
184
if (isMergeable(source)) {
185
- const keys = Object.keys(source);
+ // prevent prototype pollution
186
+ const keys = Object.keys(source).filter((key) => !["__proto__", "constructor", "prototype"].includes(key));
187
for (let i = 0; i < keys.length; i++) {
188
const key = keys[i];
189
const sourceSetting = source[key];
0 commit comments