Closed Bug 998397 Opened 12 years ago Closed 10 years ago

X-Content-Type-Options header missing

Categories

(Marketplace Graveyard :: General, defect, P5)

defect

Tracking

(Not tracked)

VERIFIED FIXED
2015-09-01

People

(Reporter: karthic.6030, Assigned: lucky.lavish, Mentored)

Details

(Whiteboard: [good first bug][lang=py])

Attachments

(3 files)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.116 Safari/537.36 Steps to reproduce: URL : https://marketplace.firefox.com/ The Anti-MIME-Sniffing header X-Content-Type-Options was not set to 'nosniff' Actual results: X CONTENT TYPE OPTIONS HEADER MISSING Expected results: This check is specific to Internet Explorer 8 and Google Chrome. Ensure each page sets a Content-Type header and the X-CONTENT-TYPE-OPTIONS if the Content-Type header is unknown
Raymond - this has come up before. Is this something we should add?
ya you should add x content type options header set to nosniff in configuration to prevent content sniffing
Flags: needinfo?(rforbes)
Priority: -- → P5
need to set in the configuration to prevent content sniffing
this is a pretty minor need, I would classify it as a "best practice". i am pretty sure firefox doesn't even support this header at this time. https://bugzilla.mozilla.org/show_bug.cgi?id=471020
Flags: needinfo?(rforbes)
Whiteboard: [good first bug]
Hi Andy, it looks like this might not be very much clear to the newbie how to fix this. Can you put some information here for newbies so that they can pick this bug and fix it. Thanks, Ram
Flags: needinfo?(amckay)
Adding in HTTP Headers is likely a matter of altering the middleware in Django insert the header as mentioned. Here's a module that works with HTTP headers: https://github.com/mozilla/zamboni/blob/master/mkt/site/middleware.py Here is documentation on middleware: https://docs.djangoproject.com/en/1.8/topics/http/middleware/
Flags: needinfo?(amckay)
I want to work on this
Sure purva, assigning you to this bug. For any doubt, feel free to ask here or on #marketplace on irc.mozilla.org
Assignee: nobody → arushgyl
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Assignee: arushgyl → purva.bansal
Hi Andy, Can you please elaborate on what do you want to convey through altering middleware?
Mentor: mathieu
Mentor: mathieu → mpillard
setting NI for comment 9
Flags: needinfo?(mpillard)
You need to know python/Django for this one, and need to have set up Marketplace backend. You need to modify one of the middleware classes we use or create one and add it to our settings (mkt/settings.py, MIDDLEWARE_CLASSES) to add this functionality. Andy gave a link to some middlewares we are already using that also deal with HTTP headers, as an example you can draw inspiration from. Alternatively, instead of doing all this, you could add a dependency to http://django-secure.readthedocs.org/en/latest/index.html by adding django-secure to requirements/prod.txt, and following django-secure docs to install it. Then follow the same docs to enable/disable what we care about (for this bug, I'd disable everything except SECURE_CONTENT_TYPE_NOSNIFF, we can take care of the other settings in a different bug).
Flags: needinfo?(mpillard)
Whiteboard: [good first bug] → [good first bug][lang=py]
Purva are you still working on this bug?
Flags: needinfo?(purva.bansal)
No, I am pretty much stucked in this problem.
Flags: needinfo?(purva.bansal)
Purva, Can I work on this bug? If you are not working on it?
Flags: needinfo?(purva.bansal)
Yes...
Flags: needinfo?(purva.bansal)
Cool, assigning this to Lavish.
Assignee: purva.bansal → lucky.lavish
Hi [:mat] Would it be okay to add a process_response method to the (/mkt/site/middleware.py, CommonMiddleware) to implement this functionality.
Flags: needinfo?(mpillard)
Actually I'd prefer you add django-secure middleware, this is the better option for the future since django-secure is integrated in django 1.8.
Flags: needinfo?(mpillard)
Flags: needinfo?(mpillard)
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Flags: needinfo?(mpillard)
Resolution: --- → FIXED
Target Milestone: --- → 2015-09-01
any bounty or swag for this bug
Status: RESOLVED → VERIFIED
(In reply to karthic kumar from comment #22) > any bounty or swag for this bug Hi Karthic, The bounty is for Security bugs only (more info - https://www.mozilla.org/en-US/security/bug-bounty/). I am not sure how much you know about our contribution opportunities with Mozilla (or if you are already a volunteer), By the way, you can read about them at https://www.mozilla.org/en-US/contribute/ & you are most welcome to join volunteers (a lot of swags are waiting you there). You can contact me or any of existing contributors if required. Find more mozillians at - https://mozillians.org/ https://reps.mozilla.org/ Thanks, Ram
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: