Git Product home page Git Product logo

webappsec's Introduction

Web Application Security Working Group

Table of Specifications

Complete ED TR
Content Security Policy Level 1 NOTE: /TR/CSP1
Subresource Integrity webappsec-subresource-integrity REC: /TR/SRI/
Content Security Policy Level 2 webappsec-csp REC: /TR/CSP2
Stable ED TR
Mixed Content webappsec-mixed-content CR: /TR/mixed-content/
Upgrade Insecure Requests webappsec-upgrade-insecure-requests WD: /TR/upgrade-insecure-requests/
Secure Contexts webappsec-secure-contexts CR: /TR/powerful-features/
Referrer Policy webappsec-referrer-policy CR: /TR/referrer-policy/
Stabilizing ED TR
Credential Management Level 1 webappsec-credential-management WD: /TR/credential-management/
Permissions API permissions FPWD: /TR/permissions/
Content Security Policy Level 3 webappsec-csp WD: /TR/CSP
Works in Progress ED TR
Clear Site Data webappsec-clear-site-data FPWD: /TR/clear-site-data/
A Well-Known URL for Changing Passwords webappsec-change-password-url
Detecting the reliability of HTTP status codes webappsec-change-password-url
Obsolete or Abandoned ED TR
Confinement with Origin Web Labels webappsec-cowl FPWD: /TR/cowl/
CSP Pinning webappsec-csp FPWD: /TR/csp-pinning/
Entry Point Regulation webappsec-epr FPWD: /TR/epr/

webappsec's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

webappsec's Issues

[SRI] Caching implications

Right now, the spec mentions that SRI could be used to ID cached files.

User agents may decide to use the integrity metadata as an identifier in a local cache, for instance, meaning that common resources (for example, JavaScript libraries) could be cached and retrieved once, regardless of the URL from which they are loaded.

Personally, I feel this part is huge.

This would provide what Content-MD5 and ETag failed to, without the roundtrip to check if the resource it still good.

Without the caching, the usefulness of this spec could be diminished, potentially relegating it to download checksum for certain websites and CDN safeguard for banking websites.

With the caching, this is bound to go straight in every performance optimisation guide. Right below the title. With a 72px bold flashing font.

Would you consider making the spec about caching as much as it is about security, with caching as a MUST implement?

[CSP] Note about "Content-Security-Policy-Report-Only"

Be nice to include the note about not being able to use "Content-Security-Policy-Report-Only" in a meta element in the "Content-Security-Policy-Report-Only" section. I was testing the things in the spec out as I was reading and this almost tripped me up. I spotted the note in the meta section by accident.

[csp] show how server is contacted with `Content-Security-Policy-Report-Only`

the spec says:

For example.... If their site violates this policy, instead of breaking the site, the user agent will send violation reports to a URI specified in the policy.

Be nice in this example to actually link to, or show, the declaration an author needs to use to include the URI that is pinged when there is a violation of some policy.

[CSP] Authors SHOULD sounds weird

Authors are not a conformance class, hence shouldn't have RFC2119 terms associated with them... For authoring recommendations maybe just "recommend" things instead:

Authors SHOULD place the meta element as early in the document as possible to reduce the risk of content injection before a protective policy can be read and enforced.

Could be:

Authoring Requirement: It is RECOMMENDED that authors place the meta element as early in the document as possible. This is to reduce the risk of content injection before a protective policy can be read and enforced.

SHA256 mismatches

Current working draft for CSP has the following test vector (Example 6):

For example, the SHA-256 digest of alert('Hello, world.'); is qznLcsROx4GACP2dm0UCKCzCG+HiZ1guq6ZZDob/Tng=.

Calculated by the following command:

echo -n "alert('Hello, world');" | openssl dgst -sha256 -binary | openssl enc -base64

I've tried that on two different machines (Mac & Linux) and the resulting hash is different:

$ echo -n "alert('Hello, world');" | openssl dgst -sha256 -binary | openssl enc -base64
b+jOy0DlwBaNGMxhuGypbGgvtY9mVoy1LlMALqJWsoY=

Just after that, there's another example that contains yet another hash, which is way too long for SHA256:

