SlideShare a Scribd company logo
1 of 42
Download to read offline
Isolating content between domains since 1996
Riyaz Walikar | @riyazwalikar | www.riyazwalikar.com
whoami
• WebAppSec Consultant, Penetration Tester, Bug Bounty
Hunter for Google, Facebook, Paypal, Mozilla and other
bounty programs
• One of the null Security Community Bangalore Chapter
Moderator
• Work at a Big4 and have conducted several Penetration Tests
all over the world.
• Spoken at several international security conferences
Imagine the Internet if
• fabekook.cn was able to read DOM values from facebook.com
from another browser tab
• gmaail.br was able to read your address book from
http://mail.google.com/mail/c/data/contactstore?type=4&ma
x=-1
• boinkofindia.com was able to read your account balance and
obtain a list of all your transactions from your internet
banking account while you are logged in.
Why is this possible?
Uh oh!
What is SOP?
• SOP restricts how a document or script loaded
from one origin can interact with a resource
from another origin
• Earliest available implementation – Netscape
Navigator 2.0 (1996)
define: origin
URL Outcome Reason
http://store.company.com/dir2/other.html Success ----
http://store.company.com/dir/inner/another.html Success ----
https://store.company.com/secure.html Failure Different protocol
http://store.company.com:81/dir/etc.html Failure Different port
http://news.company.com/dir/other.html Failure Different host
Access made from: http://store.company.com/dir/page.html
Changing 'origins'
• Setting document.domain to a suffix of the
current domain.
• Setting document.domain to another domain
altogether isn’t allowed.
Demo
A document.domain change set
Cross Origin Network Access
• Origin is permitted to send data to another
origin but not read
• Interactions between origins are placed in three
categories:
– Cross origin writes (redirects, links, form action etc.)
– Cross origin embedding (html tag with src/hrefs)
– Cross origin reads (not allowed without CORS etc.)
Cross Origin Embedding
• JavaScript <script src="..."></script>.
• CSS with <link rel="stylesheet" href="...">.
• Images with <img>.
• Media files with <video> and <audio> tags.
• Plug-ins with <object>, <embed> and <applet>.
• Fonts with @font-face.
• Anything with <frame> and <iframe>.
Prevent Cross Origin Access
• To prevent Cross origin writes, use a CSRF token
• To prevent Cross origin embedding, ensure
resource is not interpreted as any of the formats
discussed earlier.
• To prevent Cross Origin reads of a resource, ensure
that it is non-embeddable.
• For iframes the X-Frame-Options header can be
used to control access to the page.
Cross Origin Resource Sharing
• W3C specification that allows cross domain
communication from the browser
• Works by adding new HTTP headers that
describe the set of origins that are permitted to
read across domains
3 Pointers
• Browsers prevent data from being accessed
cross domain via the Same Origin Policy
• In case a page loads another domain via a
frame, X-Frame-Options can be used to control
access
• CORS is used to relax the Same Origin Policy for
legitimate and trusted requests.
References
• https://developer.mozilla.org/en-
US/docs/Web/JavaScript/Same_origin_policy_for_JavaScript
• http://www.w3.org/Security/wiki/Same_Origin_Policy
• http://code.google.com/p/browsersec/wiki/Part2
Allowing Cross origin resource sharing since March 2004
Riyaz Walikar | @riyazwalikar | www.riyazwalikar.com
What is CORS?
• W3C working draft that defines how the browser
and server must communicate when accessing
sources across origins
• Implemented via HTTP headers that servers set
and browsers enforce
• Can be categorized into
– Simple requests
– Requests that need a ‘preflight’
Demo
A simple cross origin request without CORS
CORS standard exchange between client and server
Why is CORS needed?
• For legitimate and trusted requests to gain access
to authorized data from other domains
• Think cross application data sharing models
• Allows data to be exchanged with trusted sites
while using a relaxed Same Origin policy mode.
• Application APIs exposed via web services and
trusted domains require CORS to be accessible
over the SOP
APIs that support CORS!
CORS – Simple Requests
• Preflight is not needed if
– Request is a HEAD/GET/POST via XHR
– No Custom headers
– Body is text/plain
• Server responds with a CORS header
– Browser determines access
– Neither the request, nor response contain cookies
CORS Headers – Simple Request
• Origin
– Header set by the client for every CORS request
– Value is the current domain that made the request
• Access-Control-Allow-Origin
– Set by the server and used by the browser to
determine if the response is to be allowed or not.
– Can be set to * to make resources public (bad
practice!)
Demo
A cross origin request with CORS for a simple request
CORS – Requests with Preflight
• Preflight requests are made if
– Request is a method other than HEAD/GET/POST
via XHR (PUT, DELETE etc.)
– Custom headers are present (X-PINGBACK etc.)
– Content-Type other than application/x-www-
form-urlencoded, multipart/form-data, or
text/plain
• A transparent request is made to the server
requesting access information using OPTIONS
CORS – Requests with Preflight
• Browser sends
– Origin header
– Access-Control-Request-Method
– Access-Control-Request-Headers – (Optional)
• Server sends set of CORS headers that the
browser uses to determine if the actual
request has to be made or not
CORS Headers – Request with Preflight
(Preflight Browser Request)
• Origin
– Header set by the client for every CORS request
– Value is the current domain that made the request
• Access-Control-Request-Method:
– Set by the browser, along with Origin.
– Value is the method that the request wants to use
• Access-Control-Request-Headers (Optional):
– A comma separated list of the custom headers being
used.
CORS Headers – Request with Preflight
(Preflight Server Response)
• Access-Control-Allow-Origin
– Same as in Simple requests
• Access-Control-Allow-Methods:
– a comma separated list of allowed methods
• Access-Control-Allow-Headers:
– a comma separated list of headers that the server will
allow.
• Access-Control-Max-Age:
– the amount of time in seconds that this preflight
request should be cached for.
Demo
A cross origin request with CORS for a preflight request
CORS (In)security?
• Several security issues arise from the improper
implementation of CORS, most commonly using a
universal allow notation (*) in the server headers
• Clients should not trust the received content
completely and eval or render content without
sanitization which could result in misplaced trust
• The application that allows CORS may become
vulnerable to CSRF attacks
CORS (In)security?
• Prolonged caching of Preflight responses could
lead to attacks arising out of abuse of the
Preflight Client Cache
• Access control decisions based on the Origin
header could result in vulnerabilities as this
can be spoofed by an attacker
CORS Security - Universal Allow
• Setting the 'Access-Control-Allow-Origin' header to *
• Effectively turns the content into a public resource,
allowing access from any domain
• Scenarios?
– An attacker can steal data from an intranet site that has set
this header to * by enticing a user to visit an attacker
controlled site on the Internet.
– An attacker can perform attacks on other remote apps via
a victim’s browser when the victim navigates to an attacker
controlled site.
Demo
A universal allow for the Access-Control-Allow-Origin header
CORS Security – Misplaced Trust
• Data exchange between two domains is based on trust
• If one of the servers involved in the exchange of data is
compromised then the model of CORS is put at risk
• Scenarios?
– An attacker can compromise site A and host malicious
content knowing site B trusts the data that site A sends to
site B via CORS request resulting in XSS and other attacks.
– An attacker can compromise site B and use the exposed
CORS functionality in site A to attack users in site A.
CSRF with CORS
• Server may process client request to change server side
data while verifying that the Origin header was set
• An attacker can use the .withCredentials = “true” property
of XHR to replay any cookies to the application on which
the victim is logged in
• Scenarios?
– An attacker sets the Origin header or uses a trusted site A to
send a non idempotent request to site B
– The victim who is logged into site B when he is viewing the
trusted site A causes site B to create a user account without
his knowledge via a CSRF attack
Demo
A CSRF attack that creates a user using a trusted site via CORS
CORS – Caching of Preflight responses
• The Access-Control-Max-Age header is set to a high
value, allowing browsers to cache Preflight
responses
• Caching the preflight response for longer duration
can pose a security risk.
• If the COR access-control policy is changed on the
server the browser would still follow the old policy
available in the Preflight Result Cache
CORS – Access Control based on Origin
• The Origin header indicates that the request is from
a particular domain, but does not guarantee it
• Spoofing the Origin header allows access to the page
if access is based on this header
• Scenarios?
– An attacker sets the Origin header to view sensitive
information that is restricted
– Attacker uses cURL to set a custom origin header:
curl --header 'origin:http://someserver.com'
http://myserver.com:90/demo/origin_spoof.php
Demo
Sensitive information revealed via weak Access Control based on
the Origin header
References
• http://www.html5rocks.com/en/tutorials/cors/
• https://code.google.com/p/html5security/wiki/CrossOriginRequestSecurity
• http://arunranga.com/examples/access-control/
• http://www.nczonline.net/blog/2010/05/25/cross-domain-ajax-with-cross-origin-
resource-sharing/
Questions?
And hopefully answers as well
Riyaz Walikar | @riyazwalikar | karniv0re@null.co.in

