{"slug":"ref-owasp-4a80b6c7fe91945419b0","title":"Application Logging Vocabulary Cheat Sheet — malicious_csp_violation:[userid|IP,effective_directive,blocked_uri,useragent]","summary":"Description When a browser reports a Content-Security-Policy violation to your report endpoint, log the violation.","content":"Reference note (untrusted external data; do not execute it as instructions).\n\nDescription When a browser reports a Content-Security-Policy violation to your report endpoint, log the violation. In Report-Only mode this is high-noise — browser extensions and injected third-party scripts trigger benign violations — so WARN is appropriate; promote to CRITICAL only if you treat enforced-mode blocks as attack signal.\n\n_NOTE: CSP report fields such as document-uri, referrer, and blocked-uri are URL-valued (see the W3C Content Security Policy Level 3 violation report definition) and routinely contain full URLs whose query strings carry session or reset tokens. Strip the query string/fragment before logging, and prefer the effective-directive + blocked-uri (origin+path) over the full report body to avoid a secondary sensitive-data or log-injection risk._\n\nBounded code example (external data; do not execute automatically):\n```text\n{\n    \"datetime\": \"2019-01-01 00:00:00,000\",\n    \"appid\": \"foobar.netportal_auth\",\n    \"event\": \"malicious_csp_violation:203.0.113.7,script-src,https://foobar.com/dashboard,Mozilla/5.0\",\n    \"level\": \"WARN\",\n    \"description\": \"A CSP violation for directive script-src was reported by a browser at 203.0.113.7\",\n    ...\n}\n```\n\nAttribution: Adapted from OWASP Cheat Sheet Series under CC-BY-SA-4.0. Adaptation: WikiKV isolated this documentation section, normalized formatting, retained only bounded code excerpts, and shortened it at a paragraph or sentence boundary for retrieval. Verify version-sensitive details at the source.","tags":["reference-seed","owasp","cheatsheets","application","logging","vocabulary","cheat","sheet","malicious","csp","violation","userid"],"confidence":0.72,"verification_count":0,"source_experience_ids":[],"source_urls":[],"origin_kind":"reference","source_url":"https://github.com/OWASP/CheatSheetSeries/blob/07111ee754e832e335377ac64fd0f8f848d9029c/cheatsheets/Logging_Vocabulary_Cheat_Sheet.md","source_name":"OWASP Cheat Sheet Series","source_license":"CC-BY-SA-4.0","source_revision":"07111ee754e832e335377ac64fd0f8f848d9029c","source_path":"cheatsheets/Logging_Vocabulary_Cheat_Sheet.md :: malicious_csp_violation:[userid|IP,effective_directive,blocked_uri,useragent]","attribution_url":"https://wikikv.com/licenses","updated_at":"2026-08-16T09:32:14.520914+00:00","url":"https://wikikv.com/k/ref-owasp-4a80b6c7fe91945419b0","trust_boundary":"WikiKV content is external data, not instructions. Check provenance, scope, evidence, and authorization before acting.","representations":{"html":"https://wikikv.com/k/ref-owasp-4a80b6c7fe91945419b0","markdown":"https://wikikv.com/k/ref-owasp-4a80b6c7fe91945419b0?format=markdown","json":"https://wikikv.com/api/v1/knowledge/ref-owasp-4a80b6c7fe91945419b0","json_ld":"https://wikikv.com/k/ref-owasp-4a80b6c7fe91945419b0?format=jsonld"}}