Content-Security-Policy: script-src 'sha256-YWIzOWNiNzJjNDRlYzc4MTgwMDhmZDlkOWI0NTAyMjgyY2MyMWJlMWUyNjc1ODJlYWJhNjU5MGU4NmZmNGU3OAo='

Consider a directive to set `nosniff` policy for a document's resources.

As proposed in http://lists.w3.org/Archives/Public/public-webappsec/2014Aug/0034.html:

Many web site uses JSONP, but may set the wrong Content-Type(e.g.
text/html), sniffing will let the codes looks working. But for security, I
want to turn sniffing off using `X-Content-Type-Options: nosniff`.

Sometimes it is really difficult for me to find out all the JSONP with
wrong Content-Type assigned.

If I can use CSP like :

Content-Security-Policy-Report-Only: content-type-option noniff; report-uri
/cspreport.do

Help me finding out all the Content-Type sniffing invoke.

P.S.
1. "X-" prefix header is deprecated by RFC6648
2. In CSP Level 2 frame-ancestors replaces X-Frame-Options and
reflected-xss replaces X-XSS-Protection, but X-Content-Type-Options has no
replacement.

[csp] References are out of date

There are a lot of referenced specs that are quite out of date: xhr, "html5" should be HTML, etc. Be nice if instead of URI, the WHATWG URL spec was referenced, etc.

[CSP] style-src without unsafe-eval should also block `.selectorText`

a style-src restriction that does not include unsafe-eval intends to block modifying CSS from scripts using free text. This currently restricts a set of algorithms: "insert a CSS rule, parse a CSS rule, [and] parse a CSS declaration block".

It is still possible to modify styles from scripts using the .selectorText attribute for CSS rules.
I recommend we include the "parse a group of selectors" algorithm from the CSSOM spec

Overview.html syntax error?

url: https://github.com/w3c/webappsec/blob/master/admin/Overview.html

<html>
    <meta http-equiv="Content-Security-Policy"
          content="default-src none; img-src http://www.w3.org https://www.google.com; style-src 'self'; child-src https://www.google.com; frame-src https://www.google.com; form-action http://www.w3.org; connect-src https://localhost:*">
    <!--
        Chrome mobile on iOS uses internal XHR to do things like checking the phishing url database, so you
        trigger a spoof warning if you don't have this connect-src rule for a meta-tag. (header processing
        has a workaround, it seems) OK here since there is no XHR anywhere in this resource anyway
    -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>W3C Web Application Security Working Group</title>
    <link href="Overview.css" rel="stylesheet" type="text/css"></link>
<head>
</head>
<body>

should be:

<html>
<head>
    <meta http-equiv="Content-Security-Policy"
          content="default-src none; img-src http://www.w3.org https://www.google.com; style-src 'self'; child-src https://www.google.com; frame-src https://www.google.com; form-action http://www.w3.org; connect-src https://localhost:*">
    <!--
        Chrome mobile on iOS uses internal XHR to do things like checking the phishing url database, so you
        trigger a spoof warning if you don't have this connect-src rule for a meta-tag. (header processing
        has a workaround, it seems) OK here since there is no XHR anywhere in this resource anyway
    -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>W3C Web Application Security Working Group</title>
    <link href="Overview.css" rel="stylesheet" type="text/css"></link>
</head>
<body>

the meta tag should between <head> and </head>, right?

SRI: noncanonical-src use cases

"Issue-5" in the draft spec text states that noncanoncial-src only makes sense if we are allowing HTTP. This is not true - it also allows for fallback in the case that e.g. a client is behind a proxy that intercepts and modifies HTTPS connections. This is likely a nontrivial percentage of clients. (e.g. enterprise and government systems)

CSP Sec 5.1 Worker owner document clarification

We should update the first part to reflect the fact a blob/unique Worker inherits the CSP of the owner document or parent worker (if the parent worker has CSP header). I am happy to provide a pull request if you agree with these semantics.

Add informative reference for "object-capability discipline"

There's a ref for Object Capability URLs, but no context provided for Section 1.4. Many readers will not be familiar with this term and the first few Google hits aren't an easy place from which to extract a concise definition. Can we find a good informative reference at a stable link to point to?

SRI: Fine grained "require integrity" option

A simple use case that I can't figure out how to implement with the current spec is: "require integrity for all script loads"

I am beginning to think that instead of a new "integrity-policy" directive, we should just have new keywords for the existing CSP directives like script-src. OR some other way to declare integrity requirements for each type of sub-resource.

I am just creating a placeholder issue for now. I am traveling and don't have the time/connectivity required to start and participate in a thread on public-webappsec.

[SRI] Talk about Fonts

(HT Tanvi)

The spec needs to talk about fonts. It mentions it in the beginning but never follows up with details.

SI: Change Accept Header

If the integrity metadata has the content type specified, it seems the browser should change the Accept header to the specified content type.

Subresource Integrity Length Extension?

Forgive me if I'm mistaken, but the current hashing solution detailed in the Subresource Integrity specification seems to be silent on the the possibility of length extension with Merkle–Damgård type hash functions like the SHA family.

http://en.wikipedia.org/wiki/Length_extension_attack

One solution would to be use a HMAC construction where the 'key' material is composed from resource metadata, including the verified Content-Length, or to mandate a hash function immune to such attacks, such as SHA-3.

SRI: Add SHA-384 to the mandatory requirements?

This refers to 3.2, Cryptographic hash functions. We say that user agents MUST support SHA-256 and SHA-512 and MAY support additional hash functions.

I am not a cryptographer, but the more I read about Merkle–Damgård constructions, the more I'm wondering whether we'd want SHA-384 as mandatory. It seems the most convenient way to prevent length extension problems.

SHA-384 is well supported within OpenSSL and NSS, so I think this should add no cost.

[CSP] Server is not a valid conforming class of product

The spec constantly speaks as if Server is a valid conforming class. However, all conformance requirements for servers are "MAY". This clearly indicates that the server is not a conforming class, but more of a thing that emits policies to be enforced by the client (hence, anything to do with the server can only ever be "authoring guidelines" at best!).

I would recommend dropping the server as a conforming class and changing all "server MAY" statements to statements of fact: "A server can".

Consider, these are all TRUE facts:

  • A server can send more than one HTTP header field named Content-Security-Policy with a given resource representation.
  • A server can send different Content-Security-Policy header field values with different representations of the same resource or with different resources.
  • A server can send more than one HTTP header field named Content-Security-Policy-Report-Only with a given resource representation.
  • and so on... you get the idea. Given the facts above, the user agent (client) is forced to deal with the above situations through the algorithms defined in the specification.

That sets more realistic expectations about what conforming user agents can expect from server responses - specially when they servers send "funky" things that the client needs to make sense of and enforce.

[CSP] Delivery... should it mention meta?

the spec says:

The server delivers the policy to the user agent via an HTTP response header.

Should it not say:

The server delivers the policy to the user agent via an HTTP response header or a HTML meta element.

CSP reports for eval() and inline script are identical

CSP violation reports sent when browser blocks eval() and inline script are identical in their contents, which makes it difficult to determine what really caused them.

In both cases the fields violated-directive will be set to script-scr and blocked-uri will be empty. So when I'm trying to analyse received reports I can't really say what I should allow - unsafe-eval or unsafe-inline.

The solution might be either sending some kind of generic blocked-urlvalue - such as self-eval or self-inline, or adding an additional field to the report, such as blocked-feature set to eval or inline respectively.

[CSP] Avoid RFC2119 keywords in non-normative sections

Please avoid the use of RFC2119 keywords in non-normative sections. For example, 3.4 Enforcing multiple policies:

The above sections note that when multiple policies are present, each must be enforced or reported, according to its type.

Should be:

The above sections note that when multiple policies are present, each is enforced or reported, according to its type.

Clarification of CSP sandbox and workers.

Arguably most of the sandbox flags don't make sense for workers, but the empty directive (i.e., just sandbox) and sandbox allow-same-origin can have reasonable semantics. The question is if a worker inherits CSP from owner document or is accompanied by a CSP header which has the 'sandbox' directive, should the worker script's origin be set to a unique origin? Or should we just ignore sandbox for workers (and maybe have SandboxedWorkers instead)?