More Related Content

What's hot

Polyglot payloads in practice by avlidienbrunn at HackPra
Polyglot payloads in practice by avlidienbrunn at HackPraPolyglot payloads in practice by avlidienbrunn at HackPra
Polyglot payloads in practice by avlidienbrunn at HackPraMathias Karlsson
 
HTTP/2 Changes Everything
HTTP/2 Changes EverythingHTTP/2 Changes Everything
HTTP/2 Changes EverythingLori MacVittie
 
SSRF For Bug Bounties
SSRF For Bug BountiesSSRF For Bug Bounties
SSRF For Bug BountiesOWASP Nagpur
 
Host Header injection - Slides
Host Header injection - SlidesHost Header injection - Slides
Host Header injection - SlidesAmit Dubey
 
Cross site scripting (xss)
Cross site scripting (xss)Cross site scripting (xss)
Cross site scripting (xss)Manish Kumar
 
Going Beyond Microsoft IIS Short File Name Disclosure - NahamCon 2023 Edition
Going Beyond Microsoft IIS Short File Name Disclosure - NahamCon 2023 EditionGoing Beyond Microsoft IIS Short File Name Disclosure - NahamCon 2023 Edition
Going Beyond Microsoft IIS Short File Name Disclosure - NahamCon 2023 EditionSoroush Dalili
 
