Introduction to CSTI vulnerability:
- Basics (for AngularJS)
- Search methods
- Sandbox bypass
- HTML Sanitizer problem
- CSP is hard
Slides have many-many references to other hard talks!
ZeroNights, WebVillage
Maintained by Google • For client-side-heavy single page applications • A large community and a huge number of commits • Have API for DOM manipulation • Not a classical application implementation scheme • Static-static What is AngularJS?
• Support CSP • If the rules are being followed • Use the latest AngularJS possible (or Angular 2.0) AngularJS Security Philosophy https://docs.angularjs.org/guide/security
prevent access to global JS properties • «Don’t use DOM, use our API». DOM full of crap • But developers rely on Sandbox • We have so many bypass for AngularJS Sandbox AngularJS Sandbox
{{11*11}} = {{121}} • You can’t detect CSTI with Burp Repeater • Why? It’s client side dude! • You need a browser • Check version and test-test-test expressions How to detect CSTI
expression • We have object scope • {{username}} = scope.username • {{alert(1)}} scope doesn’t have alert object • But every scope object in JS has constructor • And constructor.constructor = eval(); First bypass
The aim was to provide feedback to the developer to prevent them from inadvertently designing applications that would be difficult to test and maintain. Not for security! • Control expressions like classic XSS • Use static template!