SlideShare a Scribd company logo
@thisNatasha
WebAppSec
Updates from W3C
Natasha Rooney
@thisNatasha
GSMA Web Technologist
W3C WebMob Co-Chair
www.w3.org/Mobile/IG/
@thisNatasha
Web features are getting more powerful.
Developers: how can we help developers make
better choices or protect their apps?
Users: how can we help protect users?
What’s happening?
Service Workers WebRTC
Geolocation Permissions
@thisNatasha
WebAppSec Working Group
…[T]he mission of the Web
Application Security Working
Group is to develop technical
and policy mechanisms to
improve the security of and
enable secure cross-site
communications for
applications on the Web.
Mailing List public-webappsec@w3.org
Website www.w3.org/2011/webappsec/
@thisNatasha
WebAppSec: Goals
[1] Attack Surface Reduction: allow applications to
restrict or forbid dangerous features
[2] Secure Mashups: mechanisms for secure
resource sharing and messaging across origins
[3] Manageability: Uniform policy control points
from which to manage these risks
[4] Develop a policy mechanism: standardized
means for security policy declaration
Mailing List public-webappsec@w3.org
Website www.w3.org/2011/webappsec/
@thisNatasha
WebAppSec: Work
2015 Charter
Content Security Policy (CSP) Lvl 2, Lvl X
User Interface Security Directives for CSP
Mixed Content (MIX)
Sub Resource Integrity
Referrer Policy
Credential Management API
Suborigin Namespaces
Confinement with Origin Web Labels
Entry Point Regulation for Web Apps
Permissions API
Mailing List public-webappsec@w3.org
Website www.w3.org/2011/webappsec/
@thisNatasha
Let’s go through
some work!
Clear Site Data
COWL
Credential Management
Other Updates
@thisNatasha
Clear Site Data
W3CFirstPublicWorkingDraft
Draft:
https://w3c.github.io/webappsec-clear-site-data/
Charter: 2015
@thisNatasha
Clear Site Data
W3CFirstPublicWorkingDraft
Draft:
https://w3c.github.io/webappsec-clear-site-data/
Charter: 2015
“Instruct a user agent to clear a site’s locally stored
data related to a host.”
- Web Applications store data on user’s computer
- Data is sensitive and valuable
- Some removed via JavaScript, others not:
Cookies: OK
HTTPonly cookies: Not OK
Cache: Not OK
@thisNatasha
Clear Site Data: Examples
W3CFirstPublicWorkingDraft
Draft:
https://w3c.github.io/webappsec-clear-site-data/
Charter: 2015
Signs out of “Super Secret Social Network” via a CSRF-protected POST
The site author wishes to ensure that locally stored data is removed.
Response HTTP header:
https://supersecretsocialnetwork.example.com/logout
// Signing Out / Kill Switch
Clear-Site-Data: *
// Keep Critical Cookies
Clear-Site-Data: storage; executionContexts; cache
@thisNatasha
Clear Site Data: Example 2
W3CFirstPublicWorkingDraft
Draft:
https://w3c.github.io/webappsec-clear-site-data/
Charter: 2015
Target a specific app subdomain by including a request to that
subdomain as part of the logout landing page:
- Request’s preflight return: proper CORS headers
- Actual requests return header:
fetch("https://minus.megacorp.example.com/clear-site-data",
{
method: "POST",
mode: "cors",
headers: new Headers({
"CSRF": "[insert sekrit token here]"
})
});
Clear-Site-Data: *
@thisNatasha
Confinement with Origin Web Labels (COWL)
W3CWorkingDraft
Draft: https://w3c.github.io/webappsec-cowl/
Charter: 2015
@thisNatasha
Confinement with Origin Web Labels (COWL)
W3CWorkingDraft
Draft: https://w3c.github.io/webappsec-cowl/
Charter: 2015
“Specifying privacy and integrity policies on data, in
the form of origin labels, and a mechanism for
confining code according to such policies.”
- third party scripts puts user’s data confidentiality and
integrity at risk!
- CORs and CSP can help!
- But not where that data can be used...
@thisNatasha
Confinement with Origin Web Labels (COWL)
W3CWorkingDraft
Draft: https://w3c.github.io/webappsec-cowl/
Charter: 2015
COWL:
- developer states that a password is confidential to https://example.com
- It can then be shared with (e.g.) a third-party password checker.
- The third-party password checker is confined and respects the policy
on the password:
COWL disallows it from disclosing the password to
any origin other than https://example.com.
- Confines code at the Context Level
- Developers can set restrictions on shared data
- Stop code from being shared outside specified origins
- Can compartmentalise apps to specify privileges
@thisNatasha
COWL: Example
Confining untrusted third-party services
W3CWorkingDraft
Draft: https://w3c.github.io/webappsec-cowl/
Charter: 2015
- https://example.com wishes to use the untrusted
https://passwordcheck.com
- https://example.com uses COWL to add a confidentiality policy (a
label) to the password before sending it to https://passwordcheck.com
// Create new policy using Labels that specifies that the password is sensitive
// to https://example.com and should only be disclosed to this origin:
var policy = new Label(window.location.origin);
// Associate the label with the password:
var labeledPassword = new LabeledObject(password, {confidentiality: policy});
// Send the labeled password to the checker iframe:
checker.postMessage(labeledPassword, "https://untrusted.com");
// Register listener to receive a response from checker, etc.
@thisNatasha
COWL: Example
Confining untrusted third-party services
W3CWorkingDraft
Draft: https://w3c.github.io/webappsec-cowl/
Charter: 2015
1. https://passwordcheck.com checks the password
2. COWL limits the iframe to communicating with origins that preserve the
password’s confidentiality (https://example.com).
3. This “policy” is enforced mandatorily
4. https://passwordcheck.com cannot send the password elsewhere
Note: https://passwordcheck.com can communite with other origins before
inpecting the password.
// Create new policy using Labels that specifies that the password is sensitive
// to https://example.com and should only be disclosed to this origin:
var policy = new Label(window.location.origin);
// Associate the label with the password:
var labeledPassword = new LabeledObject(password, {confidentiality: policy});
// Send the labeled password to the checker iframe:
checker.postMessage(labeledPassword, "https://untrusted.com");
// Register listener to receive a response from checker, etc.
@thisNatasha
COWL: Examples
Sharing data with mashups / privilege separation
W3CWorkingDraft
Draft: https://w3c.github.io/webappsec-cowl/
Charter: 2015
- https://example.com wishes to allow https://mashup.com access to data.
- Server operator can set COWL response header to:
1. https://mashup.com can access data through CORs
2. COWL header says data can only be shared with https://example.com
- Give different privileges according to users.
1. Content of user1 does not interfere with any other user.
2. Content of user1 cannot leak anywhere else.
Access-Control-Allow-Origin: https://mashup.com
Sec-COWL: data-confidentiality [ ["https://example.com"] ]
Sec-COWL: ctx-privilege [ ['self', 'cowl://user1'] ]
@thisNatasha
Credential Management
W3CWorkingDraft
Draft:http://w3c.github.io/webappsec-credential-
management/
Charter: 2015
@thisNatasha
Credential Management
W3CWorkingDraft
Draft:http://w3c.github.io/webappsec-credential-
management/
Charter: 2015
“[R]equest a user’s credentials from a user agent, and to help
the user agent correctly store user credentials for future use”
- Autofilled credentials
- Hard for some use cases: e.g. credentials sent through XHR
- Credential Manager API can help!
@thisNatasha
Credential Management:
Password-based Sign-in
W3CWorkingDraft
Draft:http://w3c.github.io/webappsec-credential-
management/
Charter: 2015
navigator.credentials.get({ "password": true }).then(
function(credential) {
if (!credential) {
// The user either doesn’t have credentials for this site, or
// refused to share them. Insert some code here to show a basic
// login form (or, ideally, do nothing, since this API should
// really be progressive enhancement on top of an existing form).
return;
}
if (credential.type == "password") {
fetch("https://example.com/loginEndpoint", { body: credential.toFormData(),
method: "POST" })
.then(function (response) {
// Notify the user that signin succeeded! Do amazing, signed-in things!
});
} else {
// in Spec: federated sign-in example
}
});
@thisNatasha
WebAppSec: Other Updates
Spec Updates
- Candidate Recommendation: Subresource Integrity
- Candidate Recommendation: Mixed Content
- Password generation in Credential Manager
- Published: COWL
- Referrer turned into a distinct header
- Mixed Content and DASH
- Permissions API Working Draft
- HSTS, mixed content, and priming: fetch resources using HTTPS even if
the URL uses the "http:"
Group Management Updates
- Specs now on Github
- Berlin Face-to-Face
Mailing List public-webappsec@w3.org
Website www.w3.org/2011/webappsec/
@thisNatasha
WebAppSec: At TPAC
TPAC 2015 29-30 October
- Credential Management
- Content Security Policy
- Referrer Policy
- Joint session with Web Payments WG on secure API design
- COWL
- CSP Embedded Enforcement
Agenda Link
Mailing List public-webappsec@w3.org
Website www.w3.org/2011/webappsec/
@thisNatasha
ありがとう!
Natasha Rooney
@thisNatasha
GSMA Web Technologist
W3C WebMob Co-Chair
www.w3.org/Mobile/IG/
Thanks to Brad Hill (Chair) &
Mike West (editor)
from the WebAppSec WG!
Mailing List public-webappsec@w3.org
Website www.w3.org/2011/webappsec/
@thisNatasha
Unused Slides Past this Point!
@thisNatasha
Clear Site Data
W3CFirstPublicWorkingDraft
Draft:
https://w3c.github.io/webappsec-clear-site-data/
Charter: 2015
General Syntax:
Clear-Site-Data = 1#option
option = parameter *( OWS ";" [ OWS parameter ] )
parameter = key [ BWS "=" value ]
key = token
value = token / quoted-string
// Parameters:
// cache, cookies, storage, executionContexts, *
@thisNatasha
Content Security Policy (CSP)
W3CCandidateRecommendation
Draft: www.w3.org/TR/CSP/
http://content-security-policy.com/
Charter: 2013 & 2015
@thisNatasha
Content Security Policy (CSP)
W3CCandidateRecommendation
The Web Security Model is based on “Same Origin Policy”
● Code from https://mybank.com should only have access to
https://mybank.com’s data
● https://evil.example.com should certainly never be allowed
access.
Content Security Policy is a HTTP Header which can help!
Draft: www.w3.org/TR/CSP/
http://content-security-policy.com/
Charter: 2013 & 2015
Content-Security-Policy: default-src 'self'; img-src *; media-src
media1.com media2.com; script-src userscripts.example.com
@thisNatasha
CSP 2: What’s Different?
W3CCandidateRecommendation
New things in Content Security Policy Level 2 include:
[1] New “Delivery Methods”
e.g HTML <meta> element
[2] Dealing with multiple policies
all will be obeyed!
[3] Dealing with Workers!
How do we deal with Shared or ServiceWorkers?
[5] New Directives
e.g. referrer, plugin-types, form-action, frame-ancestors
Charter: 2015
Draft: www.w3.org/TR/CSP2/
@thisNatasha
Subresource Integrity (SRI)
W3CWorkingDraft
Draft: www.w3.org/TR/SRI/
Charter: 2015
@thisNatasha
Subresource Integrity (SRI)
Security Measures
E.g. TLS, HSTS, and pinned public keys
authenticate only the server,
not the content.
Attacker can still change content!
W3CWorkingDraft
Draft: www.w3.org/TR/SRI/
Charter: 2015
<script src="https://code.jquery.com/jquery-1.10.2.min.js"
integrity="ni:///sha-256;C6CB9UYIS9UJeqinPHWTHVqh_E1uhG5Twh-Y5qFQmYg?
ct=application/javascript">
@thisNatasha
Referrer Policy
W3CWorkingDraft
Draft: www.w3.org/TR/referrer-policy/
Charter: 2015
@thisNatasha
Referrer Policy
Referrer Policy says what a site should do about the
Referrer Header.
How do you do it?
[1] Content Security Policy (CSP) directive
[2] Content Security Policy (CSP) meta tag
[3] Via a meta element with a name of referrer.
[4] Implicitly, via inheritance.
W3CWorkingDraft
Draft: www.w3.org/TR/referrer-policy/
Charter: 2015
@thisNatasha
Mixed Content
W3CWorkingDraft
Draft: www.w3.org/TR/mixed-content/
Charter: 2015
@thisNatasha
Mixed Content
Does your HTTPS site contain content with HTTP links?
Then you have MIXED CONTENT!
MIxed Content details how user agents should treat
these resources.
W3CWorkingDraft
Draft: www.w3.org/TR/mixed-content/
Charter: 2015
@thisNatasha
Do we need to do more?
Mailing List public-webappsec@w3.org
Website www.w3.org/2011/webappsec/
How powerful are Powerful Features?
Can features become too powerful? Do we need to enforce
HTTPS or other measures for these APIs?
Do we need full HTTPS?
The IAB supported HTTPS for new protocol
development. Should the W3C do the same thing?
@thisNatasha
Powerful Features Document
https://w3c.github.io/webappsec/specs/powerfulfeatures/
@thisNatasha
Powerful Features Document
https://w3c.github.io/webappsec/specs/powerfulfeatures/
[1] How can web features (APIs) be abused?
[2] Categorising
- access to sensitive data? (Credential Management)
- access to a sensor? (Geolocation)
- holds state of origin? (Service Workers)
- Permission is required?
[3] Defining some algorithms
Using TLS, HTTPS, localhost, file, packaged, preconfigured = Trusted
Otherwise not Trusted
@thisNatasha
Do we need to do more?
Mailing List public-webappsec@w3.org
Website www.w3.org/2011/webappsec/
How powerful are Powerful Features?
Can features become too powerful? Do we need to enforce
HTTPS or other measures for these APIs?
Do we need full HTTPS?
The IAB supported HTTPS for new protocol
development. Should the W3C do the same thing?
@thisNatasha
Transition to HTTPS
https://github.com/w3ctag/web-https
@thisNatasha
Transition to HTTPS
https://github.com/w3ctag/web-https
“Therefore, the TAG finds that the Web platform should be
designed to actively prefer secure origins — typically, by
encouraging use of HTTPS URLs instead of HTTP ones.
Furthermore, the end-to-end nature of TLS encryption must
not be compromised on the Web, in order to preserve this
trust.”
@thisNatasha
Clear Site Data: Open Issues
W3CFirstPublicWorkingDraft
Draft:
https://w3c.github.io/webappsec-clear-site-data/
Charter: 2015
- Integrating with Fetch
- Still in control of Web Developer, not the user
- No github issues!

More Related Content

PPTX
SPFx Webinar Loading SharePoint data in a SPFx Webpart
PPT
Application Security
PPTX
Restful webservices
PPTX
Best practices of web app security (samvel gevorgyan)
PDF
Rest web services
PPTX
Website hacking and prevention (All Tools,Topics & Technique )
PPTX
Top security threats to Flash/Flex applications and how to avoid them
PPT
Browser security
SPFx Webinar Loading SharePoint data in a SPFx Webpart
Application Security
Restful webservices
Best practices of web app security (samvel gevorgyan)
Rest web services
Website hacking and prevention (All Tools,Topics & Technique )
Top security threats to Flash/Flex applications and how to avoid them
Browser security

What's hot (20)

PPT
PPT
Hacking web applications
PPT
Hacking A Web Site And Secure Web Server Techniques Used
PPTX
The Full Power of ASP.NET Web API
PPTX
Rest & RESTful WebServices
PDF
CS6262_Group9_FinalReport
PPT
HTTP protocol and Streams Security
PPTX
ASP.NET WEB API
PDF
CSRF, ClickJacking & Open Redirect
PPTX
01. http basics v27
PDF
RESTful Web Services
PPT
AppSec 2007 - .NET Web Services Hacking
PPTX
Adding Identity Management and Access Control to your Application, Authorization
PPT
Source Code Analysis with SAST
PPTX
ASP.NET Mvc 4 web api
PPTX
Overview of RESTful web services
DOC
Malicious file upload attacks - a case study
PPTX
ASP.NET WEB API Training
PPTX
ASP.NET Web API and HTTP Fundamentals
PPTX
Best Practices for Architecting a Pragmatic Web API.
Hacking web applications
Hacking A Web Site And Secure Web Server Techniques Used
The Full Power of ASP.NET Web API
Rest & RESTful WebServices
CS6262_Group9_FinalReport
HTTP protocol and Streams Security
ASP.NET WEB API
CSRF, ClickJacking & Open Redirect
01. http basics v27
RESTful Web Services
AppSec 2007 - .NET Web Services Hacking
Adding Identity Management and Access Control to your Application, Authorization
Source Code Analysis with SAST
ASP.NET Mvc 4 web api
Overview of RESTful web services
Malicious file upload attacks - a case study
ASP.NET WEB API Training
ASP.NET Web API and HTTP Fundamentals
Best Practices for Architecting a Pragmatic Web API.
Ad

Similar to WebAppSec Updates from W3C (20)

PDF
IT-Security@Contemporary Life
PDF
Let's sleep better: programming techniques to face new security attacks in cloud
PPTX
Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...
PDF
PDF
Oauth 2.0 Security Considerations for Client Applications
PPTX
Security Best Practices for Bot Builders
PPTX
Owasp web application security trends
PPTX
[2.1] Web application Security Trends - Omar Ganiev
PDF
Evolving web security model v1.1 - Portland OWASP May 29 2014
PDF
Why Traditional Web Security Technologies no Longer Suffice to Keep You Safe
PDF
[3.1] Webappsec future standards - Taras Ivaschenko
PPTX
Secure web messaging in HTML5
PDF
Designing & Building Secure Web APIs
PDF
Web Authentication: a Future Without Passwords?
PPTX
Harness the power of http headers to secure your web apps
PDF
APIdays Paris 2019 - API Security Tips for Developers by Isabelle Mauny, 42Cr...
PPTX
Presentation on Top 10 Vulnerabilities in Web Application
PDF
APIsecure 2023 - OAuth, OIDC and protecting third-party credentials, Ed Olson...
PDF
Centralise legacy auth at the ingress gateway
PDF
SecDevOps for API Security
IT-Security@Contemporary Life
Let's sleep better: programming techniques to face new security attacks in cloud
Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...
Oauth 2.0 Security Considerations for Client Applications
Security Best Practices for Bot Builders
Owasp web application security trends
[2.1] Web application Security Trends - Omar Ganiev
Evolving web security model v1.1 - Portland OWASP May 29 2014
Why Traditional Web Security Technologies no Longer Suffice to Keep You Safe
[3.1] Webappsec future standards - Taras Ivaschenko
Secure web messaging in HTML5
Designing & Building Secure Web APIs
Web Authentication: a Future Without Passwords?
Harness the power of http headers to secure your web apps
APIdays Paris 2019 - API Security Tips for Developers by Isabelle Mauny, 42Cr...
Presentation on Top 10 Vulnerabilities in Web Application
APIsecure 2023 - OAuth, OIDC and protecting third-party credentials, Ed Olson...
Centralise legacy auth at the ingress gateway
SecDevOps for API Security
Ad

More from Natasha Rooney (12)

PDF
MARNEW at IETF 94
PDF
JQuery UK Service Workers Talk
PDF
STV Voting System Explained
PDF
TCP and Mobile Networks Turbulent Relationship
PDF
Solving HTTP Problems With Code and Protocols
PDF
TLS Perf: from three to zero in one spec
PDF
Evolving HTTP and making things QUIC
PDF
JQuery UK February 2015: Service Workers On Vacay
PDF
GSMA in W3C
PDF
Making it Work Offline: Current & Future Offline APIs for Web Apps
PDF
FirefoxOS Meetup - Updates on Offline in HTML5 Web Apps
PDF
Updates on Offline: “My AppCache won’t come back” and “ServiceWorker Tricks ...
MARNEW at IETF 94
JQuery UK Service Workers Talk
STV Voting System Explained
TCP and Mobile Networks Turbulent Relationship
Solving HTTP Problems With Code and Protocols
TLS Perf: from three to zero in one spec
Evolving HTTP and making things QUIC
JQuery UK February 2015: Service Workers On Vacay
GSMA in W3C
Making it Work Offline: Current & Future Offline APIs for Web Apps
FirefoxOS Meetup - Updates on Offline in HTML5 Web Apps
Updates on Offline: “My AppCache won’t come back” and “ServiceWorker Tricks ...

Recently uploaded (20)

PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Empathic Computing: Creating Shared Understanding
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Big Data Technologies - Introduction.pptx
PDF
cuic standard and advanced reporting.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Approach and Philosophy of On baking technology
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Empathic Computing: Creating Shared Understanding
Unlocking AI with Model Context Protocol (MCP)
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Advanced methodologies resolving dimensionality complications for autism neur...
Per capita expenditure prediction using model stacking based on satellite ima...
Encapsulation_ Review paper, used for researhc scholars
Programs and apps: productivity, graphics, security and other tools
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Diabetes mellitus diagnosis method based random forest with bat algorithm
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Big Data Technologies - Introduction.pptx
cuic standard and advanced reporting.pdf
MIND Revenue Release Quarter 2 2025 Press Release
“AI and Expert System Decision Support & Business Intelligence Systems”
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
NewMind AI Weekly Chronicles - August'25 Week I
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Approach and Philosophy of On baking technology

WebAppSec Updates from W3C

  • 1. @thisNatasha WebAppSec Updates from W3C Natasha Rooney @thisNatasha GSMA Web Technologist W3C WebMob Co-Chair www.w3.org/Mobile/IG/
  • 2. @thisNatasha Web features are getting more powerful. Developers: how can we help developers make better choices or protect their apps? Users: how can we help protect users? What’s happening? Service Workers WebRTC Geolocation Permissions
  • 3. @thisNatasha WebAppSec Working Group …[T]he mission of the Web Application Security Working Group is to develop technical and policy mechanisms to improve the security of and enable secure cross-site communications for applications on the Web. Mailing List public-webappsec@w3.org Website www.w3.org/2011/webappsec/
  • 4. @thisNatasha WebAppSec: Goals [1] Attack Surface Reduction: allow applications to restrict or forbid dangerous features [2] Secure Mashups: mechanisms for secure resource sharing and messaging across origins [3] Manageability: Uniform policy control points from which to manage these risks [4] Develop a policy mechanism: standardized means for security policy declaration Mailing List public-webappsec@w3.org Website www.w3.org/2011/webappsec/
  • 5. @thisNatasha WebAppSec: Work 2015 Charter Content Security Policy (CSP) Lvl 2, Lvl X User Interface Security Directives for CSP Mixed Content (MIX) Sub Resource Integrity Referrer Policy Credential Management API Suborigin Namespaces Confinement with Origin Web Labels Entry Point Regulation for Web Apps Permissions API Mailing List public-webappsec@w3.org Website www.w3.org/2011/webappsec/
  • 6. @thisNatasha Let’s go through some work! Clear Site Data COWL Credential Management Other Updates
  • 8. @thisNatasha Clear Site Data W3CFirstPublicWorkingDraft Draft: https://w3c.github.io/webappsec-clear-site-data/ Charter: 2015 “Instruct a user agent to clear a site’s locally stored data related to a host.” - Web Applications store data on user’s computer - Data is sensitive and valuable - Some removed via JavaScript, others not: Cookies: OK HTTPonly cookies: Not OK Cache: Not OK
  • 9. @thisNatasha Clear Site Data: Examples W3CFirstPublicWorkingDraft Draft: https://w3c.github.io/webappsec-clear-site-data/ Charter: 2015 Signs out of “Super Secret Social Network” via a CSRF-protected POST The site author wishes to ensure that locally stored data is removed. Response HTTP header: https://supersecretsocialnetwork.example.com/logout // Signing Out / Kill Switch Clear-Site-Data: * // Keep Critical Cookies Clear-Site-Data: storage; executionContexts; cache
  • 10. @thisNatasha Clear Site Data: Example 2 W3CFirstPublicWorkingDraft Draft: https://w3c.github.io/webappsec-clear-site-data/ Charter: 2015 Target a specific app subdomain by including a request to that subdomain as part of the logout landing page: - Request’s preflight return: proper CORS headers - Actual requests return header: fetch("https://minus.megacorp.example.com/clear-site-data", { method: "POST", mode: "cors", headers: new Headers({ "CSRF": "[insert sekrit token here]" }) }); Clear-Site-Data: *
  • 11. @thisNatasha Confinement with Origin Web Labels (COWL) W3CWorkingDraft Draft: https://w3c.github.io/webappsec-cowl/ Charter: 2015
  • 12. @thisNatasha Confinement with Origin Web Labels (COWL) W3CWorkingDraft Draft: https://w3c.github.io/webappsec-cowl/ Charter: 2015 “Specifying privacy and integrity policies on data, in the form of origin labels, and a mechanism for confining code according to such policies.” - third party scripts puts user’s data confidentiality and integrity at risk! - CORs and CSP can help! - But not where that data can be used...
  • 13. @thisNatasha Confinement with Origin Web Labels (COWL) W3CWorkingDraft Draft: https://w3c.github.io/webappsec-cowl/ Charter: 2015 COWL: - developer states that a password is confidential to https://example.com - It can then be shared with (e.g.) a third-party password checker. - The third-party password checker is confined and respects the policy on the password: COWL disallows it from disclosing the password to any origin other than https://example.com. - Confines code at the Context Level - Developers can set restrictions on shared data - Stop code from being shared outside specified origins - Can compartmentalise apps to specify privileges
  • 14. @thisNatasha COWL: Example Confining untrusted third-party services W3CWorkingDraft Draft: https://w3c.github.io/webappsec-cowl/ Charter: 2015 - https://example.com wishes to use the untrusted https://passwordcheck.com - https://example.com uses COWL to add a confidentiality policy (a label) to the password before sending it to https://passwordcheck.com // Create new policy using Labels that specifies that the password is sensitive // to https://example.com and should only be disclosed to this origin: var policy = new Label(window.location.origin); // Associate the label with the password: var labeledPassword = new LabeledObject(password, {confidentiality: policy}); // Send the labeled password to the checker iframe: checker.postMessage(labeledPassword, "https://untrusted.com"); // Register listener to receive a response from checker, etc.
  • 15. @thisNatasha COWL: Example Confining untrusted third-party services W3CWorkingDraft Draft: https://w3c.github.io/webappsec-cowl/ Charter: 2015 1. https://passwordcheck.com checks the password 2. COWL limits the iframe to communicating with origins that preserve the password’s confidentiality (https://example.com). 3. This “policy” is enforced mandatorily 4. https://passwordcheck.com cannot send the password elsewhere Note: https://passwordcheck.com can communite with other origins before inpecting the password. // Create new policy using Labels that specifies that the password is sensitive // to https://example.com and should only be disclosed to this origin: var policy = new Label(window.location.origin); // Associate the label with the password: var labeledPassword = new LabeledObject(password, {confidentiality: policy}); // Send the labeled password to the checker iframe: checker.postMessage(labeledPassword, "https://untrusted.com"); // Register listener to receive a response from checker, etc.
  • 16. @thisNatasha COWL: Examples Sharing data with mashups / privilege separation W3CWorkingDraft Draft: https://w3c.github.io/webappsec-cowl/ Charter: 2015 - https://example.com wishes to allow https://mashup.com access to data. - Server operator can set COWL response header to: 1. https://mashup.com can access data through CORs 2. COWL header says data can only be shared with https://example.com - Give different privileges according to users. 1. Content of user1 does not interfere with any other user. 2. Content of user1 cannot leak anywhere else. Access-Control-Allow-Origin: https://mashup.com Sec-COWL: data-confidentiality [ ["https://example.com"] ] Sec-COWL: ctx-privilege [ ['self', 'cowl://user1'] ]
  • 18. @thisNatasha Credential Management W3CWorkingDraft Draft:http://w3c.github.io/webappsec-credential- management/ Charter: 2015 “[R]equest a user’s credentials from a user agent, and to help the user agent correctly store user credentials for future use” - Autofilled credentials - Hard for some use cases: e.g. credentials sent through XHR - Credential Manager API can help!
  • 19. @thisNatasha Credential Management: Password-based Sign-in W3CWorkingDraft Draft:http://w3c.github.io/webappsec-credential- management/ Charter: 2015 navigator.credentials.get({ "password": true }).then( function(credential) { if (!credential) { // The user either doesn’t have credentials for this site, or // refused to share them. Insert some code here to show a basic // login form (or, ideally, do nothing, since this API should // really be progressive enhancement on top of an existing form). return; } if (credential.type == "password") { fetch("https://example.com/loginEndpoint", { body: credential.toFormData(), method: "POST" }) .then(function (response) { // Notify the user that signin succeeded! Do amazing, signed-in things! }); } else { // in Spec: federated sign-in example } });
  • 20. @thisNatasha WebAppSec: Other Updates Spec Updates - Candidate Recommendation: Subresource Integrity - Candidate Recommendation: Mixed Content - Password generation in Credential Manager - Published: COWL - Referrer turned into a distinct header - Mixed Content and DASH - Permissions API Working Draft - HSTS, mixed content, and priming: fetch resources using HTTPS even if the URL uses the "http:" Group Management Updates - Specs now on Github - Berlin Face-to-Face Mailing List public-webappsec@w3.org Website www.w3.org/2011/webappsec/
  • 21. @thisNatasha WebAppSec: At TPAC TPAC 2015 29-30 October - Credential Management - Content Security Policy - Referrer Policy - Joint session with Web Payments WG on secure API design - COWL - CSP Embedded Enforcement Agenda Link Mailing List public-webappsec@w3.org Website www.w3.org/2011/webappsec/
  • 22. @thisNatasha ありがとう! Natasha Rooney @thisNatasha GSMA Web Technologist W3C WebMob Co-Chair www.w3.org/Mobile/IG/ Thanks to Brad Hill (Chair) & Mike West (editor) from the WebAppSec WG! Mailing List public-webappsec@w3.org Website www.w3.org/2011/webappsec/
  • 24. @thisNatasha Clear Site Data W3CFirstPublicWorkingDraft Draft: https://w3c.github.io/webappsec-clear-site-data/ Charter: 2015 General Syntax: Clear-Site-Data = 1#option option = parameter *( OWS ";" [ OWS parameter ] ) parameter = key [ BWS "=" value ] key = token value = token / quoted-string // Parameters: // cache, cookies, storage, executionContexts, *
  • 25. @thisNatasha Content Security Policy (CSP) W3CCandidateRecommendation Draft: www.w3.org/TR/CSP/ http://content-security-policy.com/ Charter: 2013 & 2015
  • 26. @thisNatasha Content Security Policy (CSP) W3CCandidateRecommendation The Web Security Model is based on “Same Origin Policy” ● Code from https://mybank.com should only have access to https://mybank.com’s data ● https://evil.example.com should certainly never be allowed access. Content Security Policy is a HTTP Header which can help! Draft: www.w3.org/TR/CSP/ http://content-security-policy.com/ Charter: 2013 & 2015 Content-Security-Policy: default-src 'self'; img-src *; media-src media1.com media2.com; script-src userscripts.example.com
  • 27. @thisNatasha CSP 2: What’s Different? W3CCandidateRecommendation New things in Content Security Policy Level 2 include: [1] New “Delivery Methods” e.g HTML <meta> element [2] Dealing with multiple policies all will be obeyed! [3] Dealing with Workers! How do we deal with Shared or ServiceWorkers? [5] New Directives e.g. referrer, plugin-types, form-action, frame-ancestors Charter: 2015 Draft: www.w3.org/TR/CSP2/
  • 29. @thisNatasha Subresource Integrity (SRI) Security Measures E.g. TLS, HSTS, and pinned public keys authenticate only the server, not the content. Attacker can still change content! W3CWorkingDraft Draft: www.w3.org/TR/SRI/ Charter: 2015 <script src="https://code.jquery.com/jquery-1.10.2.min.js" integrity="ni:///sha-256;C6CB9UYIS9UJeqinPHWTHVqh_E1uhG5Twh-Y5qFQmYg? ct=application/javascript">
  • 31. @thisNatasha Referrer Policy Referrer Policy says what a site should do about the Referrer Header. How do you do it? [1] Content Security Policy (CSP) directive [2] Content Security Policy (CSP) meta tag [3] Via a meta element with a name of referrer. [4] Implicitly, via inheritance. W3CWorkingDraft Draft: www.w3.org/TR/referrer-policy/ Charter: 2015
  • 33. @thisNatasha Mixed Content Does your HTTPS site contain content with HTTP links? Then you have MIXED CONTENT! MIxed Content details how user agents should treat these resources. W3CWorkingDraft Draft: www.w3.org/TR/mixed-content/ Charter: 2015
  • 34. @thisNatasha Do we need to do more? Mailing List public-webappsec@w3.org Website www.w3.org/2011/webappsec/ How powerful are Powerful Features? Can features become too powerful? Do we need to enforce HTTPS or other measures for these APIs? Do we need full HTTPS? The IAB supported HTTPS for new protocol development. Should the W3C do the same thing?
  • 36. @thisNatasha Powerful Features Document https://w3c.github.io/webappsec/specs/powerfulfeatures/ [1] How can web features (APIs) be abused? [2] Categorising - access to sensitive data? (Credential Management) - access to a sensor? (Geolocation) - holds state of origin? (Service Workers) - Permission is required? [3] Defining some algorithms Using TLS, HTTPS, localhost, file, packaged, preconfigured = Trusted Otherwise not Trusted
  • 37. @thisNatasha Do we need to do more? Mailing List public-webappsec@w3.org Website www.w3.org/2011/webappsec/ How powerful are Powerful Features? Can features become too powerful? Do we need to enforce HTTPS or other measures for these APIs? Do we need full HTTPS? The IAB supported HTTPS for new protocol development. Should the W3C do the same thing?
  • 39. @thisNatasha Transition to HTTPS https://github.com/w3ctag/web-https “Therefore, the TAG finds that the Web platform should be designed to actively prefer secure origins — typically, by encouraging use of HTTPS URLs instead of HTTP ones. Furthermore, the end-to-end nature of TLS encryption must not be compromised on the Web, in order to preserve this trust.”
  • 40. @thisNatasha Clear Site Data: Open Issues W3CFirstPublicWorkingDraft Draft: https://w3c.github.io/webappsec-clear-site-data/ Charter: 2015 - Integrating with Fetch - Still in control of Web Developer, not the user - No github issues!