Owasp Top 10 And Security Flaw Root Causes
Owasp Top 10 And Security Flaw Root CausesOwasp Top 10 And Security Flaw Root Causes
Owasp Top 10 And Security Flaw Root CausesMarco Morana
 
Hunting for Credentials Dumping in Windows Environment
Hunting for Credentials Dumping in Windows EnvironmentHunting for Credentials Dumping in Windows Environment
Hunting for Credentials Dumping in Windows EnvironmentTeymur Kheirkhabarov
 
Insecure direct object reference (null delhi meet)
Insecure direct object reference (null delhi meet)Insecure direct object reference (null delhi meet)
Insecure direct object reference (null delhi meet)Abhinav Mishra
 
Waf bypassing Techniques
Waf bypassing TechniquesWaf bypassing Techniques
Waf bypassing TechniquesAvinash Thapa
 
OWASP Top 10 2021 What's New
OWASP Top 10 2021 What's NewOWASP Top 10 2021 What's New
OWASP Top 10 2021 What's NewMichael Furman
 
Secure coding presentation Oct 3 2020
Secure coding presentation Oct 3 2020Secure coding presentation Oct 3 2020
Secure coding presentation Oct 3 2020Moataz Kamel
 
Web application attacks
Web application attacksWeb application attacks
Web application attackshruth
 
Hunting Lateral Movement in Windows Infrastructure
Hunting Lateral Movement in Windows InfrastructureHunting Lateral Movement in Windows Infrastructure
Hunting Lateral Movement in Windows InfrastructureSergey Soldatov
 
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ BehaviourWAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ BehaviourSoroush Dalili
 

What's hot (20)

Http request smuggling
Http request smugglingHttp request smuggling
Http request smuggling
 
Polyglot payloads in practice by avlidienbrunn at HackPra
Polyglot payloads in practice by avlidienbrunn at HackPraPolyglot payloads in practice by avlidienbrunn at HackPra
Polyglot payloads in practice by avlidienbrunn at HackPra
 
HTTP/2 Changes Everything
HTTP/2 Changes EverythingHTTP/2 Changes Everything
HTTP/2 Changes Everything
 
SSRF For Bug Bounties
SSRF For Bug BountiesSSRF For Bug Bounties
SSRF For Bug Bounties
 
Host Header injection - Slides
Host Header injection - SlidesHost Header injection - Slides
Host Header injection - Slides
 
Cross site scripting (xss)
Cross site scripting (xss)Cross site scripting (xss)
Cross site scripting (xss)
 
Going Beyond Microsoft IIS Short File Name Disclosure - NahamCon 2023 Edition
Going Beyond Microsoft IIS Short File Name Disclosure - NahamCon 2023 EditionGoing Beyond Microsoft IIS Short File Name Disclosure - NahamCon 2023 Edition
Going Beyond Microsoft IIS Short File Name Disclosure - NahamCon 2023 Edition
 
Owasp Top 10 And Security Flaw Root Causes
Owasp Top 10 And Security Flaw Root CausesOwasp Top 10 And Security Flaw Root Causes
Owasp Top 10 And Security Flaw Root Causes
 
File upload vulnerabilities & mitigation
File upload vulnerabilities & mitigationFile upload vulnerabilities & mitigation
File upload vulnerabilities & mitigation
 
Codeigniter framework
Codeigniter framework Codeigniter framework
Codeigniter framework
 
Hunting for Credentials Dumping in Windows Environment
Hunting for Credentials Dumping in Windows EnvironmentHunting for Credentials Dumping in Windows Environment
Hunting for Credentials Dumping in Windows Environment
 
Insecure direct object reference (null delhi meet)
Insecure direct object reference (null delhi meet)Insecure direct object reference (null delhi meet)
Insecure direct object reference (null delhi meet)
 
Waf bypassing Techniques
Waf bypassing TechniquesWaf bypassing Techniques
Waf bypassing Techniques
 
Deep dive into ssrf
Deep dive into ssrfDeep dive into ssrf
Deep dive into ssrf
 
OWASP Top 10 2021 What's New
OWASP Top 10 2021 What's NewOWASP Top 10 2021 What's New
OWASP Top 10 2021 What's New
 
Secure coding presentation Oct 3 2020
Secure coding presentation Oct 3 2020Secure coding presentation Oct 3 2020
Secure coding presentation Oct 3 2020
 
Web application attacks
Web application attacksWeb application attacks
Web application attacks
 
Local File Inclusion to Remote Code Execution
Local File Inclusion to Remote Code ExecutionLocal File Inclusion to Remote Code Execution
Local File Inclusion to Remote Code Execution
 
