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)
Core
Networking: HTTP
Tracking
()
NEW
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.
Comment 1•12 years ago
|
||
Can you provide examples of the exact headers, verbatim, that you think we are ignoring? I'm not clear from your description.
Comment 2•12 years ago
|
||
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?
Reporter | ||
Updated•12 years ago
|
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
Reporter | ||
Comment 3•12 years ago
|
||
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.
Updated•9 years ago
|
Whiteboard: [necko-would-take]
Comment 4•8 years ago
|
||
Bulk change to priority: https://bugzilla.mozilla.org/show_bug.cgi?id=1399258
Priority: -- → P5
Updated•3 years ago
|
Severity: minor → S4
You need to log in
before you can comment on or make changes to this bug.
Description
•