internetstandards / Internet.nl

Internet standards compliance test suite
https://internet.nl
171 stars 36 forks source link

HSTS parser bug #1022

Open bwbroersma opened 1 year ago

bwbroersma commented 1 year ago

Example deafsluitdijk.nl

Strict-Transport-Security: : max-age=31536000; IncludeSubDomains

Note the extra :, I checked the RFC, the 2 major browsers and other implementations:

bwbroersma commented 1 year ago

The parsing code: https://github.com/internetstandards/Internet.nl/blob/3ddbe6aacec748ecc429fe9327b6a954c8686b0f/checks/tasks/http_headers.py#L523-L569

Issues:

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.