Hunting Lateral Movement in Windows Infrastructure
Hunting Lateral Movement in Windows InfrastructureHunting Lateral Movement in Windows Infrastructure
Hunting Lateral Movement in Windows Infrastructure
 
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ BehaviourWAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
 

Viewers also liked

Cross site calls with javascript - the right way with CORS
Cross site calls with javascript - the right way with CORSCross site calls with javascript - the right way with CORS
Cross site calls with javascript - the right way with CORSMichael Neale
 
Breaking The Cross Domain Barrier
Breaking The Cross Domain BarrierBreaking The Cross Domain Barrier
Breaking The Cross Domain BarrierAlex Sexton
 
Cookie testing
Cookie testingCookie testing
Cookie testingBugRaptors
 
Deploying JHipster Microservices
Deploying JHipster MicroservicesDeploying JHipster Microservices
Deploying JHipster MicroservicesJoe Kutner
 
Stateless authentication with OAuth 2 and JWT - JavaZone 2015
Stateless authentication with OAuth 2 and JWT - JavaZone 2015Stateless authentication with OAuth 2 and JWT - JavaZone 2015
Stateless authentication with OAuth 2 and JWT - JavaZone 2015Alvaro Sanchez-Mariscal
 
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - DOSUG February 2016
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - DOSUG February 2016Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - DOSUG February 2016
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - DOSUG February 2016Matt Raible
 
REST API Security: OAuth 2.0, JWTs, and More!
REST API Security: OAuth 2.0, JWTs, and More!REST API Security: OAuth 2.0, JWTs, and More!
REST API Security: OAuth 2.0, JWTs, and More!Stormpath
 
Api gateway : To be or not to be
Api gateway : To be or not to beApi gateway : To be or not to be
Api gateway : To be or not to beJaewoo Ahn
 
JHipster for Spring Boot webinar
JHipster for Spring Boot webinarJHipster for Spring Boot webinar
JHipster for Spring Boot webinarJulien Dubois
 
AngularJS Security: defend your Single Page Application
AngularJS Security: defend your Single Page Application AngularJS Security: defend your Single Page Application
AngularJS Security: defend your Single Page Application Carlo Bonamico
 
Single-Page-Application & REST security
Single-Page-Application & REST securitySingle-Page-Application & REST security
Single-Page-Application & REST securityIgor Bossenko
 
Web Security - Cookies, Domains and CORS
Web Security - Cookies, Domains and CORSWeb Security - Cookies, Domains and CORS
Web Security - Cookies, Domains and CORSPerfectial, LLC
 
TEDx Manchester: AI & The Future of Work
TEDx Manchester: AI & The Future of WorkTEDx Manchester: AI & The Future of Work
TEDx Manchester: AI & The Future of WorkVolker Hirsch
 

Viewers also liked (17)

Cross site calls with javascript - the right way with CORS
Cross site calls with javascript - the right way with CORSCross site calls with javascript - the right way with CORS
Cross site calls with javascript - the right way with CORS
 
Breaking The Cross Domain Barrier
Breaking The Cross Domain BarrierBreaking The Cross Domain Barrier
Breaking The Cross Domain Barrier
 
Jhipster
JhipsterJhipster
Jhipster
 
Cookie testing
Cookie testingCookie testing
Cookie testing
 
Deploying JHipster Microservices
Deploying JHipster MicroservicesDeploying JHipster Microservices
Deploying JHipster Microservices
 
Intro to JHipster
Intro to JHipster Intro to JHipster
Intro to JHipster
 
JHipster
JHipsterJHipster
JHipster
 
Stateless authentication with OAuth 2 and JWT - JavaZone 2015
Stateless authentication with OAuth 2 and JWT - JavaZone 2015Stateless authentication with OAuth 2 and JWT - JavaZone 2015
Stateless authentication with OAuth 2 and JWT - JavaZone 2015
 
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - DOSUG February 2016
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - DOSUG February 2016Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - DOSUG February 2016
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - DOSUG February 2016
 
REST API Security: OAuth 2.0, JWTs, and More!
REST API Security: OAuth 2.0, JWTs, and More!REST API Security: OAuth 2.0, JWTs, and More!
REST API Security: OAuth 2.0, JWTs, and More!
 
Api gateway : To be or not to be
Api gateway : To be or not to beApi gateway : To be or not to be
Api gateway : To be or not to be
 
JHipster overview
JHipster overviewJHipster overview
JHipster overview
 
JHipster for Spring Boot webinar
JHipster for Spring Boot webinarJHipster for Spring Boot webinar
JHipster for Spring Boot webinar
 
AngularJS Security: defend your Single Page Application
AngularJS Security: defend your Single Page Application AngularJS Security: defend your Single Page Application
AngularJS Security: defend your Single Page Application
 
Single-Page-Application & REST security
Single-Page-Application & REST securitySingle-Page-Application & REST security
Single-Page-Application & REST security
 
Web Security - Cookies, Domains and CORS
Web Security - Cookies, Domains and CORSWeb Security - Cookies, Domains and CORS
Web Security - Cookies, Domains and CORS
 
