Skip to content

Commit

Permalink
test: CWE-1321
Browse files Browse the repository at this point in the history
  • Loading branch information
wollardj committed Mar 31, 2022
1 parent 3ad9688 commit c5b4db0
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions __tests__/CWE-1321.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import plist from "../src";

/** @see https://cwe.mitre.org/data/definitions/1321.html */

describe("CWE-1321", () => {
it("filters out unsafe properties", () => {
const unsafeDoc = { __proto__: 42, foo: "bar" };
const safeDoc = plist.parse(plist.stringify(unsafeDoc));

expect(safeDoc).toMatchInlineSnapshot(`
Object {
"foo": "bar",
}
`);
});
});

0 comments on commit c5b4db0

Please sign in to comment.