mirror of
https://github.com/github/codeql.git
synced 2026-05-01 03:35:13 +02:00
JS: Add Angular2 model
This commit is contained in:
@@ -15,6 +15,50 @@ nodes
|
||||
| addEventListener.js:12:24:12:28 | event |
|
||||
| addEventListener.js:12:24:12:33 | event.data |
|
||||
| addEventListener.js:12:24:12:33 | event.data |
|
||||
| angular2-client.ts:21:44:21:66 | \\u0275getDOM ... ation() |
|
||||
| angular2-client.ts:21:44:21:66 | \\u0275getDOM ... ation() |
|
||||
| angular2-client.ts:21:44:21:71 | \\u0275getDOM ... ().href |
|
||||
| angular2-client.ts:21:44:21:71 | \\u0275getDOM ... ().href |
|
||||
| angular2-client.ts:23:44:23:69 | this.ro ... .params |
|
||||
| angular2-client.ts:23:44:23:69 | this.ro ... .params |
|
||||
| angular2-client.ts:23:44:23:73 | this.ro ... ams.foo |
|
||||
| angular2-client.ts:23:44:23:73 | this.ro ... ams.foo |
|
||||
| angular2-client.ts:24:44:24:74 | this.ro ... yParams |
|
||||
| angular2-client.ts:24:44:24:74 | this.ro ... yParams |
|
||||
| angular2-client.ts:24:44:24:78 | this.ro ... ams.foo |
|
||||
| angular2-client.ts:24:44:24:78 | this.ro ... ams.foo |
|
||||
| angular2-client.ts:25:44:25:71 | this.ro ... ragment |
|
||||
| angular2-client.ts:25:44:25:71 | this.ro ... ragment |
|
||||
| angular2-client.ts:25:44:25:71 | this.ro ... ragment |
|
||||
| angular2-client.ts:26:44:26:82 | this.ro ... ('foo') |
|
||||
| angular2-client.ts:26:44:26:82 | this.ro ... ('foo') |
|
||||
| angular2-client.ts:26:44:26:82 | this.ro ... ('foo') |
|
||||
| angular2-client.ts:27:44:27:87 | this.ro ... ('foo') |
|
||||
| angular2-client.ts:27:44:27:87 | this.ro ... ('foo') |
|
||||
| angular2-client.ts:27:44:27:87 | this.ro ... ('foo') |
|
||||
| angular2-client.ts:29:46:29:59 | map.get('foo') |
|
||||
| angular2-client.ts:29:46:29:59 | map.get('foo') |
|
||||
| angular2-client.ts:29:46:29:59 | map.get('foo') |
|
||||
| angular2-client.ts:32:44:32:74 | this.ro ... 1].path |
|
||||
| angular2-client.ts:32:44:32:74 | this.ro ... 1].path |
|
||||
| angular2-client.ts:32:44:32:74 | this.ro ... 1].path |
|
||||
| angular2-client.ts:33:44:33:80 | this.ro ... ameters |
|
||||
| angular2-client.ts:33:44:33:80 | this.ro ... ameters |
|
||||
| angular2-client.ts:33:44:33:82 | this.ro ... eters.x |
|
||||
| angular2-client.ts:33:44:33:82 | this.ro ... eters.x |
|
||||
| angular2-client.ts:34:44:34:91 | this.ro ... et('x') |
|
||||
| angular2-client.ts:34:44:34:91 | this.ro ... et('x') |
|
||||
| angular2-client.ts:34:44:34:91 | this.ro ... et('x') |
|
||||
| angular2-client.ts:35:44:35:89 | this.ro ... .params |
|
||||
| angular2-client.ts:35:44:35:89 | this.ro ... .params |
|
||||
| angular2-client.ts:35:44:35:91 | this.ro ... arams.x |
|
||||
| angular2-client.ts:35:44:35:91 | this.ro ... arams.x |
|
||||
| angular2-client.ts:37:44:37:58 | this.router.url |
|
||||
| angular2-client.ts:37:44:37:58 | this.router.url |
|
||||
| angular2-client.ts:37:44:37:58 | this.router.url |
|
||||
| angular2-client.ts:41:44:41:76 | routeSn ... ('foo') |
|
||||
| angular2-client.ts:41:44:41:76 | routeSn ... ('foo') |
|
||||
| angular2-client.ts:41:44:41:76 | routeSn ... ('foo') |
|
||||
| exception-xss.js:2:6:2:28 | foo |
|
||||
| exception-xss.js:2:12:2:28 | document.location |
|
||||
| exception-xss.js:2:12:2:28 | document.location |
|
||||
@@ -505,6 +549,34 @@ edges
|
||||
| addEventListener.js:10:21:10:25 | event | addEventListener.js:12:24:12:28 | event |
|
||||
| addEventListener.js:12:24:12:28 | event | addEventListener.js:12:24:12:33 | event.data |
|
||||
| addEventListener.js:12:24:12:28 | event | addEventListener.js:12:24:12:33 | event.data |
|
||||
| angular2-client.ts:21:44:21:66 | \\u0275getDOM ... ation() | angular2-client.ts:21:44:21:71 | \\u0275getDOM ... ().href |
|
||||
| angular2-client.ts:21:44:21:66 | \\u0275getDOM ... ation() | angular2-client.ts:21:44:21:71 | \\u0275getDOM ... ().href |
|
||||
| angular2-client.ts:21:44:21:66 | \\u0275getDOM ... ation() | angular2-client.ts:21:44:21:71 | \\u0275getDOM ... ().href |
|
||||
| angular2-client.ts:21:44:21:66 | \\u0275getDOM ... ation() | angular2-client.ts:21:44:21:71 | \\u0275getDOM ... ().href |
|
||||
| angular2-client.ts:23:44:23:69 | this.ro ... .params | angular2-client.ts:23:44:23:73 | this.ro ... ams.foo |
|
||||
| angular2-client.ts:23:44:23:69 | this.ro ... .params | angular2-client.ts:23:44:23:73 | this.ro ... ams.foo |
|
||||
| angular2-client.ts:23:44:23:69 | this.ro ... .params | angular2-client.ts:23:44:23:73 | this.ro ... ams.foo |
|
||||
| angular2-client.ts:23:44:23:69 | this.ro ... .params | angular2-client.ts:23:44:23:73 | this.ro ... ams.foo |
|
||||
| angular2-client.ts:24:44:24:74 | this.ro ... yParams | angular2-client.ts:24:44:24:78 | this.ro ... ams.foo |
|
||||
| angular2-client.ts:24:44:24:74 | this.ro ... yParams | angular2-client.ts:24:44:24:78 | this.ro ... ams.foo |
|
||||
| angular2-client.ts:24:44:24:74 | this.ro ... yParams | angular2-client.ts:24:44:24:78 | this.ro ... ams.foo |
|
||||
| angular2-client.ts:24:44:24:74 | this.ro ... yParams | angular2-client.ts:24:44:24:78 | this.ro ... ams.foo |
|
||||
| angular2-client.ts:25:44:25:71 | this.ro ... ragment | angular2-client.ts:25:44:25:71 | this.ro ... ragment |
|
||||
| angular2-client.ts:26:44:26:82 | this.ro ... ('foo') | angular2-client.ts:26:44:26:82 | this.ro ... ('foo') |
|
||||
| angular2-client.ts:27:44:27:87 | this.ro ... ('foo') | angular2-client.ts:27:44:27:87 | this.ro ... ('foo') |
|
||||
| angular2-client.ts:29:46:29:59 | map.get('foo') | angular2-client.ts:29:46:29:59 | map.get('foo') |
|
||||
| angular2-client.ts:32:44:32:74 | this.ro ... 1].path | angular2-client.ts:32:44:32:74 | this.ro ... 1].path |
|
||||
| angular2-client.ts:33:44:33:80 | this.ro ... ameters | angular2-client.ts:33:44:33:82 | this.ro ... eters.x |
|
||||
| angular2-client.ts:33:44:33:80 | this.ro ... ameters | angular2-client.ts:33:44:33:82 | this.ro ... eters.x |
|
||||
| angular2-client.ts:33:44:33:80 | this.ro ... ameters | angular2-client.ts:33:44:33:82 | this.ro ... eters.x |
|
||||
| angular2-client.ts:33:44:33:80 | this.ro ... ameters | angular2-client.ts:33:44:33:82 | this.ro ... eters.x |
|
||||
| angular2-client.ts:34:44:34:91 | this.ro ... et('x') | angular2-client.ts:34:44:34:91 | this.ro ... et('x') |
|
||||
| angular2-client.ts:35:44:35:89 | this.ro ... .params | angular2-client.ts:35:44:35:91 | this.ro ... arams.x |
|
||||
| angular2-client.ts:35:44:35:89 | this.ro ... .params | angular2-client.ts:35:44:35:91 | this.ro ... arams.x |
|
||||
| angular2-client.ts:35:44:35:89 | this.ro ... .params | angular2-client.ts:35:44:35:91 | this.ro ... arams.x |
|
||||
| angular2-client.ts:35:44:35:89 | this.ro ... .params | angular2-client.ts:35:44:35:91 | this.ro ... arams.x |
|
||||
| angular2-client.ts:37:44:37:58 | this.router.url | angular2-client.ts:37:44:37:58 | this.router.url |
|
||||
| angular2-client.ts:41:44:41:76 | routeSn ... ('foo') | angular2-client.ts:41:44:41:76 | routeSn ... ('foo') |
|
||||
| exception-xss.js:2:6:2:28 | foo | exception-xss.js:86:17:86:19 | foo |
|
||||
| exception-xss.js:2:6:2:28 | foo | exception-xss.js:86:17:86:19 | foo |
|
||||
| exception-xss.js:2:12:2:28 | document.location | exception-xss.js:2:6:2:28 | foo |
|
||||
@@ -937,6 +1009,19 @@ edges
|
||||
| addEventListener.js:2:20:2:29 | event.data | addEventListener.js:1:43:1:47 | event | addEventListener.js:2:20:2:29 | event.data | Cross-site scripting vulnerability due to $@. | addEventListener.js:1:43:1:47 | event | user-provided value |
|
||||
| addEventListener.js:6:20:6:23 | data | addEventListener.js:5:43:5:48 | {data} | addEventListener.js:6:20:6:23 | data | Cross-site scripting vulnerability due to $@. | addEventListener.js:5:43:5:48 | {data} | user-provided value |
|
||||
| addEventListener.js:12:24:12:33 | event.data | addEventListener.js:10:21:10:25 | event | addEventListener.js:12:24:12:33 | event.data | Cross-site scripting vulnerability due to $@. | addEventListener.js:10:21:10:25 | event | user-provided value |
|
||||
| angular2-client.ts:21:44:21:71 | \\u0275getDOM ... ().href | angular2-client.ts:21:44:21:66 | \\u0275getDOM ... ation() | angular2-client.ts:21:44:21:71 | \\u0275getDOM ... ().href | Cross-site scripting vulnerability due to $@. | angular2-client.ts:21:44:21:66 | \\u0275getDOM ... ation() | user-provided value |
|
||||
| angular2-client.ts:23:44:23:73 | this.ro ... ams.foo | angular2-client.ts:23:44:23:69 | this.ro ... .params | angular2-client.ts:23:44:23:73 | this.ro ... ams.foo | Cross-site scripting vulnerability due to $@. | angular2-client.ts:23:44:23:69 | this.ro ... .params | user-provided value |
|
||||
| angular2-client.ts:24:44:24:78 | this.ro ... ams.foo | angular2-client.ts:24:44:24:74 | this.ro ... yParams | angular2-client.ts:24:44:24:78 | this.ro ... ams.foo | Cross-site scripting vulnerability due to $@. | angular2-client.ts:24:44:24:74 | this.ro ... yParams | user-provided value |
|
||||
| angular2-client.ts:25:44:25:71 | this.ro ... ragment | angular2-client.ts:25:44:25:71 | this.ro ... ragment | angular2-client.ts:25:44:25:71 | this.ro ... ragment | Cross-site scripting vulnerability due to $@. | angular2-client.ts:25:44:25:71 | this.ro ... ragment | user-provided value |
|
||||
| angular2-client.ts:26:44:26:82 | this.ro ... ('foo') | angular2-client.ts:26:44:26:82 | this.ro ... ('foo') | angular2-client.ts:26:44:26:82 | this.ro ... ('foo') | Cross-site scripting vulnerability due to $@. | angular2-client.ts:26:44:26:82 | this.ro ... ('foo') | user-provided value |
|
||||
| angular2-client.ts:27:44:27:87 | this.ro ... ('foo') | angular2-client.ts:27:44:27:87 | this.ro ... ('foo') | angular2-client.ts:27:44:27:87 | this.ro ... ('foo') | Cross-site scripting vulnerability due to $@. | angular2-client.ts:27:44:27:87 | this.ro ... ('foo') | user-provided value |
|
||||
| angular2-client.ts:29:46:29:59 | map.get('foo') | angular2-client.ts:29:46:29:59 | map.get('foo') | angular2-client.ts:29:46:29:59 | map.get('foo') | Cross-site scripting vulnerability due to $@. | angular2-client.ts:29:46:29:59 | map.get('foo') | user-provided value |
|
||||
| angular2-client.ts:32:44:32:74 | this.ro ... 1].path | angular2-client.ts:32:44:32:74 | this.ro ... 1].path | angular2-client.ts:32:44:32:74 | this.ro ... 1].path | Cross-site scripting vulnerability due to $@. | angular2-client.ts:32:44:32:74 | this.ro ... 1].path | user-provided value |
|
||||
| angular2-client.ts:33:44:33:82 | this.ro ... eters.x | angular2-client.ts:33:44:33:80 | this.ro ... ameters | angular2-client.ts:33:44:33:82 | this.ro ... eters.x | Cross-site scripting vulnerability due to $@. | angular2-client.ts:33:44:33:80 | this.ro ... ameters | user-provided value |
|
||||
| angular2-client.ts:34:44:34:91 | this.ro ... et('x') | angular2-client.ts:34:44:34:91 | this.ro ... et('x') | angular2-client.ts:34:44:34:91 | this.ro ... et('x') | Cross-site scripting vulnerability due to $@. | angular2-client.ts:34:44:34:91 | this.ro ... et('x') | user-provided value |
|
||||
| angular2-client.ts:35:44:35:91 | this.ro ... arams.x | angular2-client.ts:35:44:35:89 | this.ro ... .params | angular2-client.ts:35:44:35:91 | this.ro ... arams.x | Cross-site scripting vulnerability due to $@. | angular2-client.ts:35:44:35:89 | this.ro ... .params | user-provided value |
|
||||
| angular2-client.ts:37:44:37:58 | this.router.url | angular2-client.ts:37:44:37:58 | this.router.url | angular2-client.ts:37:44:37:58 | this.router.url | Cross-site scripting vulnerability due to $@. | angular2-client.ts:37:44:37:58 | this.router.url | user-provided value |
|
||||
| angular2-client.ts:41:44:41:76 | routeSn ... ('foo') | angular2-client.ts:41:44:41:76 | routeSn ... ('foo') | angular2-client.ts:41:44:41:76 | routeSn ... ('foo') | Cross-site scripting vulnerability due to $@. | angular2-client.ts:41:44:41:76 | routeSn ... ('foo') | user-provided value |
|
||||
| exception-xss.js:86:17:86:19 | foo | exception-xss.js:2:12:2:28 | document.location | exception-xss.js:86:17:86:19 | foo | Cross-site scripting vulnerability due to $@. | exception-xss.js:2:12:2:28 | document.location | user-provided value |
|
||||
| jquery.js:4:5:4:11 | tainted | jquery.js:2:17:2:33 | document.location | jquery.js:4:5:4:11 | tainted | Cross-site scripting vulnerability due to $@. | jquery.js:2:17:2:33 | document.location | user-provided value |
|
||||
| jquery.js:7:5:7:34 | "<div i ... + "\\">" | jquery.js:2:17:2:33 | document.location | jquery.js:7:5:7:34 | "<div i ... + "\\">" | Cross-site scripting vulnerability due to $@. | jquery.js:2:17:2:33 | document.location | user-provided value |
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ɵgetDOM } from '@angular/common';
|
||||
import { ActivatedRoute, ActivatedRouteSnapshot, Router } from '@angular/router';
|
||||
import { DomSanitizer } from '@angular/platform-browser';
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: ['./app.component.css']
|
||||
})
|
||||
export class AppComponent implements OnInit {
|
||||
title = 'my-app';
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private sanitizer: DomSanitizer,
|
||||
private router: Router
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.sanitizer.bypassSecurityTrustHtml(ɵgetDOM().getLocation().href); // NOT OK
|
||||
|
||||
this.sanitizer.bypassSecurityTrustHtml(this.route.snapshot.params.foo); // NOT OK
|
||||
this.sanitizer.bypassSecurityTrustHtml(this.route.snapshot.queryParams.foo); // NOT OK
|
||||
this.sanitizer.bypassSecurityTrustHtml(this.route.snapshot.fragment); // NOT OK
|
||||
this.sanitizer.bypassSecurityTrustHtml(this.route.snapshot.paramMap.get('foo')); // NOT OK
|
||||
this.sanitizer.bypassSecurityTrustHtml(this.route.snapshot.queryParamMap.get('foo')); // NOT OK
|
||||
this.route.paramMap.subscribe(map => {
|
||||
this.sanitizer.bypassSecurityTrustHtml(map.get('foo')); // NOT OK
|
||||
});
|
||||
|
||||
this.sanitizer.bypassSecurityTrustHtml(this.route.snapshot.url[1].path); // NOT OK - though depends on route config
|
||||
this.sanitizer.bypassSecurityTrustHtml(this.route.snapshot.url[1].parameters.x); // NOT OK
|
||||
this.sanitizer.bypassSecurityTrustHtml(this.route.snapshot.url[1].parameterMap.get('x')); // NOT OK
|
||||
this.sanitizer.bypassSecurityTrustHtml(this.route.snapshot.url[1].parameterMap.params.x); // NOT OK
|
||||
|
||||
this.sanitizer.bypassSecurityTrustHtml(this.router.url); // NOT OK
|
||||
}
|
||||
|
||||
someMethod(routeSnapshot: ActivatedRouteSnapshot) {
|
||||
this.sanitizer.bypassSecurityTrustHtml(routeSnapshot.paramMap.get('foo')); // NOT OK
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user