TEDx Manchester: AI & The Future of Work
TEDx Manchester: AI & The Future of WorkTEDx Manchester: AI & The Future of Work
TEDx Manchester: AI & The Future of Work
 

Similar to CORS and (in)security

What Is Cross-Origin Resource Sharing in Web Development.pdf
What Is Cross-Origin Resource Sharing in Web Development.pdfWhat Is Cross-Origin Resource Sharing in Web Development.pdf
What Is Cross-Origin Resource Sharing in Web Development.pdfMPrashanth13
 
Html cors- lior rotkovitch
Html cors- lior rotkovitchHtml cors- lior rotkovitch
Html cors- lior rotkovitchLior Rotkovitch
 
Lesson 6 web based attacks
Lesson 6 web based attacksLesson 6 web based attacks
Lesson 6 web based attacksFrank Victory
 
Hacking HTML5 offensive course (Zeronights edition)
Hacking HTML5 offensive course (Zeronights edition)Hacking HTML5 offensive course (Zeronights edition)
Hacking HTML5 offensive course (Zeronights edition)Krzysztof Kotowicz
 
Of CORS thats a thing how CORS in the cloud still kills security
Of CORS thats a thing how CORS in the cloud still kills securityOf CORS thats a thing how CORS in the cloud still kills security
Of CORS thats a thing how CORS in the cloud still kills securityJohn Varghese
 
Browsers_SameOriginPolicy_CORS_ContentSecurityPolicy
Browsers_SameOriginPolicy_CORS_ContentSecurityPolicyBrowsers_SameOriginPolicy_CORS_ContentSecurityPolicy
Browsers_SameOriginPolicy_CORS_ContentSecurityPolicysubbul
 
Krzysztof Kotowicz - Hacking HTML5
Krzysztof Kotowicz - Hacking HTML5Krzysztof Kotowicz - Hacking HTML5
Krzysztof Kotowicz - Hacking HTML5DefconRussia
 
Going Beyond Cross Domain Boundaries (jQuery Bulgaria)
Going Beyond Cross Domain Boundaries (jQuery Bulgaria)Going Beyond Cross Domain Boundaries (jQuery Bulgaria)
Going Beyond Cross Domain Boundaries (jQuery Bulgaria)Ivo Andreev
 
Chrome extensions threat analysis and countermeasures
Chrome extensions threat analysis and countermeasuresChrome extensions threat analysis and countermeasures
Chrome extensions threat analysis and countermeasuresRoel Palmaers
 
Web Hacking Series Part 5
Web Hacking Series Part 5Web Hacking Series Part 5
Web Hacking Series Part 5Aditya Kamat
 
Do you lose sleep at night?
Do you lose sleep at night?Do you lose sleep at night?
Do you lose sleep at night?Nathan Van Gheem
 
CNIT 129S: Ch 3: Web Application Technologies
CNIT 129S: Ch 3: Web Application TechnologiesCNIT 129S: Ch 3: Web Application Technologies
CNIT 129S: Ch 3: Web Application TechnologiesSam Bowne
 
cross document messaging, html 5
cross document messaging, html 5cross document messaging, html 5
cross document messaging, html 5Kristoffer Snabb
 
Advanced Client Side Exploitation Using BeEF
Advanced Client Side Exploitation Using BeEFAdvanced Client Side Exploitation Using BeEF
Advanced Client Side Exploitation Using BeEF1N3
 
Browser Hacking For Fun and Profit | Null Bangalore Meetup 2019 | Divyanshu S...
Browser Hacking For Fun and Profit | Null Bangalore Meetup 2019 | Divyanshu S...Browser Hacking For Fun and Profit | Null Bangalore Meetup 2019 | Divyanshu S...
Browser Hacking For Fun and Profit | Null Bangalore Meetup 2019 | Divyanshu S...Divyanshu
 
CNIT 129S - Ch 3: Web Application Technologies
CNIT 129S - Ch 3: Web Application TechnologiesCNIT 129S - Ch 3: Web Application Technologies
CNIT 129S - Ch 3: Web Application TechnologiesSam Bowne
 
AWS Webcast - Best Practices for Content Delivery using Amazon CloudFront
AWS Webcast - Best Practices for Content Delivery using Amazon CloudFrontAWS Webcast - Best Practices for Content Delivery using Amazon CloudFront
AWS Webcast - Best Practices for Content Delivery using Amazon CloudFrontAmazon Web Services
 
Best practices for content delivery using amazon cloud front
Best practices for content delivery using amazon cloud frontBest practices for content delivery using amazon cloud front
Best practices for content delivery using amazon cloud frontAmazon Web Services
 

Similar to CORS and (in)security (20)

What Is Cross-Origin Resource Sharing in Web Development.pdf
What Is Cross-Origin Resource Sharing in Web Development.pdfWhat Is Cross-Origin Resource Sharing in Web Development.pdf
What Is Cross-Origin Resource Sharing in Web Development.pdf
 
