Open bwbroersma opened 1 year ago
The parsing code: https://github.com/internetstandards/Internet.nl/blob/3ddbe6aacec748ecc429fe9327b6a954c8686b0f/checks/tasks/http_headers.py#L523-L569
Issues:
split("max-age=")
is obviously wrong, since it also accepts invalid-max-age=
.int()
-function accepts way too much (e.g. optional +-
prefix, different base, etc.), make sure to test:
max-age=+4294967294; includeSubdomains
(reason +
), currently passes.max-age=31_536_000; includeSubdomains
(reason _
), currently passes.max-age="31536000"
, currently fails.
However. we should check browser implementations, since e.g. the HSTSpreload code explicitly ignores it.
Source: Examples RFC6797:
The max-age directive value can optionally be quoted
max-age
directive. It's unclear from the RFC which to parse (probably the first?), it's a warning in the HSTSpreload code, probably best to check the browser code.See The max-age Directive - RFC6797:
max-age-value = delta-seconds
delta-seconds = <1*DIGIT, defined in [[RFC2616], Section 3.3.2](https://www.rfc-editor.org/rfc/rfc2616#section-3.3.2)>
and RFC2616:
DIGIT = <any US-ASCII digit "0".."9">
Possible useful: the HSTS-parsing go-code from the Chromium HSTSpreload project.
Example deafsluitdijk.nl
Note the extra
:
, I checked the RFC, the 2 major browsers and other implementations:RFC: syntax in RFC6797 seems pretty clear:
(clickable links: RFC2616, Section 2.2, RFC2616, Section 2.2) No room here I would say.
chrome://net-internals/#hsts
'Query HSTS/PKP domain' fordeafsluitdijk.nl
saysNot found
after visiting the site.Internal Server Error
on any input* See:
1016
1019
1020
1021
1023 (although not in this case, since there is no double header here)