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 #14

Closed
mikewest opened this issue Oct 7, 2015 · 2 comments
Closed
Labels

Comments

@mikewest
Copy link
Member

mikewest commented Oct 7, 2015

From @lweichselbaum on September 8, 2015 9:12

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.

Copied from original issue: w3c/webappsec#467

@mikewest
Copy link
Member Author

mikewest commented Oct 7, 2015

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

@mikewest
Copy link
Member Author

mikewest commented Sep 8, 2016

This was done at some point. :)

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

1 participant