mirror of
https://github.com/github/codeql.git
synced 2026-05-01 11:45:14 +02:00
JS: Flow through *ngFor loops
This commit is contained in:
@@ -5,3 +5,11 @@
|
||||
[prop4]="foo | testPipe:'safe'"
|
||||
[prop5]="42 | testPipe:foo"
|
||||
></other-component>
|
||||
|
||||
<div *ngFor="let element of taintedArray">
|
||||
<other-component [prop1]="element"></other-component>
|
||||
</div>
|
||||
|
||||
<div *ngFor="let element of safeArray">
|
||||
<other-component [prop2]="element"></other-component>
|
||||
</div>
|
||||
|
||||
@@ -6,8 +6,12 @@ import { Component } from "@angular/core";
|
||||
})
|
||||
export class Foo {
|
||||
foo: string;
|
||||
taintedArray: string[];
|
||||
safeArray: string[];
|
||||
|
||||
constructor() {
|
||||
this.foo = source();
|
||||
this.taintedArray = [...source()];
|
||||
this.safeArray = ['a', 'b'];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ pipeClassRef
|
||||
| TestPipe.ts:4:8:9:1 | class T ... ;\\n }\\n} | foo.component.html:5:20:5:27 | testPipe |
|
||||
| TestPipe.ts:4:8:9:1 | class T ... ;\\n }\\n} | foo.component.html:6:19:6:26 | testPipe |
|
||||
taintFlow
|
||||
| foo.component.ts:11:20:11:27 | source() | other.component.ts:18:48:18:57 | this.prop1 |
|
||||
| foo.component.ts:11:20:11:27 | source() | other.component.ts:21:48:21:57 | this.prop4 |
|
||||
| foo.component.ts:11:20:11:27 | source() | other.component.ts:22:48:22:57 | this.prop5 |
|
||||
| foo.component.ts:13:20:13:27 | source() | other.component.ts:18:48:18:57 | this.prop1 |
|
||||
| foo.component.ts:13:20:13:27 | source() | other.component.ts:21:48:21:57 | this.prop4 |
|
||||
| foo.component.ts:13:20:13:27 | source() | other.component.ts:22:48:22:57 | this.prop5 |
|
||||
| foo.component.ts:14:33:14:40 | source() | other.component.ts:18:48:18:57 | this.prop1 |
|
||||
|
||||
Reference in New Issue
Block a user