-
Notifications
You must be signed in to change notification settings - Fork 17
fix(csp): allow duplicate report-* directives #151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall, just nits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, this one is not a nit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just one more thought: Wouldn't it be better to have a general _warnings
key that is an array of warning objects, and could be used for other checks as well:
{
"_warnings": [
{
"type": "duplicate_keys",
"keys": ["report-to"]
}
]
}
If we need any more warnings, I'll extend the scheme. There is no real infrastructure to conveigh these warnings to the user yet, though, apart from matching these to result constants. |
Description
If a CSP entry contains duplicate
report-to
orreport-uri
entries, the entry is still considered valid, similar to browser behaviour. Only the first encountered value is taken into account.(MP-1799)
Motivation
CSP entries were flagged as invalid because of duplicate
report-uri
values. After discussion with the security team,report-*
directives were deemed ok to contain duplicates in our scans. Other duplicates are still flagged as invalid as in the original observatory.Additional details
There is a new result type
CspImplementedButHasDuplicateDirectives
(0 points) that kicks in when the CSP test generally passes, but duplicatereport-*
directives were detected.