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

Block requests for suspected dangling markup. #519

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
4 changes: 4 additions & 0 deletions fetch.bs
Original file line number Diff line number Diff line change
Expand Up @@ -2408,6 +2408,10 @@ with a <i>CORS flag</i> and <i>recursive flag</i>, run these steps:
not <a lt="is local">local</a>, set
<var>response</var> to a <a>network error</a>.

<li><p>If |request|'s <a for=request>url</a>'s <a for=url>parser-removed-tab-or-newline flag</a>
is set, and |request|'s <a for=request>url</a> <a for=url>path</a> contains a U+003C
code point ("<code>&lt;</code>"), then set <var>response</var> to a <a>network error</a>.
Copy link
Member

Choose a reason for hiding this comment

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

Path is a list, so this doesn't quite work. Also, < doesn't end up as a literal in the URL, it becomes "%3C".

Copy link
Member Author

Choose a reason for hiding this comment

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

Ugh. Right. Would you prefer that I:

  1. Add a "this is potentially dangling markup" flag to URL that is set during parsing (which might help with the explanation here)?
  2. Walk through the items in path looking for characters?
  3. Serialize the URL and walk through that?

Copy link
Member

Choose a reason for hiding this comment

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

I would be happy with the flag. I don't see how 2 and 3 can work if you want to distinguish between %3C and < on input.


<li><p>Execute <a href=https://w3c.github.io/webappsec-csp/#report-for-request>Report Content Security Policy violations for <var>request</var></a>.
[[!CSP]]

Expand Down