We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2d156c7 commit 845879bCopy full SHA for 845879b
test/suites/pollution.js
@@ -85,5 +85,15 @@ export default function (dset) {
85
});
86
87
88
+ // Test for CVE-2022-25645 - CWE-1321
89
+ pollution('should ignore JSON.parse crafted object with "__proto__" key', () => {
90
+ let a = { b: { c: 1 } };
91
+ assert.is(a.polluted, undefined);
92
+ assert.is({}.polluted, undefined);
93
+ dset(a, "b", JSON.parse('{"__proto__":{"polluted":"Yes!"}}'));
94
95
96
+ });
97
+
98
pollution.run();
99
}
0 commit comments