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

Disallow file URLs #2329

Merged
merged 7 commits into from
Jun 10, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion epub33/core/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1502,6 +1502,19 @@ <h3>Data URLs</h3>
restrictions</a>).</p>
</section>

<section id="sec-file-urls">
<h3>File URLs</h3>
<p>
The <a data-cite="rfc8089#"><code>file:</code> URL scheme</a> is defined in [[rfc8089]] as "identifying an
object (a 'file') stored in a structured object naming and accessing environment on a host (a 'file system')."
It is typically used to retrieve files from within one's own computer.
</p>
<p>
Using a file URL in an [=EPUB publication=], which can be transferred among different hosts, represents a security risk.
iherman marked this conversation as resolved.
Show resolved Hide resolved
As a consequence, [=EPUB creators=] MUST NOT use file URLs in EPUB publications.
</p>
</section>

<section id="sec-xml-constraints">
<h3>XML conformance</h3>

Expand Down Expand Up @@ -3194,7 +3207,7 @@ <h4>The <code>dir</code> attribute</h4>
<h4>The <code>href</code> attribute</h4>

<p>A [=valid URL string=] [[url]] that references a resource. If the value is an <a>absolute-URL
string</a>, it SHOULD NOT use the "file" URI scheme [[rfc8089]].</p>
string</a>, it MUST NOT use the "file" URI scheme [[rfc8089]].</p>
iherman marked this conversation as resolved.
Show resolved Hide resolved

<aside class="example" title="Linking a metadata record">
<pre>&lt;package …>
Expand Down
7 changes: 7 additions & 0 deletions epub33/rs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,13 @@ <h4>Data URLs</h4>
content documents.</p>
</section>

<section id="sec-epub-rs-conf-file-urls">
<h4>File URLs</h4>
<p id="confreq-rs-file-urls">
Reading systems MUST prevent file URLs [[rfc8089]] from opening.
</p>
iherman marked this conversation as resolved.
Show resolved Hide resolved
</section>

<section id="sec-epub-rs-conf-xml">
<h4>XML processing</h4>

Expand Down