You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -64,14 +82,129 @@ need to be explicitly whitelisted using the `allowWithoutAttributes()`
64
82
method if you want them to be allowed through the filter when these
65
83
elements do not include any attributes.
66
84
67
-
----
85
+
[Attribute policies](https://static.javadoc.io/com.googlecode.owasp-java-html-sanitizer/owasp-java-html-sanitizer/20190325.1/org/owasp/html/AttributePolicy.html) allow running custom code too. Adding an attribute policy will not water down any default policy like `style` or URL attribute checks.
Preprocessing happens before a policy is applied, so cannot affect the security
149
+
of the output.
150
+
151
+
## Telemetry
152
+
153
+
When a policy rejects an element or attribute it notifies an [HtmlChangeListener](https://static.javadoc.io/com.googlecode.owasp-java-html-sanitizer/owasp-java-html-sanitizer/20190325.1/org/owasp/html/HtmlChangeListener.html).
154
+
155
+
You can use this to keep track of policy violation trends and find out when someone
156
+
is making an effort to breach your security.
157
+
158
+
```Java
159
+
PolicyFactory myPolicyFactory =...;
160
+
// If you need to associate reports with some context, you can do so.
Copy file name to clipboardExpand all lines: docs/client-side-templates.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ Many client-side templates look for special constructs in text nodes. Often, us
22
22
23
23
## Client side template / expression attributes
24
24
25
-
When filtering client-side templates, it should also be considered to fully cover attributes containing expressions and parseable information that might cause damage or lead to arbitary JavaScript execution.
25
+
When filtering client-side templates, it should also be considered to fully cover attributes containing expressions and parseable information that might cause damage or lead to arbitrary JavaScript execution.
0 commit comments