Skip to content

Commit c5b4db0

Browse files
committed
test: CWE-1321
1 parent 3ad9688 commit c5b4db0

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

__tests__/CWE-1321.test.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import plist from "../src";
2+
3+
/** @see https://cwe.mitre.org/data/definitions/1321.html */
4+
5+
describe("CWE-1321", () => {
6+
it("filters out unsafe properties", () => {
7+
const unsafeDoc = { __proto__: 42, foo: "bar" };
8+
const safeDoc = plist.parse(plist.stringify(unsafeDoc));
9+
10+
expect(safeDoc).toMatchInlineSnapshot(`
11+
Object {
12+
"foo": "bar",
13+
}
14+
`);
15+
});
16+
});

0 commit comments

Comments
 (0)