Skip to content
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

CSP: Provide source of violation in SecurityPolicyViolationEvents #467

Closed
lweichselbaum opened this issue Sep 8, 2015 · 2 comments
Closed
Labels
Milestone

Comments

@lweichselbaum
Copy link

It would be great, if SecurityPolicyViolationEvents could be used to track down the exact element in the DOM that caused a CSP violation.

When adopting CSP the problem is often tying a particular violation to a given element on the page so the developer can change their templates/code to avoid it. What we currently have is heuristics to e.g. walk the DOM to see if there are any elements with inline event handlers, but this is a bit hacky and not guaranteed to work. Having a reference to the exact element would let us report the xpath, or do nice things on the client-side like highlighting the element. So it might turn out to be one of those tiny things that end up making CSP adoption quite a bit easier.

@mikewest mikewest added this to the CSP 3 milestone Sep 8, 2015
@mikewest mikewest added the CSP label Sep 8, 2015
@mikewest
Copy link
Member

mikewest commented Sep 8, 2015

Seems like a reasonable thing to look at doing in CSP3.

@mikewest
Copy link
Member

mikewest commented Oct 7, 2015

This issue was moved to w3c/webappsec-csp#14

@mikewest mikewest closed this as completed Oct 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants