Right now, I maintain the Content-Security-Policy for https://www.lidl.de, which is:
Content-Security-Policy: frame-ancestors 'self'; block-all-mixed-content; report-uri https://lidlcsp.report-uri.io/r/default/csp/enforce;
The part with frame-ancestors is to protect against clickjacking.
When going through the violation reports sent to report-uri.io, the number one is the following,
{
"csp-report": {
"blocked-uri": "",
"document-uri": "https://www.lidl.de/",
"original-policy": "frame-ancestors https://www.lidl.de; block-all-mixed-content; report-uri https://lidlcsp.report-uri.io/r/default/csp/enforce",
"violated-directive": "frame-ancestors https://www.lidl.de"
}
}
which is sent from Firefox (as report-uri.io shows). I'm puzzled on two things here:
- Why is this report sent? I can't reproduce it.
- Why is the "original policy" altered ('self' vs. https://www.lidl.de)? Does this make any difference?
- (EDIT) Why is
https://www.lidl.de/
blocked in the following report? The csp explicitly allows iframes on the same site via'self'
.
EDIT:
To make the third question a bit clearer I add another csp-report
:
{
"csp-report": {
"document-uri": "https://www.lidl.de/",
"effective-directive": "frame-ancestors",
"original-policy": "frame-ancestors 'self'; block-all-mixed-content; report-uri https://lidlcsp.report-uri.io/r/default/csp/enforce;",
"blocked-uri": "https://www.lidl.de/"
}
}
If you can reproduce the CSP violation or can trigger other violations I would be happy to learn about them.