Skip to content

CSP: Require https: URL scheme #810

@baknu

Description

@baknu

Currently we do not allow for the http: scheme. We do not require https: (so a non defined URL scheme is also allowed):
See:

def test_default_src_5(self):
headers = "default-src 'self' internet.nl *.internet.nl; frame-ancestors 'self'"
self._is_good(headers)

We might want to explicitly require the https: scheme.

See below mail discussion between SR, WK and BK (17 Oct 2022).

Hier wat achtergrond info over schemes (http:, https: of none):
https://csplite.com/csp87/#SOP
Daarin staat ook dat CSP2 en CSP3 net wat anders omgaan met "http:". Merk
trouwens op dat CSP3 formeel nog een Working Draft is (hoewel veel al in de
laatste versies van browsers lijkt te zijn geland) en CSP2 een Recommendation.

Zoals we vanochtend ook bespraken, lijkt het het meest verstandig om https:
voor iedere in CSP opgenomen URL te plaatsen. Ook omdat het niet zeker is dat
een http-->https redirect voor het (hele) websitedomein incl. directories wordt
gebruikt.

Zie ook nog wat relevante comments in een eerdere discussie over de
implementatie van de CSP-test:
#325 (comment)

Laten we nagaan wat de Internet.nl-code nu doet (alleen "http:" afkeuren? of
ook "none" afkeuren en dus alleen "https:" toestaan?), en dan bepalen of we dit
willen aanpassen.

Metadata

Metadata

Assignees

Labels

contentChange (needed) to the content repository alongside with this issue/PRcontent doneChanges to the content repository for this PR are doneenhancementIssues that suggest slight improvements to existing code, tests, etc.questionIssues that involve a question

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions