Skip to content

Commit b8ba50a

Browse files
committed
JS: Add Angular test case in XssThroughDom
1 parent 6f46a34 commit b8ba50a

File tree

1 file changed

+17
-0
lines changed
  • javascript/ql/test/query-tests/Security/CWE-079/XssThroughDom

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { Component } from "@angular/core";
2+
3+
@Component({
4+
template: `
5+
<input type="text" (input)="setInput1($event)"></input>
6+
<input type="text" (input)="setInput2($event.target)"></input>
7+
`
8+
})
9+
export class Foo {
10+
setInput1(event) {
11+
document.write(event.target.value); // NOT OK [INCONSISTENCY]
12+
}
13+
14+
setInput2(target) {
15+
document.write(target.value); // NOT OK [INCONSISTENCY]
16+
}
17+
}

0 commit comments

Comments
 (0)