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

Standardize "nosniff" #35

Closed
annevk opened this issue Apr 2, 2015 · 7 comments
Closed

Standardize "nosniff" #35

annevk opened this issue Apr 2, 2015 · 7 comments

Comments

@annevk
Copy link
Member

annevk commented Apr 2, 2015

Research:

Todo:

  • Study various other contexts.
  • Fix tests to match the web-platform-tests framework.

Tentative plan:

  • Define the X-Content-Type-Options header.
  • Add a hook in #concept-fetch that checks a response for "nosniff" violations. If there are violations, return a network error instead.
  • Write a section that defines the check for "nosniff" violations. Checking the request context against the MIME type if a "nosniff" header is around.

Open issue:

  • Might need to annotate the response with a "nosniff" flag of sorts so further checks can be done by special components. E.g. an image decoder might want to reject a GIF with a image/png MIME type (IE11 does this).
@btoews
Copy link

btoews commented Apr 3, 2015

👏

@wanderview
Copy link
Member

I wrote a gecko bug to implement this for fetch:

https://bugzilla.mozilla.org/show_bug.cgi?id=1150897

Our older general "nosniff" bug:

https://bugzilla.mozilla.org/show_bug.cgi?id=471020

@igrigorik
Copy link
Member

@annevk https://tools.ietf.org/html/rfc6648 ... can we drop the X-? /cc @mnot

@annevk
Copy link
Member Author

annevk commented Apr 3, 2015

@igrigorik that would break existing content.

@igrigorik
Copy link
Member

Hmm, I guess a broader question then.. For places where we use X-, how do we migrate away from them? Should we add a clause indicating that UA's should look for optionally X- prefixed headers? i.e. X-Thing == Thing?

@annevk
Copy link
Member Author

annevk commented Apr 3, 2015

I think we should just leave it and not add complexity. And in the future avoid inventing X--stuff altogether. E.g. HTML has application/x-www-form-urlencoded and it's doing just fine for close to two decades now.

@mnot
Copy link
Member

mnot commented Apr 7, 2015

Yep, that RFC is for new things, not existing things. If you need to make a breaking change on one of those headers, that's your opportunity to change the name, but don't do it just to change the name; that's a worse outcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

5 participants