Class AttributeSanitizerExtension
java.lang.Object
org.apache.wiki.markdown.extensions.attributesanitizer.AttributeSanitizerExtension
- All Implemented Interfaces:
com.vladsch.flexmark.html.HtmlRenderer.HtmlRendererExtension,com.vladsch.flexmark.util.misc.Extension
public class AttributeSanitizerExtension
extends Object
implements com.vladsch.flexmark.html.HtmlRenderer.HtmlRendererExtension
HtmlRenderer.HtmlRendererExtension which strips dangerous
author-supplied attributes from the rendered HTML. Flexmark's
AttributesExtension applies attribute lists such as
{onclick=...} written by page authors to the rendered elements
without any filtering, so without this extension any author could attach
on* event handlers (stored XSS), style overlays or
javascript: URLs to rendered content.
HtmlRenderer.ESCAPE_HTML does not cover extension-assigned
attributes.
This extension must be registered after AttributesExtension,
so its attribute provider runs last and sees the final attribute set of each
node.
-
Field Summary
Fields inherited from interface com.vladsch.flexmark.util.misc.Extension
EMPTY_LIST -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic AttributeSanitizerExtensioncreate()voidvoidrendererOptions(com.vladsch.flexmark.util.data.MutableDataHolder options)
-
Constructor Details
-
AttributeSanitizerExtension
public AttributeSanitizerExtension()
-
-
Method Details
-
create
-
rendererOptions
- Specified by:
rendererOptionsin interfacecom.vladsch.flexmark.html.HtmlRenderer.HtmlRendererExtension
-
extend
public void extend(com.vladsch.flexmark.html.HtmlRenderer.Builder rendererBuilder, String rendererType) - Specified by:
extendin interfacecom.vladsch.flexmark.html.HtmlRenderer.HtmlRendererExtension
-