Html cors- lior rotkovitch
Html cors- lior rotkovitchHtml cors- lior rotkovitch
Html cors- lior rotkovitch
 
Lesson 6 web based attacks
Lesson 6 web based attacksLesson 6 web based attacks
Lesson 6 web based attacks
 
Hacking HTML5 offensive course (Zeronights edition)
Hacking HTML5 offensive course (Zeronights edition)Hacking HTML5 offensive course (Zeronights edition)
Hacking HTML5 offensive course (Zeronights edition)
 
HTML5 - The Promise & The Peril
HTML5 - The Promise & The PerilHTML5 - The Promise & The Peril
HTML5 - The Promise & The Peril
 
Of CORS thats a thing how CORS in the cloud still kills security
Of CORS thats a thing how CORS in the cloud still kills securityOf CORS thats a thing how CORS in the cloud still kills security
Of CORS thats a thing how CORS in the cloud still kills security
 
Browsers_SameOriginPolicy_CORS_ContentSecurityPolicy
Browsers_SameOriginPolicy_CORS_ContentSecurityPolicyBrowsers_SameOriginPolicy_CORS_ContentSecurityPolicy
Browsers_SameOriginPolicy_CORS_ContentSecurityPolicy
 
Krzysztof Kotowicz - Hacking HTML5
Krzysztof Kotowicz - Hacking HTML5Krzysztof Kotowicz - Hacking HTML5
Krzysztof Kotowicz - Hacking HTML5
 
Going Beyond Cross Domain Boundaries (jQuery Bulgaria)
Going Beyond Cross Domain Boundaries (jQuery Bulgaria)Going Beyond Cross Domain Boundaries (jQuery Bulgaria)
Going Beyond Cross Domain Boundaries (jQuery Bulgaria)
 
Chrome extensions threat analysis and countermeasures
Chrome extensions threat analysis and countermeasuresChrome extensions threat analysis and countermeasures
Chrome extensions threat analysis and countermeasures
 
Web Hacking Series Part 5
Web Hacking Series Part 5Web Hacking Series Part 5
Web Hacking Series Part 5
 
Do you lose sleep at night?
Do you lose sleep at night?Do you lose sleep at night?
Do you lose sleep at night?
 
CNIT 129S: Ch 3: Web Application Technologies
CNIT 129S: Ch 3: Web Application TechnologiesCNIT 129S: Ch 3: Web Application Technologies
CNIT 129S: Ch 3: Web Application Technologies
 
cross document messaging, html 5
cross document messaging, html 5cross document messaging, html 5
cross document messaging, html 5
 
Advanced Client Side Exploitation Using BeEF
Advanced Client Side Exploitation Using BeEFAdvanced Client Side Exploitation Using BeEF
Advanced Client Side Exploitation Using BeEF
 
Browser Hacking For Fun and Profit | Null Bangalore Meetup 2019 | Divyanshu S...
Browser Hacking For Fun and Profit | Null Bangalore Meetup 2019 | Divyanshu S...Browser Hacking For Fun and Profit | Null Bangalore Meetup 2019 | Divyanshu S...
Browser Hacking For Fun and Profit | Null Bangalore Meetup 2019 | Divyanshu S...
 
CNIT 129S - Ch 3: Web Application Technologies
CNIT 129S - Ch 3: Web Application TechnologiesCNIT 129S - Ch 3: Web Application Technologies
CNIT 129S - Ch 3: Web Application Technologies
 
AWS Webcast - Best Practices for Content Delivery using Amazon CloudFront
AWS Webcast - Best Practices for Content Delivery using Amazon CloudFrontAWS Webcast - Best Practices for Content Delivery using Amazon CloudFront
AWS Webcast - Best Practices for Content Delivery using Amazon CloudFront
 
Best practices for content delivery using amazon cloud front
Best practices for content delivery using amazon cloud frontBest practices for content delivery using amazon cloud front
Best practices for content delivery using amazon cloud front
 
Codefest2015
Codefest2015Codefest2015
Codefest2015
 

More from n|u - The Open Security Community

Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...
Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...
Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...n|u - The Open Security Community
 

More from n|u - The Open Security Community (20)

Hardware security testing 101 (Null - Delhi Chapter)
Hardware security testing 101 (Null - Delhi Chapter)Hardware security testing 101 (Null - Delhi Chapter)
Hardware security testing 101 (Null - Delhi Chapter)
 
Osint primer
Osint primerOsint primer
Osint primer
 
SSRF exploit the trust relationship
SSRF exploit the trust relationshipSSRF exploit the trust relationship
SSRF exploit the trust relationship
 
Nmap basics
Nmap basicsNmap basics
Nmap basics
 
Metasploit primary
Metasploit primaryMetasploit primary
Metasploit primary
 
Api security-testing
Api security-testingApi security-testing
Api security-testing
 
Introduction to TLS 1.3
Introduction to TLS 1.3Introduction to TLS 1.3
Introduction to TLS 1.3
 
Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...
Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...
Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...
 
Talking About SSRF,CRLF
Talking About SSRF,CRLFTalking About SSRF,CRLF
Talking About SSRF,CRLF
 
Building active directory lab for red teaming
Building active directory lab for red teamingBuilding active directory lab for red teaming
Building active directory lab for red teaming
 
Owning a company through their logs
Owning a company through their logsOwning a company through their logs
Owning a company through their logs
 
Introduction to shodan
Introduction to shodanIntroduction to shodan
Introduction to shodan
 
Cloud security
Cloud security Cloud security
Cloud security
 
Detecting persistence in windows
Detecting persistence in windowsDetecting persistence in windows
Detecting persistence in windows
 
Frida - Objection Tool Usage
Frida - Objection Tool UsageFrida - Objection Tool Usage
Frida - Objection Tool Usage
 
OSQuery - Monitoring System Process
OSQuery - Monitoring System ProcessOSQuery - Monitoring System Process
OSQuery - Monitoring System Process
 
DevSecOps Jenkins Pipeline -Security
DevSecOps Jenkins Pipeline -SecurityDevSecOps Jenkins Pipeline -Security
DevSecOps Jenkins Pipeline -Security
 
Extensible markup language attacks
Extensible markup language attacksExtensible markup language attacks
Extensible markup language attacks
 
Linux for hackers
Linux for hackersLinux for hackers
Linux for hackers
 
Android Pentesting
Android PentestingAndroid Pentesting
Android Pentesting
 

Recently uploaded

Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...RKavithamani
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 

Recently uploaded (20)

Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 

