DomSanitizer helps preventing Cross Site Scripting Security bugs (XSS) by sanitizing values to be safe to use in the different DOM contexts. Any questions concerning DomSanitizer package
Questions tagged [angular-dom-sanitizer]
120 questions
0
votes
1 answer
Use of bypassSecurityTrustResourceUrl is giving SafeValue must use [property] in result
i am tring to parse images using bypassSecurityTrustResourceUrl but in output I am getting
SafeValue must use [property]=binding: data:image/jpeg;base64,(actual data) (see http://g.co/ng/security#xss)
as shown in below image
Here is my code
…

VJain
- 1,027
- 7
- 17
- 37
0
votes
1 answer
Style is not applied after sanitization and [innerHTML]
I have a mat-table:
Operation
…

gyozo kudor
- 6,284
- 10
- 53
- 80
0
votes
0 answers
Angular Domsanitizer doesn't accept url and throws error
I am attempting to sanitize a url to use as the data attribute for an object tag to display an svg.
my.page.html
my.page.ts
SVGToView:Array =…

Ray Andison
- 276
- 1
- 10
0
votes
1 answer
Angular bypassSecurityTrustResourceUrl not working as expected
I'm having a problem where DomSanitizer.bypassSecurityTrustResourceUrl is not working as expected.
I have created the following pipe as found in many sources online:
import { DomSanitizer, SafeResourceUrl} from '@angular/platform-browser';
@Pipe({…

dilemma
- 1
- 2
0
votes
0 answers
Angular 9 domSanitazer Not allowed to load resource
I have application in Angular 9 and use DomSanitazer to build img url.
I get error:
Not allowed to load local resource: file:///C:/MyApp/Images/uploads/fbf8152f-ccea-45a2-b9a9-150cd4c421a5/mmm_3424.png
In component.ts I have:
import {
…

Robert
- 343
- 1
- 3
- 14
0
votes
1 answer
Cannot display images in [innerHTML]
I have HTML data stored in a field in my Firebase database, some of which contains
. When displaying the field in my HTML file, the image has been blocked and I get the following message in my console:
GET…

Remy Bartolotta
- 147
- 13
0
votes
2 answers
Angular 9 template interpolation removing backslashes
I need to render a string on the page with double backslash "\\" but Angular removes one from the temaplte, treating it like a regular expression.
An example of the issue is here:
https://codepen.io/bental/pen/xxZdYZv
I have also tried escaping with…

Ben Taliadoros
- 7,003
- 15
- 60
- 97
0
votes
2 answers
DomSanitizer being applied to URL redirects it to localhost?
When I pass a remote url through DomSanitizer, http://localhost:4200 is being prefixed to the url and I get a 404 as a consequence.
GET http://localhost:4200/.cs.uic.edu/~i101/SoundFiles/Fanfare60.wav 404 (Not Found)
The original URL:…

Tadhg
- 23
- 3
0
votes
1 answer
how can I successfuly sanitise taken photo in ionic 4 using capacitor plugin
ionic 4 capacitor camera plugin after taking a picture and then sanitizing but still getting this error:
SafeValue must use [property]=binding:…

Bashir Saidi Wamula
- 117
- 7
0
votes
1 answer
Why are css rules not being applied to dom sanitized angular strings injected into html?
I have a very strange issue with a css rule not being applied when injected in html
this is the code injecting the html:
decorate(text)
{
return this.sanitizer.bypassSecurityTrustHtml(text.replace('Doe','Doe'));
}
in the template :…

Vincent Duprez
- 3,772
- 8
- 36
- 76
0
votes
1 answer
Javascript execution of custom user scripts using eval or domsanitizer
We have are working on an Angular 8 PWA app. Part of the app allows our clients to create their own custom forms to collect data.
As part of the development we are putting together a set functions to interact with the data. However as we it's hard…

Ka Tech
- 8,937
- 14
- 53
- 78
0
votes
1 answer
Using custom DomSanitizer with Ivy
I’m using ng-dompurify in an Angular 9 application and I’ve substituted the default Angular DomSanitizer with the NgDompurifyDomSanitizer implementation.
@NgModule({
// ...
providers: [
{
provide: DomSanitizer,
…

David Harris
- 705
- 1
- 7
- 16
0
votes
1 answer
Using a SafeUrl in a background image CSS expression with ngStyle?
Trying to set a background image using SafeUrl like this.
Image Test
{{imageURL}}

Ole
- 41,793
- 59
- 191
- 359
0
votes
1 answer
DomSanitizer change attributes to lower case on bypassSecurityTrustHtml
I have a pipe that uses DomSanitizer to bypass HTML. It's bypassing it. But, it converts all attributes inside the element to lower case. The pipe looks like this:
@Pipe({
name: 'innerHTML'
})
export class InnerHTMLPipe…

ClydeFrog
- 912
- 1
- 14
- 38
0
votes
1 answer
Why does DomSanitizer not work for string value?
Goal: Send string variable from Angular application(typesript) to iFrame living on another server so it can be used in a conditional
Question: How do I use DomSanitizer for a variable specifically?
Documentation states types are: HTML, Style,…

angleUr
- 449
- 1
- 8
- 27