Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,15 @@ export class MyComponent {
<iframe [sandbox]="evil"></iframe>
<a href="{{evil}}{{evil}}"></a>
<div attr.style="{{evil}}{{evil}}"></div>
<div [(innerHTML)]="evil"></div>
<div bindon-innerHTML="evil"></div>
<iframe [(srcdoc)]="evil"></iframe>
<iframe bindon-srcdoc="evil"></iframe>
<img [(src)]="evil" />
<iframe [(src)]="evil"></iframe>
<object [(data)]="evil"></object>
<link [(href)]="evil" />
<iframe [(sandbox)]="evil"></iframe>
`, isInline: true });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyComponent, decorators: [{
Expand All @@ -842,6 +851,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDE
<iframe [sandbox]="evil"></iframe>
<a href="{{evil}}{{evil}}"></a>
<div attr.style="{{evil}}{{evil}}"></div>
<div [(innerHTML)]="evil"></div>
<div bindon-innerHTML="evil"></div>
<iframe [(srcdoc)]="evil"></iframe>
<iframe bindon-srcdoc="evil"></iframe>
<img [(src)]="evil" />
<iframe [(src)]="evil"></iframe>
<object [(data)]="evil"></object>
<link [(href)]="evil" />
<iframe [(sandbox)]="evil"></iframe>
`
}]
}] });
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
template: function MyComponent_Template(rf, ctx) {
if (rf & 1) {
$r3$.ɵɵdomElement(0, "div", 0)(1, "link", 1)(2, "div")(3, "img", 2)(4, "iframe", 3)(5, "a", 1)(6, "div");
}
if (rf & 2) {
$r3$.ɵɵdomProperty("innerHTML", ctx.evil, $r3$.ɵɵsanitizeHtml);
$r3$.ɵɵadvance();
Expand All @@ -16,5 +14,23 @@ template: function MyComponent_Template(rf, ctx) {
$r3$.ɵɵdomProperty("href", $r3$.ɵɵinterpolate2("", ctx.evil, "", ctx.evil), $r3$.ɵɵsanitizeUrl);
$r3$.ɵɵadvance();
$r3$.ɵɵattribute("style", $r3$.ɵɵinterpolate2("", ctx.evil, "", ctx.evil), $r3$.ɵɵsanitizeStyle);
$r3$.ɵɵadvance();
$r3$.ɵɵtwoWayProperty("innerHTML", ctx.evil, $r3$.ɵɵsanitizeHtml);
$r3$.ɵɵadvance();
$r3$.ɵɵtwoWayProperty("innerHTML", ctx.evil, $r3$.ɵɵsanitizeHtml);
$r3$.ɵɵadvance();
$r3$.ɵɵtwoWayProperty("srcdoc", ctx.evil, $r3$.ɵɵsanitizeHtml);
$r3$.ɵɵadvance();
$r3$.ɵɵtwoWayProperty("srcdoc", ctx.evil, $r3$.ɵɵsanitizeHtml);
$r3$.ɵɵadvance();
$r3$.ɵɵtwoWayProperty("src", ctx.evil, $r3$.ɵɵsanitizeUrl);
$r3$.ɵɵadvance();
$r3$.ɵɵtwoWayProperty("src", ctx.evil, $r3$.ɵɵsanitizeResourceUrl);
$r3$.ɵɵadvance();
$r3$.ɵɵtwoWayProperty("data", ctx.evil, $r3$.ɵɵsanitizeResourceUrl);
$r3$.ɵɵadvance();
$r3$.ɵɵtwoWayProperty("href", ctx.evil, $r3$.ɵɵsanitizeResourceUrl);
$r3$.ɵɵadvance();
$r3$.ɵɵtwoWayProperty("sandbox", ctx.evil, $r3$.ɵɵvalidateAttribute);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ import {Component} from '@angular/core';
<iframe [sandbox]="evil"></iframe>
<a href="{{evil}}{{evil}}"></a>
<div attr.style="{{evil}}{{evil}}"></div>
<div [(innerHTML)]="evil"></div>
<div bindon-innerHTML="evil"></div>
<iframe [(srcdoc)]="evil"></iframe>
<iframe bindon-srcdoc="evil"></iframe>
<img [(src)]="evil" />
<iframe [(src)]="evil"></iframe>
<object [(data)]="evil"></object>
<link [(href)]="evil" />
<iframe [(sandbox)]="evil"></iframe>
`
})
export class MyComponent {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export function resolveSanitizers(job: CompilationJob): void {
case ir.OpKind.Property:
case ir.OpKind.Attribute:
case ir.OpKind.DomProperty:
case ir.OpKind.TwoWayProperty:
let sanitizerFn: o.ExternalReference | null = null;
if (
Array.isArray(op.securityContext) &&
Expand Down
Loading