Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change security best practice to unique origin per publication #1518

Merged
merged 6 commits into from
Feb 26, 2021

Conversation

mattgarrish
Copy link
Member

This PR updates the security section so that it discusses assigning a unique origin to each publication rather than assigning a unique domain per content document.

Let me know if the new note captures the issues that were raised on the 2021-02-18 telecon relating to how web-based reading systems cannot always enforce this kind of restriction and/or if there's anything else missing or that needs fixing.

Fixes #1156
Fixes #873


<!--
After each working draft is published:
- change the link/text in the section heading to refer to the published draft (use the dated URL)
- move all changes down to the next section
-->

<ul>
<li>19-Feb-2021: Updated the scripting security recommendations so that the text discusses assigning
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe "recommends" rather than "discusses"? Not sure of the ideal way to mention a non-normative change.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's okay. W3C specs include a reference to RFC 8174, which makes it formal that non-capitalized uses of 2119 keywords only have their plain English meaning. I've been meaning to give the docs a once over to undo some of the more egregious uses of "might" and "need"... :)

Copy link
Member

@iherman iherman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be better to add a similar text to the content document as well? Authors should know that this restriction is in the RS because, if they want to do scripting, they have to plan accordingly...

Adopting this approach will isolate documents from each other and from other Internet
domains, thereby limiting access to external URLs, cookies, DOM storage, etc.</p>
<p>Reading Systems need to behave as if a unique origin were allocated to each <a>EPUB
Publication</a>. Adopting this approach will isolate publications from each other,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is worth putting a reference to the 'formal' origin (ie, to https://url.spec.whatwg.org/#origin) emphasize the Web Security aspect. This can be as simple as making the word an active link or a formal reference to the URL spec (probably the best is to do both).

Adopting this approach will isolate documents from each other and from other Internet
domains, thereby limiting access to external URLs, cookies, DOM storage, etc.</p>
<p>Reading Systems need to behave as if a unique origin were allocated to each <a>EPUB
Publication</a>. Adopting this approach will isolate publications from each other,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder whether 'must' is not a better term. I know this is not a normative section, ie, a MUST is not an option, but the usage of the word 'must' may give more emphasis.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, no reason not to start fixing some of these now.

@mattgarrish
Copy link
Member Author

Wouldn't it be better to add a similar text to the content document as well?

Yes, but I'm thinking of doing that in a separate PR. I want to look at the authoring document and ensure it still makes sense. It looks like not all the reading system requirements were reflected in the prose, like which contexts we recommend scripting support in and which are only optional.

@iherman
Copy link
Member

iherman commented Feb 22, 2021

I just realized... we may want to add a link from §11 to §4.4.2. Or merge §4.4.2 to §11? I am tempted to go with the latter, but I am not sure what was the rationale for §4.4.2 originally.

@mattgarrish mattgarrish merged commit bfa0822 into main Feb 26, 2021
@mattgarrish mattgarrish deleted the fix/issue-1156 branch February 26, 2021 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Discussion] Explicitly handle origin in further revisions? What is origin in epub context?
5 participants