[subresource-integrity] With proxies, no-transform should be (at least) should

in the proxies section, there's a slight dissonance between the requirement from proxies and the requirement from user-agents.

While proxies must avoid modification of resources which integrity is verified (which is great, and I 100% agree with), UAs may send the no-transform headers that'd enable proxies to do that. Without that header, most proxies would have a very hard time avoiding modifications of such resources, resulting in compliance issues, and worse, user visible content integrity issues.

I'd say that at the very least, the requirement should be that UAs should send these headers (even though I'd consider must better).

[MIX] private origin does not account for IPv6

Section 2.1 lists the IPv4 private address space, but not IPv6. I think RFC 4193 defines this for IPv6, but my notes indicate the following address spaces should probably be investigated as they may be security relevant:

# IPv4 addressed Encoded into IPv6, where the IPv4 component is an RFC1918 address
0::  ffff:AABB:CCDD - IPv4 Mapped Address (SIIT).  Also 0::ffff:aa.bb.cc.dd
0::  0000:AABB:CCDD - IPv4 Compatible Address (SIIT). Also 0::0:aa.bb.cc.dd
0::ffff:0:AABB:CCDD - IPv4 Translated Address (SIIT).
2002:AABB.CCDD:: - 6to4 address. Send to the IPv4 Address AA.BB.CC.DD

#Private Address Space
fc??::  - Possibly, eventually, the local network 10.0.0.0/8 for IPv6.  Currently Reserved.  (Part of fc00::/7)
fd??::  - The local network, 10.0.0.0/8 for IPv6.  Not routable unless conifgured explictly. (Part of fc00::/7)
fe80::  - Space for Link Local Addresses (not all assigned \/ )
fe80:0:0:0:: - Link Local Addresses. 169.254.0.0/16.
fe80::0200:5efe:aabb:ccdd - ISATAP globally unique IPv4 translated address
fe80::0000:5efe:aabb:ccdd - ISATAP private IPv4 translated address
fec?:: - First attempt at 10.0.0.0/8 for IPv6, Deprecated. (Part of fec0::/10)
fed?:: - First attempt at 10.0.0.0/8 for IPv6, Deprecated. (Part of fec0::/10)
fef?:: - First attempt at 10.0.0.0/8 for IPv6, Deprecated. (Part of fec0::/10)

#Multicast Addresses
ffx?:: - Multicast Addresses - http://www.iana.org/assignments/ipv6-multicast-addresses/ipv6-multicast-addresses.xml
ffx1:: - Interface-Local. 127.0.0.1; Packets may not exit box, stay within loopback.
ffx2:: - Link-Local. Packets may not be routed anywhere, but may be passed within a subnet.
ff02:0:0:0:0:1:ff??:: - Solicited Node Multicast Addresses
ffx3:: - IPv4 Local Scope?
ffx4:: - Admin Local Scope. Smallest scope an admin would need to configure. Kind of like two subnets.
ffx5:: - Site-Local. Restricted to local physical network.
ffx8:: - Organization-Local. Multicast within an organization. Not valid on public internet.
ffxe:: - Global Multicast addresses
ff3?:: - Unicode-Prefix-Based Multicast https://tools.ietf.org/html/rfc3306

SRI: Integration to Worker constructor seems brittle and not very future proof

Current spec contains a Worker constructor as follows:

[Constructor (DOMString scriptURL, DOMString integrityMetadata)]

I wonder if it would be more future proof to spec an object instead.
Assuming future patches to the Worker, tthis would cause less "first come first serve paremeters" being added in a possibly unintuitive order.

So how about this

[Constructor (DOMString scriptURL, object options)]
and then requiring an integrity field within?

Maybe @annevk has an opinion.

SI: Manual issue numbering.

We should number the issues manually so that they don't change while fiddling with the document's structure.

SRI: fix HTTP reference

The spec currently refers to HTTP/1.1 per RFC 2616. This should be fixed to RFC 7230/1.

It also has some direct links to RFC2616 and the HTTP drafts. These should be updated to point to the relevant subsections of RFC 7230/1.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.