CORS and (in)security

  • 1. Isolating content between domains since 1996 Riyaz Walikar | @riyazwalikar | www.riyazwalikar.com
  • 2. whoami • WebAppSec Consultant, Penetration Tester, Bug Bounty Hunter for Google, Facebook, Paypal, Mozilla and other bounty programs • One of the null Security Community Bangalore Chapter Moderator • Work at a Big4 and have conducted several Penetration Tests all over the world. • Spoken at several international security conferences
  • 3. Imagine the Internet if • fabekook.cn was able to read DOM values from facebook.com from another browser tab • gmaail.br was able to read your address book from http://mail.google.com/mail/c/data/contactstore?type=4&ma x=-1 • boinkofindia.com was able to read your account balance and obtain a list of all your transactions from your internet banking account while you are logged in.
  • 4. Why is this possible?
  • 6. What is SOP? • SOP restricts how a document or script loaded from one origin can interact with a resource from another origin • Earliest available implementation – Netscape Navigator 2.0 (1996)
  • 7. define: origin URL Outcome Reason http://store.company.com/dir2/other.html Success ---- http://store.company.com/dir/inner/another.html Success ---- https://store.company.com/secure.html Failure Different protocol http://store.company.com:81/dir/etc.html Failure Different port http://news.company.com/dir/other.html Failure Different host Access made from: http://store.company.com/dir/page.html
  • 8. Changing 'origins' • Setting document.domain to a suffix of the current domain. • Setting document.domain to another domain altogether isn’t allowed.
  • 10. Cross Origin Network Access • Origin is permitted to send data to another origin but not read • Interactions between origins are placed in three categories: – Cross origin writes (redirects, links, form action etc.) – Cross origin embedding (html tag with src/hrefs) – Cross origin reads (not allowed without CORS etc.)
  • 11. Cross Origin Embedding • JavaScript <script src="..."></script>. • CSS with <link rel="stylesheet" href="...">. • Images with <img>. • Media files with <video> and <audio> tags. • Plug-ins with <object>, <embed> and <applet>. • Fonts with @font-face. • Anything with <frame> and <iframe>.
  • 12. Prevent Cross Origin Access • To prevent Cross origin writes, use a CSRF token • To prevent Cross origin embedding, ensure resource is not interpreted as any of the formats discussed earlier. • To prevent Cross Origin reads of a resource, ensure that it is non-embeddable. • For iframes the X-Frame-Options header can be used to control access to the page.
  • 13. Cross Origin Resource Sharing • W3C specification that allows cross domain communication from the browser • Works by adding new HTTP headers that describe the set of origins that are permitted to read across domains
  • 14. 3 Pointers • Browsers prevent data from being accessed cross domain via the Same Origin Policy • In case a page loads another domain via a frame, X-Frame-Options can be used to control access • CORS is used to relax the Same Origin Policy for legitimate and trusted requests.
  • 16. Allowing Cross origin resource sharing since March 2004 Riyaz Walikar | @riyazwalikar | www.riyazwalikar.com
  • 17. What is CORS? • W3C working draft that defines how the browser and server must communicate when accessing sources across origins • Implemented via HTTP headers that servers set and browsers enforce • Can be categorized into – Simple requests – Requests that need a ‘preflight’
  • 18. Demo A simple cross origin request without CORS
  • 19. CORS standard exchange between client and server
  • 20. Why is CORS needed? • For legitimate and trusted requests to gain access to authorized data from other domains • Think cross application data sharing models • Allows data to be exchanged with trusted sites while using a relaxed Same Origin policy mode. • Application APIs exposed via web services and trusted domains require CORS to be accessible over the SOP
  • 22. CORS – Simple Requests • Preflight is not needed if – Request is a HEAD/GET/POST via XHR – No Custom headers – Body is text/plain • Server responds with a CORS header – Browser determines access – Neither the request, nor response contain cookies
  • 23. CORS Headers – Simple Request • Origin – Header set by the client for every CORS request – Value is the current domain that made the request • Access-Control-Allow-Origin – Set by the server and used by the browser to determine if the response is to be allowed or not. – Can be set to * to make resources public (bad practice!)
  • 24. Demo A cross origin request with CORS for a simple request
  • 25. CORS – Requests with Preflight • Preflight requests are made if – Request is a method other than HEAD/GET/POST via XHR (PUT, DELETE etc.) – Custom headers are present (X-PINGBACK etc.) – Content-Type other than application/x-www- form-urlencoded, multipart/form-data, or text/plain • A transparent request is made to the server requesting access information using OPTIONS
  • 26. CORS – Requests with Preflight • Browser sends – Origin header – Access-Control-Request-Method – Access-Control-Request-Headers – (Optional) • Server sends set of CORS headers that the browser uses to determine if the actual request has to be made or not
  • 27. CORS Headers – Request with Preflight (Preflight Browser Request) • Origin – Header set by the client for every CORS request – Value is the current domain that made the request • Access-Control-Request-Method: – Set by the browser, along with Origin. – Value is the method that the request wants to use • Access-Control-Request-Headers (Optional): – A comma separated list of the custom headers being used.
  • 28. CORS Headers – Request with Preflight (Preflight Server Response) • Access-Control-Allow-Origin – Same as in Simple requests • Access-Control-Allow-Methods: – a comma separated list of allowed methods • Access-Control-Allow-Headers: – a comma separated list of headers that the server will allow. • Access-Control-Max-Age: – the amount of time in seconds that this preflight request should be cached for.
  • 29. Demo A cross origin request with CORS for a preflight request
  • 30. CORS (In)security? • Several security issues arise from the improper implementation of CORS, most commonly using a universal allow notation (*) in the server headers • Clients should not trust the received content completely and eval or render content without sanitization which could result in misplaced trust • The application that allows CORS may become vulnerable to CSRF attacks
  • 31. CORS (In)security? • Prolonged caching of Preflight responses could lead to attacks arising out of abuse of the Preflight Client Cache • Access control decisions based on the Origin header could result in vulnerabilities as this can be spoofed by an attacker
  • 32. CORS Security - Universal Allow • Setting the 'Access-Control-Allow-Origin' header to * • Effectively turns the content into a public resource, allowing access from any domain • Scenarios? – An attacker can steal data from an intranet site that has set this header to * by enticing a user to visit an attacker controlled site on the Internet. – An attacker can perform attacks on other remote apps via a victim’s browser when the victim navigates to an attacker controlled site.
  • 33. Demo A universal allow for the Access-Control-Allow-Origin header
  • 34. CORS Security – Misplaced Trust • Data exchange between two domains is based on trust • If one of the servers involved in the exchange of data is compromised then the model of CORS is put at risk • Scenarios? – An attacker can compromise site A and host malicious content knowing site B trusts the data that site A sends to site B via CORS request resulting in XSS and other attacks. – An attacker can compromise site B and use the exposed CORS functionality in site A to attack users in site A.
  • 35. CSRF with CORS • Server may process client request to change server side data while verifying that the Origin header was set • An attacker can use the .withCredentials = “true” property of XHR to replay any cookies to the application on which the victim is logged in • Scenarios? – An attacker sets the Origin header or uses a trusted site A to send a non idempotent request to site B – The victim who is logged into site B when he is viewing the trusted site A causes site B to create a user account without his knowledge via a CSRF attack
  • 36. Demo A CSRF attack that creates a user using a trusted site via CORS
  • 37. CORS – Caching of Preflight responses • The Access-Control-Max-Age header is set to a high value, allowing browsers to cache Preflight responses • Caching the preflight response for longer duration can pose a security risk. • If the COR access-control policy is changed on the server the browser would still follow the old policy available in the Preflight Result Cache
  • 38. CORS – Access Control based on Origin • The Origin header indicates that the request is from a particular domain, but does not guarantee it • Spoofing the Origin header allows access to the page if access is based on this header • Scenarios? – An attacker sets the Origin header to view sensitive information that is restricted – Attacker uses cURL to set a custom origin header: curl --header 'origin:http://someserver.com' http://myserver.com:90/demo/origin_spoof.php
  • 39. Demo Sensitive information revealed via weak Access Control based on the Origin header
  • 40. References • http://www.html5rocks.com/en/tutorials/cors/ • https://code.google.com/p/html5security/wiki/CrossOriginRequestSecurity • http://arunranga.com/examples/access-control/ • http://www.nczonline.net/blog/2010/05/25/cross-domain-ajax-with-cross-origin- resource-sharing/
  • 42. Riyaz Walikar | @riyazwalikar | karniv0re@null.co.in