Skip to content

Instantly share code, notes, and snippets.

@plowsec
Created October 29, 2024 09:07
Show Gist options
  • Save plowsec/eff1f493fddac397de695c6f22ab14fc to your computer and use it in GitHub Desktop.
Save plowsec/eff1f493fddac397de695c6f22ab14fc to your computer and use it in GitHub Desktop.
Things to grep when auditing Angular codebase
bypassSecurityTrustHtml
bypassSecurityTrustStyle
bypassSecurityTrustScript
bypassSecurityTrustUrl
bypassSecurityTrustResourceUrl
innerHTML
outerHTML
insertAdjacentHTML
document.write
eval(
Function(
setTimeout( (with string parameter)
setInterval( (with string parameter)
ng-bind-html (without sanitization)
[innerHTML]=
[attr.href]= (especially with user input)
[attr.src]= (especially with user input)
[style]= (especially with user input)
dangerouslySetInnerHTML (if using React components)
DomSanitizer.sanitize(SecurityContext.HTML,
DomSanitizer.sanitize(SecurityContext.STYLE,
DomSanitizer.sanitize(SecurityContext.SCRIPT,
DomSanitizer.sanitize(SecurityContext.URL,
DomSanitizer.sanitize(SecurityContext.RESOURCE_URL,
ElementRef.nativeElement (direct DOM manipulation)
Renderer2.setProperty (when setting innerHTML)
document.createElement (when used to create script tags)
.createComment (when used with user input)
.createTextNode (when used with user input)
location.href= (especially with user input)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment