GithubHelp home page GithubHelp logo

Comments (8)

jkarlin avatar jkarlin commented on June 8, 2024 1

Was it necessary to throw "self" out? It would be very nice to have as it's much more copy&pasteable and useful for snippets:

Feature-Policy: {"enable":["geolocation"], "target":["self"]}, {"disable":["geolocation"], "target":["!self"]}

from webappsec-permissions-policy.

ojanvafai avatar ojanvafai commented on June 8, 2024

Is target:self meant to defend against XSS? I think it's more for incremental adoption than security, i.e. I want this on my first party content by I can't force some third party I embed to do this.

I think it'd be OK to say that target:cascade is not overrideable via the attribute though and that if you want the security assurance you should be using target:cascade.

Does that work?

from webappsec-permissions-policy.

igrigorik avatar igrigorik commented on June 8, 2024

I think it'd be OK to say that target:cascade is not overrideable via the attribute though and that if you want the security assurance you should be using target:cascade.

This makes it impossible to whitelist a specific origin: either you block access for everyone, including yourself, or you keep it open for everyone... That said, perhaps #13 could address this?


Taking a step back.. If it is our goal is to address the XSS case (is it? :)), then I think we have to restrict ourselves to the header mechanism. Or, at least, if you want to protect yourself from the XSS case then: you MUST use the header mechanism; the header mechanism needs to support a whitelisting mechanism (which is what the attribute provides); header policy must take precedence over the attribute values?

Feature-Policy: {"disable":["geolocation"], "target":["cascade"]}, 
           {"enable":["geolocation"], target:["https://foo.com"]}

<iframe src="https://foo.com/widget"> <!-- Geolocation enabled -->
<iframe src="https://bar.com/thing" enable="geolocation"> <!-- noop...? -->

from webappsec-permissions-policy.

igrigorik avatar igrigorik commented on June 8, 2024

@jyasskin I think @mikewest's update addresses this case. Can you review and confirm?

from webappsec-permissions-policy.

jyasskin avatar jyasskin commented on June 8, 2024

It's a step, but to protect against XSS we need a whitelist of origins, while {disable: 'thing', target: [evilx, evily, evilz]} still allows evilw to use 'thing'. When 'enable' rules exist, that'll finish addressing this case.

from webappsec-permissions-policy.

igrigorik avatar igrigorik commented on June 8, 2024

I think we can add "self", but I don't think we want to get into predicates with "!self" and such. /cc @mikewest

from webappsec-permissions-policy.

jkarlin avatar jkarlin commented on June 8, 2024

Then I propose adding self and third-party as targets.

from webappsec-permissions-policy.

igrigorik avatar igrigorik commented on June 8, 2024

See discussion in #28 (comment).

from webappsec-permissions-policy.

Related Issues (20)

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.