Open Bug 875489 Opened 12 years ago Updated 3 years ago

If STS headers are provided without directives, we should post warnings to STSLOG and the web console to inform developers

Categories

(Core :: Networking: HTTP, defect, P5)

defect

Tracking

()

People

(Reporter: ialagenchev, Unassigned)

Details

(Whiteboard: [necko-would-take])

This code in nsHttpChannel is supposed to retrieve the HSTS header: rv = mResponseHead->GetHeader(atom, stsHeader); if (rv == NS_ERROR_NOT_AVAILABLE) { LOG(("STS: No STS header, continuing load.\n")); return NS_OK; } but if the header is invalid of the following forms: Strict-Transport-Security: Strict-Transport-Security and both of the above variations followed by white space then the result from mResponseHead->GetHeader is NS_ERROR_NOT_AVAILABLE. We miss that the STS header is present and never reach the code that validates the STS header later on.
Can you provide examples of the exact headers, verbatim, that you think we are ignoring? I'm not clear from your description.
I think if the STS header is malformed, we skip it (intentionally). This is where it's parsed: http://mxr.mozilla.org/mozilla-central/source/netwerk/protocol/http/nsHttpHeaderArray.cpp#124 Which requires a colon and a value after the colon and OWS. What are the exact header name/value pairs that are failing? Or better yet, do you have a test we can use to reproduce this?
Summary: nsHttpResponseHead::GetHeader misses some invalid HSTS headers → If STS headers are provided without directives, we should post warnings to STSLOG and the web console to inform developers
Adding this for posterity: It is debatable whether this bug is indeed a bug and if we should ever spend the time to fix it. The consensus is that it might be a nice to have feature to warn developers about headers with missing directives, but it also appears to be OK to ignore such headers. We need to revisit later.
Whiteboard: [necko-would-take]
Priority: -- → P5
Severity: minor → S4
You need to log in before you can comment on or make changes to this bug.