Skip to content

Clarify object-src behavior when plugin content has no associated URL #814

Description

@roberto-apple

Given the following test case(s):

<?php
header("Content-Security-Policy: object-src 'none'", false);
//header("Content-Security-Policy: object-src;", false);
//header("Content-Security-Policy: object-src invalid;", false);
?>

<object id="obj" type="text/html"></object>
<embed id="emb" type="text/html"/>

These <object> and <embed> elements have no data/src attribute so they load no URL-associated content.
WebKit currently only blocks them under object-src 'none'

§6.1.9 (object-src) says: "If plugin content is loaded without an associated URL (perhaps an object element lacks a data attribute, but loads some default plugin based on the specified type), it MUST be blocked if object-src's value is 'none', but will otherwise be allowed."

§6.7.2.7 ("Does url match source list in origin with redirect count?") says "An empty source list (that is, a directive without a value: script-src, as opposed to script-src host1) is equivalent to a source list containing 'none', and will not match any URL."
So object-src; should also block and we are fixing this in WebKit.

However, the "but will otherwise be allowed" from 6.1.9 seems to suggest that object-src invalid; (where invalid is parsed as a hostname source expression, could've been something else) allows these elements, since the source list is not 'none'.

In contrast, Chrome blocks in this case too (object-src invalid;)

So, is the normative text in 6.1.9 intentional, or should the blocking behavior for plugin content without associated URL follow from the algorithms instead? If it's intentional, is the "but will otherwise be allowed" the correct behavior, or should any source list that cannot match the (nonexistent) URL also block?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions