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

Make X-Content-Type-Options #78

Open
Smus4 opened this issue Apr 4, 2023 · 1 comment
Open

Make X-Content-Type-Options #78

Smus4 opened this issue Apr 4, 2023 · 1 comment
Assignees

Comments

@Smus4
Copy link
Collaborator

Smus4 commented Apr 4, 2023

in order to prevent MIME-sniffing attacks:

The Anti-MIME-Sniffing header X-Content-Type-Options was not set to 'nosniff'. This allows older versions of Internet Explorer and Chrome to perform MIME-sniffing on the response body, potentially causing the response body to be interpreted and displayed as a content type other than the declared content type. Current (early 2014) and legacy versions of Firefox will use the declared content type (if one is set), rather than performing MIME-sniffing.

solution: Ensure that the application/web server sets the Content-Type header appropriately, and that it sets the X-Content-Type-Options header to 'nosniff' for all web pages.
If possible, ensure that the end user uses a standards-compliant and modern web browser that does not perform MIME-sniffing at all, or that can be directed by the web application/web server to not perform MIME-sniffing.

possible fix: https://stackoverflow.com/questions/18337630/what-is-x-content-type-options-nosniff

@PatrickMatthiesen
Copy link
Owner

can probably be added with the following, just remember to figure out if it needs to be added before some of the other app.use

app.Use(async (context, next) => { context.Response.Headers.Add("X-Content-Type-Options", "nosniff"); await next.Invoke(); });

@Smus4 Smus4 self-assigned this Apr 18, 2023
@LysetsDal LysetsDal self-assigned this May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

3 participants