Package org.owasp.html.examples
Class SlashdotPolicyExample
- java.lang.Object
-
- org.owasp.html.examples.SlashdotPolicyExample
-
public class SlashdotPolicyExample extends Object
Based on the AntiSamy Slashdot example.Slashdot (http://www.slashdot.org/) is a techie news site that allows users to respond anonymously to news posts with very limited HTML markup. Now Slashdot is not only one of the coolest sites around, it's also one that's been subject to many different successful attacks. Even more unfortunate is the fact that most of the attacks led users to the infamous goatse.cx picture (please don't go look it up). The rules for Slashdot are fairly strict: users can only submit the following HTML tags and no CSS:
<b>
,<u>
,<i>
,<a>
,<blockquote>
.
Accordingly, we've built a policy file that allows fairly similar functionality. All text-formatting tags that operate directly on the font, color or emphasis have been allowed.
-
-
Field Summary
Fields Modifier and Type Field Description static Function<HtmlStreamEventReceiver,HtmlSanitizer.Policy>
POLICY_DEFINITION
A policy definition that matches the minimal HTML that Slashdot allows.
-
Constructor Summary
Constructors Constructor Description SlashdotPolicyExample()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
main(String[] args)
A test-bed that reads HTML from stdin and writes sanitized content to stdout.
-
-
-
Field Detail
-
POLICY_DEFINITION
public static final Function<HtmlStreamEventReceiver,HtmlSanitizer.Policy> POLICY_DEFINITION
A policy definition that matches the minimal HTML that Slashdot allows.
-
-
Method Detail
-
main
public static void main(String[] args) throws IOException
A test-bed that reads HTML from stdin and writes sanitized content to stdout.- Throws:
IOException
-
-