Just enabled this module, and set it in CSP report only mode. It's giving me a few PHP notices.

Some extra checks to see if the $report array contains "request" and "request-headers" would be good.

Notice: Undefined index: request i _seckit_csp_report() (rad 181 av sites/all/modules/seckit/seckit.module).
Notice: Undefined index: request-headers i _seckit_csp_report() (rad 182 av sites/all/modules/seckit/seckit.module).
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

p0deje’s picture

Assigned: Unassigned » p0deje

Thanks for the report!

Can you provide me with the following details:

  1. Browser and its version
  2. Dump of the $reports
  3. Logs from JS console (CSP should report both to report-uri and to console
p0deje’s picture

Status: Active » Closed (cannot reproduce)
p0deje’s picture

Closing due to know info within half a year

jweowu’s picture

Status: Closed (cannot reproduce) » Needs review
FileSize
1.09 KB

I can reproduce this, and what's more I see a variety of different keys in the JSON depending on the report in question.

I'm attaching a patch which only assumes the presence of 'violated-directive' and 'blocked-uri', and then simply shows the remainder of the data as an array.

This both resolves the notices, and also logs the data that I wouldn't otherwise have seen.

jweowu’s picture

Version: 7.x-1.5 » 7.x-1.6
jweowu’s picture

A slight tweak to the output, and removing some code which was there to remove 'violated-directive' and 'blocked-uri' from the data array (as despite the duplication, I'd concluded it was preferable to display the full array).

p0deje’s picture

Status: Needs review » Fixed

Thanks for patch, applied and release as 1.7

jweowu’s picture

Thanks. It looks like you applied #4 instead of #6, so here's the changes from #6.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

jweowu’s picture

Fixes from #8 committed in dd5a02b8f92f9b03159315824e0766f91a99217f